Coder Social home page Coder Social logo

horstoeko / zugferd Goto Github PK

View Code? Open in Web Editor NEW
66.0 8.0 18.0 8.1 MB

ZUGFeRD/XRechnung/Factur-X Library

License: MIT License

PHP 82.94% Shell 0.02% XSLT 17.03% Batchfile 0.01%
electronic-invoices electronic-invoicing factur-x xrechnung zugferd en16931 php php7 php8 cross-industry-invoice

zugferd's People

Contributors

danielmarschall avatar dkhalil avatar dubbleclick avatar gaertnermarkus avatar horstoeko avatar kohlerdominik avatar ollivault avatar schrank avatar turbo124 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zugferd's Issues

[FEATURE] Symfony 7 support

Describe the feature
This projects composer.json currently supports symfony packages with ^5|^6. Current symfony version is 7.0, therefore it's not possible to use this package in up-to-date Symfony projects.

[QUESTION] AllowanceCharge on LineItem

Describe the feature
The XInvoice standards needs the field AllowanceCharge on an LineItem Basis. Currently when using xdocument->setDocumentPositionLineSummation($linenetamount, $item->discount); the discount isn't respected in the generated document.
Therefore I would request a function, that adds a LineItem Allowance Charge (BT-136).

Thanks for your awesome library!

doAddTradeLineItem results in summary - mismatch

Method doAddTradeLineItem receives units and unit prices and calculates the total sum by multiplying units and unit prices. The result is stored in $lineTotalAmount. Every line in the resulting XML is correct and has been rounded correctly (precision)

Every line will be added to addToInternalVatBuffer - but without any rounding.

Therefore the resulting BasisAmount has a difference that will be rejected by the validator.

What am I missing? What is the reason, why addToInternalVatBuffer is not rounding? Thank you

[FEATURE] Detailed Input Value References in DocumentBuilder

Describe the feature
Would it be possible for the DocumentBuilder to include the corresponding BT-XX for each input value? Indeed, it is not always easy to find them. Additionally, could you indicate for which profile it is called and if this value is required for the profile(s) in question ?

Sample Code

/**
     * Set grouping of business process information
     *
     * @param string $id // BT-23 (all-profile -> require = true)
     * Identifies the context of a business process where the transaction is taking place, thus allowing the buyer to
     * process the invoice in an appropriate manner.
     * __Note__: These data make it possible to define the purpose of the settlement (invoice of the authorised person,
     * contractual partner, subcontractor, settlement document for a building contract etc.).
     * @return ZugferdDocumentBuilder
     */
    public function setDocumentBusinessProcess(string $id): ZugferdDocumentBuilder
    {
        if ($this->getObjectHelper()->isNullOrEmpty($id)) {
            return $this;
        }

        $busProcessCtxParameter = $this->getObjectHelper()->createClassInstance('ram\DocumentContextParameterType');
        $this->getObjectHelper()->tryCall($busProcessCtxParameter, 'setID', $this->getObjectHelper()->getIdType($id));
        $this->getObjectHelper()->tryCall($this->getInvoiceObject()->getExchangedDocumentContext(), 'setBusinessProcessSpecifiedDocumentContextParameter', $busProcessCtxParameter);

        return $this;
    }

[FEATURE] Add bank name to addDocumentPaymentMeanToCreditTransfer()?

(SEPA) Direct Debit (Lastschrift)

Currently, the following information can be entered to addDocumentPaymentMeanToDirectDebit:

$document->addDocumentPaymentMeanToDirectDebit($kunde['BankIBAN']);

The ZUGFeRD 1.0 documentation gives the following example:

		<ram:SpecifiedTradeSettlementPaymentMeans>
			<ram:TypeCode>59</ram:TypeCode>
			<ram:Information>Betrag wird per SEPA-Lastschrift eingezogen</ram:Information>
			<ram:ID schemeAgencyID="DE98ZZZ09999999999">REF A-123</ram:ID>
			<ram:PayerPartyDebtorFinancialAccount>
				<ram:IBANID>DE21860000000086001055</ram:IBANID>
				<ram:AccountName>Bundeskasse Halle -Darlehen-</ram:AccountName>
			</ram:PayerPartyDebtorFinancialAccount>
			<ram:PayerSpecifiedDebtorFinancialInstitution>
				<ram:BICID>MARKDEF1860</ram:BICID>
				<ram:Name>Deutsche Bundesbank -Filiale Leipzig-</ram:Name>
			</ram:PayerSpecifiedDebtorFinancialInstitution>
		</ram:SpecifiedTradeSettlementPaymentMeans>

