Comments (8)
Hi @horstoeko ,
understood. Thanks for your help. I fixed my implemtation - I totally misunderstood the last and second parameter.
Now it works as expected.
from zugferd.
Hi @LarsK1,
can you send me a little snippet of the code which you use?
from zugferd.
Hi @horstoeko,
your code is issued in an invoicing system. See here: https://github.com/invoiceninja/invoiceninja/blob/557db4ce5e82ba3a4111f7cfc802d1be21601ada/app/Services/Invoice/EInvoice/ZugferdEInvoice.php#L166
from zugferd.
Hi @LarsK1,
Thanks for the link. I have implemented 3 more unit tests for the purpose of validating your request (see here) It seems that the property $this->invoice->partial
returns a null value (see the tests testTotalPrepaidAmountIsNull
). Would you please be so kind to check once the returned value of the just mentioned property?
Regards
from zugferd.
Hi,
I just had a look. If the invoice is fully paid, the condition isPartial() is met. The field then return the string "0.0000". I just changed it to a float with the value 0.0. The issue still exists...
if ($this->invoice->isPartial()) {
$xrechnung->setDocumentSummation($this->invoice->amount, $this->invoice->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), null, 0.0);
} else {
$xrechnung->setDocumentSummation($this->invoice->amount, $this->invoice->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), null, 0.0);
}
I've attached the xml-invoice for test again (please rename the file extension to .xml)
Rechnung.txt
from zugferd.
Hi @LarsK1,
i don't think this is a library problem. My implementation does not calculate amounts automatically. So you have to set the DuePayableAmount yourself. But it could be that I still don't understand your problem ;-). In your example the DuePayableAmount should be 59.50 according to my understanding.
from zugferd.
Hi @horstoeko ,
I've just got an idea: how can I set the payed amount?
from zugferd.
Hi @LarsK1,
The amount already paid can be set via the last parameter of the setDocumentSummation
method. See:
public function setDocumentSummation(
float $grandTotalAmount,
float $duePayableAmount,
?float $lineTotalAmount = null,
?float $chargeTotalAmount = null,
?float $allowanceTotalAmount = null,
?float $taxBasisTotalAmount = null,
?float $taxTotalAmount = null,
?float $roundingAmount = null,
?float $totalPrepaidAmount = null): ZugferdDocumentBuilder
I hope this helps you. In any case, please keep me informed.
from zugferd.
Related Issues (20)
- [FEATURE] Add Creditor ID to addDocumentPaymentMeanToDirectDebit()? HOT 3
- Add static factory ZugferdDocumentPdfBuilder::fromPdfFile()
- Why DateTime instead of DateTimeInterface HOT 2
- [QUESTION] How to use more than 2 decimal places for prices? HOT 6
- [BUG] Wrong filename of embedded file? HOT 1
- [FEATURE] Detailed Input Value References in DocumentBuilder HOT 3
- [BUG] CountryID Rendering PROFILE_MINIMUM HOT 6
- [BUG] Error Message with PROFILE_BASIC Document Generation HOT 23
- [DOC] Documentation error at ...TaxRegistration-functions HOT 1
- [BUG] ZugferdSettings::setUnitAmountDecimals() only works for the first item HOT 4
- [FEATURE]Add the PHP requirement to the Readme HOT 1
- [BUG] BR19 Violation: Missing BG12 in XML HOT 4
- Example how to use getDocumentAdditionalReferencedDocument HOT 5
- Multiple Deprecation Warnings in 1.0.54 HOT 1
- [ENHANCEMENT] Issue with Adding Multiple BT-29 Using ->setDocumentSeller() in BASIC Profile HOT 4
- [FEATURE]Add multiple IDs for several trade parties
- Deprecated: Optional parameter $typeCode declared before required parameter HOT 2
- How to use addDocumentPositionAdditionalReferencedDocument? HOT 3
- [QUESTION] setDocumentShipToAddress() adds no shipping data HOT 6
- [BUG] PDF Merger / Loose Comparison / adherence to PDF/A-3b / EOL marker shall be immediately followed by a % HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zugferd.