コード例 #1
0
    def demo_eor(self):
        """
        This demo shows how you should report your invoice to the FURS.
        """

        # First we'll need to initialize FURSInvoice APi - so that it loads all the certs
        api = FURSInvoiceAPI(p12_path=P12_CERT_PATH,
                             p12_password=P12_CERT_PASS,
                             production=False,
                             request_timeout=1.0)

        date_issued = datetime.now(tz=pytz.UTC)
        # let's get that ZOI
        zoi = api.calculate_zoi(
            tax_number=10039856,  # Issuer Tax Number
            issued_date=date_issued,  # DateTime of the Invoice
            invoice_number='11',  # Invoice Number - Sequential
            business_premise_id='BP105',  # Business premise ID
            electronic_device_id='B1',  # Electronic Device ID
            invoice_amount=Decimal('19.15'))  # Invoice Amount

        print("ZOI: " + zoi)

        # Construct TaxesPerSeller object - for each seller.
        # In most cases there will be just one seller - the one that issues the invoice
        # For some cases - you may need to include more sellers. In that case
        #                  do not forget to set seller_tax_number for the other sellers.
        #                  you don't need to set it for your company - but you do for others.
        seller_one = TaxesPerSeller(other_taxes_amount=None,
                                    exempt_vat_taxable_amount=None,
                                    reverse_vat_taxable_amount=None,
                                    non_taxable_amount=None,
                                    special_tax_rules_amount=None,
                                    seller_tax_number=None)

        seller_one.add_vat_amount(tax_rate=22, tax_base=23.14, tax_amount=5.09)
        seller_one.add_vat_amount(tax_rate=9.5,
                                  tax_base=35.14,
                                  tax_amount=3.34)
        # 5% vat - for books etc...
        seller_one.add_vat_amount(tax_rate=5, tax_base=10, tax_amount=0.5)

        # get EOR code from FURS
        eor = api.get_invoice_eor(
            zoi=zoi,
            tax_number=10039856,
            issued_date=date_issued,
            invoice_number='11',
            business_premise_id='BP105',
            electronic_device_id='B1',
            invoice_amount=66.71,
            taxes_per_seller=[seller_one],
            operator_tax_number=12345678,
            reference_invoice_number=['10', '11'],
            reference_invoice_business_premise_id=['BP105', 'BP105'],
            reference_invoice_electronic_device_id=['B1', 'B1'],
            reference_invoice_issued_date=[date_issued, date_issued])

        print("EOR: " + eor)
コード例 #2
0
    def demo_eor(self):
        """
        This demo shows how you should report your invoice to the FURS.
        """

        # First we'll need to initialize FURSInvoice APi - so that it loads all the certs
        api = FURSInvoiceAPI(p12_path=P12_CERT_PATH,
                             p12_password=P12_CERT_PASS,
                             production=False,
                             request_timeout=1.0)

        date_issued = datetime.now(tz=pytz.UTC)
        # let's get that ZOI
        zoi = api.calculate_zoi(
            tax_number=10039856,  # Issuer Tax Number
            issued_date=date_issued,  # DateTime of the Invoice
            invoice_number='11',  # Invoice Number - Sequential
            business_premise_id='BP105',  # Business premise ID
            electronic_device_id='B1',  # Electronic Device ID
            invoice_amount=Decimal('19.15'))  # Invoice Amount

        print("ZOI: " + zoi)

        # get EOR code from FURS
        eor = api.get_invoice_eor(
            zoi=zoi,
            tax_number=10039856,
            issued_date=date_issued,
            invoice_number='11',
            business_premise_id='BP105',
            electronic_device_id='B1',
            invoice_amount=66.71,
            low_tax_rate_base=35.14,
            low_tax_rate_amount=3.34,
            high_tax_rate_base=23.14,
            high_tax_rate_amount=5.09,
            operator_tax_number=12345678,
            reference_invoice_number=['10', '11'],
            reference_invoice_business_premise_id=['BP105', 'BP105'],
            reference_invoice_electronic_device_id=['B1', 'B1'],
            reference_invoice_issued_date=[date_issued, date_issued])

        print("EOR: " + eor)