I miss a lot of information here, which might be good to include in the XRechnung, like the Lastschriftmandat (REF A-123) and the Gläuber-ID (DE98ZZZ09999999999). What do you think?


(SEPA) Credit Transfer (Überweisung)

Currently, the following information can be entered to addDocumentPaymentMeanToDirectDebit:

$document->addDocumentPaymentMeanToCreditTransfer($lieferant['BankIBAN'], $lieferant['BankKontoinhaber'], null/*Kontonummer*/, $lieferant['BankBIC']);

The ZUGFeRD 1.0 documentation gives the following example:

		<ram:SpecifiedTradeSettlementPaymentMeans>
			<ram:TypeCode>31</ram:TypeCode>
			<ram:Information>per Überweisung</ram:Information>
			<ram:PayeePartyCreditorFinancialAccount>
				<ram:IBANID>DE21860000000086001055</ram:IBANID>
				<ram:AccountName>Bundeskasse Halle -Darlehen-</ram:AccountName>
			</ram:PayeePartyCreditorFinancialAccount>
			<ram:PayeeSpecifiedCreditorFinancialInstitution>
				<ram:BICID>MARKDEF1860</ram:BICID>
				<ram:Name>Deutsche Bundesbank -Filiale Leipzig-</ram:Name>
			</ram:PayeeSpecifiedCreditorFinancialInstitution>
		</ram:SpecifiedTradeSettlementPaymentMeans>

Also here, some information like the bank name are missing.


I would love helping with extending the code, but first I want to hear your opinion. Unfortunately, I am not sure if I can help, because I am not yet familiar with the inner workings of the framework

Payment Usage BT-83

Your question
Hello. I cann't find the function to call to fill the payment usage BT-83 for SEPA credit transfer (58).
Which one do i have to use?

PHP 8.0 and 8.1 support?

Will the package work with PHP 8.0 and 8.1 or why is it limited to 7.3.0 in the composer.json?

Why DateTime instead of DateTimeInterface

Many methods, e.g.

\horstoeko\zugferd\ZugferdDocumentBuilder::setDocumentInformation

have an explicit type check for DateTime, while it could (and should?) be DateTimeInterface. That makes it easier to use DateTimeImmuteable as I do.

Is there a reason to be explicit about it?

[QUESTION] How to use more than 2 decimal places for prices?

This document describes at page 14 you can use up to 11 decimal places for describing a unit price that https://www.e-rechnung-bund.de/wp-content/uploads/2023/04/Uebersichtslisten-Eingabefelder-OZG-RE.pdf

But when I set $document->setDocumentPositionNetPrice(1.23456) (or any other price-things like taxes, summations), I always get 2 decimal places in the XML.

        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>1.23</ram:ChargeAmount>
        </ram:NetPriceProductTradePrice>

