@@ -1,3 +1,4 @@
|
||||
* Render prepaid amount
|
||||
* Fill invoice source amounts instead of checking amounts
|
||||
* Filter the MIME type of the additional documents allowed by the specification
|
||||
* Use VATEX as tax exemption reason code
|
||||
|
||||
@@ -271,6 +271,17 @@ class Invoice(Model):
|
||||
return
|
||||
return product.unece_allowance_charge_code
|
||||
|
||||
@cached_property
|
||||
def prepaid_amount(self):
|
||||
def balance(line):
|
||||
if self.invoice.currency == line.second_currency:
|
||||
return line.amount_second_currency
|
||||
elif self.invoice.currency == self.invoice.company.currency:
|
||||
return line.debit - line.credit
|
||||
else:
|
||||
return 0
|
||||
return sum(map(balance, self.invoice.lines_to_pay))
|
||||
|
||||
@classmethod
|
||||
def parse(cls, document):
|
||||
pool = Pool()
|
||||
|
||||
@@ -124,7 +124,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<py:if test="this.invoice.total_amount != (this.invoice.untaxed_amount + this.invoice.tax_amount)">
|
||||
<cbc:PayableRoundingAmount py:attrs="{'currencyID': this.invoice.currency.code}">${-(this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount)}</cbc:PayableRoundingAmount>
|
||||
</py:if>
|
||||
<cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${-this.invoice.total_amount}</cbc:PayableAmount>
|
||||
<cbc:PrepaidAmount py:if="this.prepaid_amount" py:attrs="{'currencyID': this.invoice.currency.code}">${-this.prepaid_amount}</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${-this.invoice.total_amount + this.prepaid_amount}</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:CreditNoteLine py:for="line_id, line in enumerate(this.lines, 1)">
|
||||
<cbc:ID>${line_id}</cbc:ID>
|
||||
|
||||
@@ -124,7 +124,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<py:if test="this.invoice.total_amount != (this.invoice.untaxed_amount + this.invoice.tax_amount)">
|
||||
<cbc:PayableRoundingAmount py:attrs="{'currencyID': this.invoice.currency.code}">${this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount}</cbc:PayableRoundingAmount>
|
||||
</py:if>
|
||||
<cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${this.invoice.total_amount}</cbc:PayableAmount>
|
||||
<cbc:PrepaidAmount py:if="this.prepaid_amount" py:attrs="{'currencyID': this.invoice.currency.code}">${this.prepaid_amount}</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${this.invoice.total_amount - this.prepaid_amount}</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine py:for="line_id, line in enumerate(this.lines, 1)">
|
||||
<cbc:ID>${line_id}</cbc:ID>
|
||||
|
||||
Reference in New Issue
Block a user