Fixed: Terms are not shown correctly on the Invoice overview
When we have multiple Payment (Net Days) terms on the invoice say
20% in 15Days (FIN_PAY_NETDAYS_1)
80% in 30Days (FIN_PAY_NETDAYS_2)
The terms section shows incorrect term data as shown in the screenshot.
Thanks: Nameet Jain for report and fix, Jacopo for confirmation
@@ -87,7 +87,7 @@ def getInvoicePaymentInfoList() {
for (invoiceTerm in invoiceTerms) {
termType = from("TermType").where("termTypeId", invoiceTerm.termTypeId).cache(true).queryOne()
if ("FIN_PAYMENT_TERM" == termType.parentTypeId) {
- invoicePaymentInfo.clear()
+ invoicePaymentInfo = [:]
invoicePaymentInfo.invoiceId = invoice.invoiceId
invoicePaymentInfo.invoiceTermId = invoiceTerm.invoiceTermId
invoicePaymentInfo.termTypeId = invoiceTerm.termTypeId
@@ -110,7 +110,7 @@ def getInvoicePaymentInfoList() {
}
if (remainingAppliedAmount > 0.0 || invoiceTotalAmount <= 0.0 || computedTotalAmount < invoiceTotalAmount) {
- invoicePaymentInfo.clear()
+ invoicePaymentInfo = [:]
invoiceTerm = from("InvoiceTerm").where("invoiceId", invoice.invoiceId, "termTypeId", "FIN_PAYMENT_TERM").queryFirst()
if (invoiceTerm) {
invoicePaymentInfo.termTypeId = invoiceTerm.termTypeId
