Use only line extension amount to set unit price of UBL invoice line
Closes #14493
This commit is contained in:
@@ -482,13 +482,9 @@ class Invoice(Model):
|
||||
if line.origin:
|
||||
break
|
||||
|
||||
if (price_amount := invoice_line.findtext('./{*}Price/{*}PriceAmount')
|
||||
) is not None:
|
||||
line.unit_price = round_price(Decimal(price_amount))
|
||||
else:
|
||||
line.unit_price = round_price(
|
||||
Decimal(invoice_line.findtext('./{*}LineExtensionAmount'))
|
||||
/ Decimal(str(line.quantity)))
|
||||
line.unit_price = round_price(
|
||||
Decimal(invoice_line.findtext('./{*}LineExtensionAmount'))
|
||||
/ Decimal(str(line.quantity)))
|
||||
|
||||
if invoice_line.find('./{*}Item/{*}ClassifiedTaxCategory') is not None:
|
||||
tax_categories = invoice_line.iterfind(
|
||||
@@ -751,13 +747,9 @@ class Invoice(Model):
|
||||
if line.origin:
|
||||
break
|
||||
|
||||
if (price_amount := credit_note_line.findtext(
|
||||
'./{*}Price/{*}PriceAmount')) is not None:
|
||||
line.unit_price = round_price(Decimal(price_amount))
|
||||
else:
|
||||
line.unit_price = round_price(
|
||||
Decimal(credit_note_line.findtext('./{*}LineExtensionAmount'))
|
||||
/ line.quantity)
|
||||
line.unit_price = round_price(
|
||||
-Decimal(credit_note_line.findtext('./{*}LineExtensionAmount'))
|
||||
/ Decimal(str(line.quantity)))
|
||||
|
||||
if (credit_note_line.find('./{*}Item/{*}ClassifiedTaxCategory')
|
||||
is not None):
|
||||
|
||||
Reference in New Issue
Block a user