Hello,
I found what seems to be an issue in the Factur-X generation of PDF Invoice 5.0.5.
In facturx.php, the monetary summation currently always contains:
$this->_addElement($dom, $monetarySummation, $this->nsRam, 'ram:TotalPrepaidAmount', $this->_amount($tax_inclusive_amount));
$this->_addElement($dom, $monetarySummation, $this->nsRam, 'ram:DuePayableAmount', $this->_amount(0));
This means that every generated Factur-X invoice is marked as fully prepaid, regardless of the actual payment method or whether any payment has already been received.
In my case, the payment method is:
order_payment_method = banktransfer
It is displayed to the customer as “Rechnung” / payment by invoice.
The payment method is configured so that the HikaShop order status is immediately set to confirmed. This is intentional, because the confirmation email, invoice and event ticket should be generated immediately after the order.
However, at that point no payment has been received yet. The customer still has to pay the invoice by bank transfer.
The generated Factur-X XML currently contains:
<ram:TotalPrepaidAmount>250.00</ram:TotalPrepaidAmount>
<ram:DuePayableAmount>0.00</ram:DuePayableAmount>
This results in the validator visualization showing:
Prepaid amount: 250.00 EUR
Amount due: 0.00 EUR
But the correct values at the time the invoice is issued should be:
Prepaid amount: 0.00 EUR
Amount due: 250.00 EUR
The Factur-X document passes validation without errors or warnings, because the XML is formally consistent, but the payment information is factually incorrect.
It looks like the current Factur-X generator always assumes that the full invoice amount has already been paid.
Could you please check whether TotalPrepaidAmount and DuePayableAmount should instead be determined based on the actual payment state / payment method?
For reference:
PDF Invoice version: 5.0.5
Payment method: banktransfer
Order status: confirmed
Invoice total: 250.00 EUR
Payment received at invoice creation: 0.00 EUR
Regards,
Thomas