read invoice taxes from xml

This commit is contained in:
Frederik Jaeckel 2025-01-17 12:53:31 +01:00
parent 530f37a06b
commit 816687d572

View file

@ -526,6 +526,23 @@ class Incoming(metaclass=PoolMeta):
if bank_accounts: if bank_accounts:
self.parsed_data['payment']['bank'] = bank_accounts self.parsed_data['payment']['bank'] = bank_accounts
# invoice-taxes
xpath_invoice_taxes = xpath_payment + ['ram:ApplicableTradeTax']
taxes = self._readxml_read_listdata(xmltree, xpath_invoice_taxes, [], [
('ram:CalculatedAmount', 'amount', Decimal),
('ram:TypeCode', 'type'),
('ram:ExemptionReason', 'reason'),
('ram:BasisAmount', 'base', Decimal),
('ram:LineTotalBasisAmount', 'basetotal', Decimal),
('ram:AllowanceChargeBasisAmount', 'feebase', Decimal),
('ram:CategoryCode', 'category_code'),
('ram:ExemptionReasonCode', 'reason_code'),
('ram:TaxPointDate', 'taxdate', date),
('ram:DueDateTypeCode', 'duecode'),
('ram:RateApplicablePercent', 'percent', Decimal)])
if taxes:
self.parsed_data['payment']['taxes'] = taxes
def _readxml_getinvoiceline(self, invoice, line_data): def _readxml_getinvoiceline(self, invoice, line_data):
""" create invoice line in memory """ create invoice line in memory