I spent several hours trying to find the place where the code does that rounding. I searching for all round( calls in the zugferd library, no success.

I hope you can help me find the issue, because I really need 5+ decimal places for the prices. Thank you very much!

Profile : XRechnung3

WriteEInvoicePDFAndXML and "existingprintlayout.pdf"

I am just starting to implement E-Invoices for our PHP-based shop-system, and a ran across this great class-library.

So far, I think I understood the concept quite well, however there is one question I found no answer to so far.

It concerns "WriteEInvoicePDFAndXML" and the "existingprintlayout.pdf" used in it.

As far as I understood, you can create bot the PDF- and XML-part of an E-Invoice, is that correct?

I guess "existingprintlayout.pdf" is some sort of template file for the PDF invoice-format, but I can't find this file in the installed software installed with composer.

So, may question is: how is this supposed to work?

Is there an "existingprintlayout.pdf"-file, and how can I get hold of it?

Is there a description of how these PDF-templates should look like?

Hope you can enlighten me somehow.

And thanks for this tremendous work!

Add static factory ZugferdDocumentPdfBuilder::fromPdfFile()

Describe the feature
I played around with the example and didn't see, that there are two pdf files created at the end (binary and file save) which lead to a Unable to extract PDF version from file header., which wasn't very helpful.

I would like to add a static factory, so one can be sure it is a file and therefore throw a proper error message if the file does not exist, instead of assuming if it is not a file, it is a pdf stream, which leads to unhelpful error messages

Expected behavior
Increase the developer experience by providing interfaces which help PHP to improve assumptions and therefore error messages

Sample Code

public static function fromPdfFile(ZugferdDocumentBuilder $documentBuilder, string $pdfData): self
{
    if (!is_file($pdfData)) {
        throw new \InvalidArgumentException("The given PDF file does not exist.");
    }
    return new self($documentBuilder, $pdfData);
}

Landscape format pdf

Hello,

I need to generate a landscape format PDF using ZugferdDocumentPdfBuilder.

I figured out that you used Fpdi useTemplate method. Unfortunately, to make the document adjustable, a parameter needs to be passed to the method (6st argument) because, by default the "adjustPageSize" is set to false.

class ZugfedDocumentPdfBuilder method startCreatePdf()

Possible to do something to specify if we want an auto resize document builder ?

Thx for your answer,
Regards.

[BUG] Wrong filename of embedded file?

Page 23 of the ZUGFeRD 2.1.1 specification writes:


Embedding in PDF/A-3

  • The embedded file is still called factur-x.xml.
  • The metadata extension schema of ZUGFeRD PDFA has changed; this in now referred to as ZUGFeRD version 2p0.
  • Documents serving as invoicing aids which are embedded in the PDF are referenced to via a relative path from within the XML-file

Currently, the embedded file is called xrechnung.xml. I am not sure about the version (how do I see that?)

For some reason, the validator of the ZUGFeRD community does validate the PDFs, but I still think the file should be renamed to fit the specification better. What do you think?

Edit: For testing, I have ammendend ZugferdProfiles.php. The validator of the ZUGFeRD community also validates a PDF with the embedded file "factur-x.xml".

I can send a PR, but feel free to reject it in case I have missed some specification which legalized the name "xrechnung.xml".

[FEATURE] Add Creditor ID to addDocumentPaymentMeanToDirectDebit()?

The following code:
$document->addDocumentPaymentMeanToDirectDebit('DE02100500000054540402');

Produces (using XRechnung3 Profile):

      <ram:SpecifiedTradeSettlementPaymentMeans>
        <ram:TypeCode>59</ram:TypeCode>
        <ram:PayerPartyDebtorFinancialAccount>
          <ram:IBANID>DE02100500000054540402</ram:IBANID>
        </ram:PayerPartyDebtorFinancialAccount>
      </ram:SpecifiedTradeSettlementPaymentMeans>

The validator does reject the document, because Credit Identifier (Gläubiger ID) is missing:

val-sch.2.1	BR-DE-30	error	[BR-DE-30] Wenn "DIRECT DEBIT" BG-19 vorhanden ist, dann muss "Bank assigned creditor identifier" BT-90 übermittelt werden.
Pfad: /rsm:CrossIndustryInvoice

According to this article , these are the changes for XRechnung 2.3.1

  • BR-DE-29: Das Element „Mandate reference identifier“ (BT-89) muss übermittelt werden, wenn die Gruppe DIRECT DEBIT“ (BG-19) übermittelt wird.
  • BR-DE-30: Das Element „Bank assigned creditor identifier“ (BT-90) muss übermittelt werden, wenn die Gruppe „DIRECT DEBIT“ (BG-19) übermittelt wird.
  • BR-DE-31: Das Element „Debited account identifier“ (BT-91) muss übermittelt werden, wenn die Gruppe „DIRECT DEBIT“ (BG-19) übermittelt wird.

[QUESTION] Invoice with 0 Tax - Code E

Hello together,

I'm not sure if it's a feature, bug, or question. So I will explain ist

I create invoices with 0.00 tax 'Code E'. when I type the following:

[...]
$document = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EN16931);
$document
[...]
->addDocumentTax("E", "VAT", 0.0, 0.0, 0.0, '[reason]', 'VATEX-EU-132-1B') 
->setDocumentSummation(1.0, 1.0, 1.0, 0.0, null, 1.0, 0.0, null, 0.0)
->addDocumentPaymentTerm("Payable immediately")

->addNewPosition(1) 
->setDocumentPositionProductDetails('Item') 
->setDocumentPositionNote('Description') 
->setDocumentPositionGrossPrice(1.0) 
->setDocumentPositionNetPrice(1.0) 
->setDocumentPositionQuantity(1.0, 'H87') 
->addDocumentPositionTax('E ', 'VAT', 0.0, null, '[reason]', 'VATEX-EU-132-1B') 
->setDocumentPositionLineSummation(1.0)
[...]

When I now validate this with an online tool, I get this error message:

[BR-E-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is "Exempt from VAT" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102 ) are "Exempt from VAT".