コード例 #3
0
    def demo_eor(self):
        """
        This demo shows how you should report your invoice to the FURS.
        """

        # First we'll need to initialize FURSInvoice APi - so that it loads all the certs
        api = FURSInvoiceAPI(p12_path=P12_CERT_PATH, p12_password=P12_CERT_PASS, production=False, request_timeout=1.0)

        date_issued = datetime.now()
        # let's get that ZOI
        zoi = api.calculate_zoi(
            tax_number=10039856,  # Issuer Tax Number
            issued_date=date_issued,  # DateTime of the Invoice
            invoice_number="11",  # Invoice Number - Sequential
            business_premise_id="BP101",  # Business premise ID
            electronic_device_id="B1",  # Electronic Device ID
            invoice_amount=Decimal("19.15"),
        )  # Invoice Amount

        print("ZOI: " + zoi)

        # get EOR code from FURS
        eor = api.get_invoice_eor(
            zoi=zoi,
            tax_number=10039856,
            issued_date=date_issued,
            invoice_number="11",
            business_premise_id="BP101",
            electronic_device_id="B1",
            invoice_amount=66.71,
            low_tax_rate_base=35.14,
            low_tax_rate_amount=3.34,
            high_tax_rate_base=23.14,
            high_tax_rate_amount=5.09,
            operator_tax_number=12345678,
        )

        print("EOR: " + eor)
コード例 #4
0
    def demo_zoi(self):
        """
        Obtaining Invoice ZOI - Protective Mark of the Invoice Issuer

        Our Invoice Number on the Receipt is:
        11/BP101/B1

        Where:
         * 11 - Invoice Number
         * BP101 - Business premise ID
         * B1 - Electronic Register ID
        """

        # First we'll need to initialize FURSInvoice APi - so that it loads all the certs
        api = FURSInvoiceAPI(p12_path=P12_CERT_PATH,
                             p12_password=P12_CERT_PASS,
                             production=False,
                             request_timeout=1.0)

        date_issued = datetime.now(tz=pytz.UTC)
        # let's get that ZOI
        zoi = api.calculate_zoi(
            tax_number=10039856,  # Issuer Tax Number
            issued_date=date_issued,  # DateTime of the Invoice
            invoice_number='11',  # Invoice Number - Sequential
            business_premise_id='BP101',  # Business premise ID
            electronic_device_id='B1',  # Electronic Device ID
            invoice_amount=Decimal('19.15'))  # Invoice Amount

        print("ZOI: " + zoi)

        # Let's obtain data for Code128/QR/PDF417 that should be placed at the bottom of the Invoice
        print_data = api.prepare_printable(tax_number=10039856,
                                           zoi=zoi,
                                           issued_date=date_issued)

        print("QR/Code128/PDF417 Data: " + print_data)
コード例 #5
0
    def demo_zoi(self):
        """
        Obtaining Invoice ZOI - Protective Mark of the Invoice Issuer

        Our Invoice Number on the Receipt is:
        11/BP101/B1

        Where:
         * 11 - Invoice Number
         * BP101 - Business premise ID
         * B1 - Electronic Register ID
        """

        # First we'll need to initialize FURSInvoice APi - so that it loads all the certs
        api = FURSInvoiceAPI(p12_path=P12_CERT_PATH,
                             p12_password=P12_CERT_PASS,
                             production=False,
                             request_timeout=1.0)

        date_issued = datetime.now(tz=pytz.UTC)
        # let's get that ZOI
        zoi = api.calculate_zoi(tax_number=10039856,  # Issuer Tax Number
                                issued_date=date_issued,  # DateTime of the Invoice
                                invoice_number='11',  # Invoice Number - Sequential
                                business_premise_id='BP101',  # Business premise ID
                                electronic_device_id='B1',  # Electronic Device ID
                                invoice_amount=Decimal('19.15'))  # Invoice Amount

        print("ZOI: " + zoi)

        # Let's obtain data for Code128/QR/PDF417 that should be placed at the bottom of the Invoice
        print_data = api.prepare_printable(tax_number=10039856,
                                    zoi=zoi,
                                    issued_date=date_issued)

        print("QR/Code128/PDF417 Data: " + print_data)