Coder Social home page Coder Social logo

Fully payed invoices aren't valid about zugferd HOT 8 CLOSED

LarsK1 avatar LarsK1 commented on August 27, 2024
Fully payed invoices aren't valid

from zugferd.

Comments (8)

LarsK1 avatar LarsK1 commented on August 27, 2024 1

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.

horstoeko avatar horstoeko commented on August 27, 2024

Hi @LarsK1,

can you send me a little snippet of the code which you use?

from zugferd.

LarsK1 avatar LarsK1 commented on August 27, 2024

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.

horstoeko avatar horstoeko commented on August 27, 2024

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.

LarsK1 avatar LarsK1 commented on August 27, 2024

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);
        }

image
I've attached the xml-invoice for test again (please rename the file extension to .xml)
Rechnung.txt

from zugferd.

horstoeko avatar horstoeko commented on August 27, 2024

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.

LarsK1 avatar LarsK1 commented on August 27, 2024

Hi @horstoeko ,
I've just got an idea: how can I set the payed amount?

from zugferd.

horstoeko avatar horstoeko commented on August 27, 2024

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)

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.