Where is my mistake in thinking? What did I do wrong? Can someone help me, please?

Sorry my english is not good, I tried to translate it with google ;)

Thanks a lot
Dagobert

[FEATURE] Get document as string

Describe the feature
I would like to push the result of the generateDocument() directly to the S3 storage via Storage::disk('minio_private')->put(). Therefore a public method in the PdfService would be nice, for recieving the pdf content as stream or string.

ubl support

It would be nice if ubl (i only found this https://github.com/horstoeko/ubl) could be integrated or if there is a idea to use it with zugferd or zugferdvisualizer.

Do you have pans with that?

Thanks
Chris

[BUG] PDF creation/merge fails

Describe the bug
When I try to merge or create a PDF file with a XML file via ZugferdDocumentPdfMerger or ZugferdDocumentPdfBuilder, I always get the following error: PHP message: PHP Fatal error: Declaration of setasign\\Fpdi\\FpdfTplTrait::setPageFormat($size, $orientation) must be compatible with TCPDF::setPageFormat($format, $orientation = 'P') in /var/www/custom/zugferdxmlbills/includes/setasign/fpdi/src/FpdfTplTrait.php on line 48'

To Reproduce
Steps to reproduce the behavior:
$pdfMerger = new ZugferdDocumentPdfMerger($xmlfile, $pdfFilename); $pdfMerger->generateDocument(); $pdfMerger->saveDocument('/custom/zugferdxmlbills/temp/'.$invoice->ref.'.pdf');
With an existing XML and PDF file. I get the same error when using the PdfBuilder.

Expected behavior
I want to receive a generated PDF file which includes the ZUGFeRD xml

Additional information:

  • OS: Linux
  • OS-Version: Debian 11
  • PHP-Version PHP8.1

Additional context
Thanks for your help.

[BUG] CountryID Rendering PROFILE_MINIMUM

Describe the bug
There is an issue with the countryID of the profile; no matter what I do, the 2-letter code does not appear.

<ram:PostalTradeAddress>
          <ram:CountryID>XX</ram:CountryID>
</ram:PostalTradeAddress>

This renders as:

<ram:PostalTradeAddress/>

[BUG] ZugferdSettings::setUnitAmountDecimals() only works for the first item

Describe the bug
The newly introduced setter to set amount decimals for a specific schema does only work for the first item added to the document. The next item will have a different node path, e.g.:

First item

/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:ChargeAmount

Second item

/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[2]/ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:ChargeAmount

Mind the [2] within IncludedSupplyChainTradeLineItem. This way calling ZugferdSettings::setUnitAmountDecimals() will only affect the first item as the schema within the setter is explicitly set to /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:ChargeAmount

To Reproduce
Use:

ZugferdSettings::setUnitAmountDecimals( 5 );
$document = ZugferdDocumentBuilder::CreateNew( ZugferdProfiles::PROFILE_XRECHNUNG_2_3 );

for ( $i = 1; $i <= 10; $i++ ) {
    $document->addNewPosition( $i );

    $document->setDocumentPositionGrossPrice( 10.22552 );
    $document->setDocumentPositionNetPrice( 10.22552 );
    $document->setDocumentPositionLineSummation( 10.23 );
}

echo $document->getContent();
exit();

See how prices starting with the second item will be rounded to 2 decimals in the output xml file.

Expected behavior
Should work for all the items added.

Best,
Dennis

Generating electronic quotes

Your question
Hi,
we're looking for generating electronic quotes. Which document type should we use to accomplish this? We didn't find any type suitable.

Screenshots
If applicable, add screenshots to help explain your question.

Additional context
Add any other context about the question here.

Example how to use getDocumentAdditionalReferencedDocument

I try to make anything with getDocumentAdditionalReferencedDocument, but Inever get any details.
Smething like that?

$Attachments = $document->getDocumentAdditionalReferencedDocuments($additionalrefdocs);
foreach ($additionalrefdocs as $key => $value) {
$issuerassignedid = $value[IssuerAssignedID];
$test_Attachment = $document->firstDocumentAdditionalReferencedDocument($value[IssuerAssignedID]);
print_r($test_Attachment);

OR MAYBE
$test_Attachment = $document->getDocumentAdditionalReferencedDocument($issuerassignedid);
}

How can I acces the details in the example xml enlosed?

Thanks
Chris
XRECHNUNG_Elektron.xml.txt

Generated PDFs without attachment

Your question
If I run En16931PdfMerger.php in examples folder (original version, no edit), the generated fullpdf.pdf file does not contain the xml attachment. ZF/FX Validation (Zugferd Community) also fails (XML not present), so it doesn't seem to be a bug in adobe reader.

Screenshots
pdf-failure

Additional context
Great package, generating XML works perfect, I just get stucked combining it with a given pdf file. Thank you!

[ENHANCEMENT] Issue with Adding Multiple BT-29 Using ->setDocumentSeller() in BASIC Profile

Hi @horstoeko,
Describe the bug

In the BASIC profile, I can't add multiple BT-29 with ->setDocumentSeller().
Only the last sellertradeparty taken into account is correct.

<ram:SellerTradeParty>
        <ram:ID>910</ram:ID>
        <ram:Name>Lieferant GmbH</ram:Name>
        <ram:PostalTradeAddress>
          <ram:CountryID>FR</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="VA">6</ram:ID>
        </ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>

To Reproduce

$document
                ->setDocumentSeller("Lieferant GmbH", "549910")
                ->setDocumentSeller("Lieferant GmbH", "910");

Wont set DueDate

When creating a ZUGFeRD / XRechnung invoice the DueDate of the invoice won't set even if im setting it in setDocumentInformation() via $effectiveSpecifiedPeriod nor with addDocumentPaymentTerm().

Fully payed invoices aren't valid

Hi,
when generating an already payed invoice using XRechnung_2.2, the generated xml is invalid. See the examples afterwards:

payed:

<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>34.60</ram:LineTotalAmount>
<ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
<ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>
<ram:TaxBasisTotalAmount>34.60</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">6.57</ram:TaxTotalAmount>
<ram:GrandTotalAmount>41.17</ram:GrandTotalAmount>
<ram:DuePayableAmount>0.00</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>

unpayed:

<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>403.61</ram:LineTotalAmount>
<ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
<ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>
<ram:TaxBasisTotalAmount>403.61</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">76.69</ram:TaxTotalAmount>
<ram:GrandTotalAmount>480.30</ram:GrandTotalAmount>

THE FOLLOWING LINE IS MISSING IN THE PAYED XML
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>
-----------------------------------------
<ram:DuePayableAmount>480.30</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>

If you need anything else let me know.
Lars

Multiple Deprecation Warnings in 1.0.54

with php 8 you get multiple deprecation warnings when running the Code. Would be nice if you could change the parameter order and/or parameter defaults.

`Deprecated: Optional parameter $typeCode declared before required parameter $calculatedAmount is implicitly treated as a required parameter in /var/www/html/prdevel/vendor/horstoeko/zugferd/src/ZugferdDocumentBuilder.php on line 2346

Deprecated: Optional parameter $taxCategoryCode declared before required parameter $rateApplicablePercent is implicitly treated as a required parameter in /var/www/html/prdevel/vendor/horstoeko/zugferd/src/ZugferdDocumentBuilder.php on line 2478

Deprecated: Optional parameter $typeCode declared before required parameter $rateApplicablePercent is implicitly treated as a required parameter in /var/www/html/prdevel/vendor/horstoeko/zugferd/src/ZugferdDocumentBuilder.php on line 3433`

[DOC] Documentation error at ...TaxRegistration-functions

There are multiple functions to add tax registration of various participants which share parameters, code and documentation.
I guess the order of the two parameters was once reversed and thereby some documentation errors emerged.
I stumbled upon it while comparing the ZugferdQuickDescriptor example with the corresponding documented source code to be able to understand all the parameters.

To find all occurences use this search:
https://github.com/search?q=repo%3Ahorstoeko%2Fzugferd+path%3A%2F%5Esrc%5C%2F%2F+TaxRegistration%28&type=code

Some examples:

* @param string|null $taxregtype Type of tax number of the seller

Currently the documentation of $taxregtype and $taxregid is like this:

     * @param  string|null $taxregtype Type of tax number of the seller
     * @param  string|null $taxregid   Tax number of the seller or sales tax identification number of the (FC = Tax number, VA = Sales tax number)
     * @return ZugferdDocumentBuilder
     */
    public function addDocumentSellerTaxRegistration(?string $taxregtype = null, ?string $taxregid = null): ZugferdDocumentBuilder

It should be like this:

     * @param  string|null $taxregtype Type of tax number of the seller (FC = Tax number, VA = Sales tax identification number)
     * @param  string|null $taxregid   Tax number of the seller or sales tax identification number of the seller
     * @return ZugferdDocumentBuilder
     */
    public function addDocumentSellerTaxRegistration(?string $taxregtype = null, ?string $taxregid = null): ZugferdDocumentBuilder

* @param string $no

Currently the documentation and parameter naming of $taxregtype and $taxregid is like this:

     * @param  string $no
     * Tax number of the buyers
     * @param  string $schemeID
     * Tax number of the buyers or sales tax identification number of the (FC = Tax number, VA = Sales tax number)
     * @return ZugferdQuickDescriptor
     */
    public function doAddBuyerTaxRegistration(string $no, string $schemeID): ZugferdQuickDescriptor
    {
        $this->addDocumentBuyerTaxRegistration($no, $schemeID);

It should be like this:

     * @param  string|null $taxregtype Type of tax number of the seller (FC = Tax number, VA = Sales tax identification number)
     * @param  string|null $taxregid   Tax number of the seller or sales tax identification number of the seller
     * @return ZugferdQuickDescriptor
     */
    public function doAddBuyerTaxRegistration(?string $taxregtype = null, ?string $taxregid = null): ZugferdQuickDescriptor
    {
        $this->addDocumentBuyerTaxRegistration($taxregtype, $taxregid);

[BUG] BR19 Violation: Missing BG12 in XML

Describe the bug
The BR19 is not respected and the BG12 is not added to the XML.
BR-19: The Seller tax representative postal address (BG-12) shall be provided in the Invoice, if the Seller (BG-4) has a Seller tax representative party (BG-11).

Here is the XML part obtained from BG11.
ram:SellerTaxRepresentativeTradeParty
ram:Name1</ram:Name>
</ram:SellerTaxRepresentativeTradeParty>

I am looking to correct it, but if you find it first, even better.
Kind regards.

Unable to find PDF file header.

Hello

I try to use the package, but I get an error:

setasign \ Fpdi \ PdfParser
PdfParserException
PHP 8.1.8
9.52.15
Unable to find PDF file header.

  • I copied and pasted the example En16931SimpleWithPdf.php and include this in my controller

  • I have an error in my terminal

Undefined method 'generateDocument'.
Undefined method 'saveDocument'.

  • However, I have the use of classes
use horstoeko\zugferd\ZugferdDocumentBuilder;
use horstoeko\zugferd\ZugferdDocumentPdfBuilder;
use horstoeko\zugferd\ZugferdProfiles;
use horstoeko\zugferd\codelists\ZugferdPaymentMeans;
  • what my composer.json includes
    "require": {
        "php": "^8.0.2",
        "barryvdh/laravel-dompdf": "2.0.0",
       [...]
        "horstoeko/zugferd":"^1",
        "setasign/fpdf": "^1.8",
        "setasign/fpdi": "^2.3"
    },

did I miss something?

Regards

Kévin

[BUG] Error Message with PROFILE_BASIC Document Generation

Describe the bug
PROFILE_BASIC is causing an error "Cannot access private property horstoeko\zugferd\entities\basic\udt\TextType::$__value". I don't understand why I'm getting this message. I created a document with PROFILE_BASICWL, validated it with the same values, same set and add methods, but when I built it with PROFILE_BASIC, it gave me this message and I can't seem to find the source.

Not compatible with xrechnung_2.3 and xrechnung_3.0

Hi there 👋

First of all - fantastic work. Thank you for building this!
Currently, this library is not up to date with new releases of the specification.
The specs for xrechnung_2.3 and xrechnung_3.0 were released by kosit.

I would love to help, but I need to figure out where to start. Can you point me in the right direction?

Getting all positions / dumping whole factur-x xml

Hi,

I'm trying to get all invoice positions (or the whole xml document) attached to a pdf into a php object. I've looked around the source but there are so many methods that I'm honestly getting lost. Would you kindly help with an example code?

Thanks lots, Pavel

Create new XInvoice from existing xml file

Hi there,
we currently trying to implement a "cache" like solution for InvoiceNinja. But were keep stoping on these lines:
https://github.com/invoiceninja/invoiceninja/pull/8697/files#diff-558c6325a311d57c92a9f54148bb37d8aefe30fdb8e3a7d5371966586b2cf773R47-R65.

So to give you a matter of context. The invoicing system is currently generating the single xml file and saves it. When the customers requests the invoice pdf file, this method is launched to reuse the generated xml-file and embed it into the pdf.

Is there a way to re-use the read xml file to build a "new" xml-document or do I really need to parse every parameter and pass it through to the DocumentBuilder? Any ideas are appreciated.

Kind regards,
Lars Kusch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.