Discount_array amounts should follow same logic as the amounts on the rest of the Transaction

XMLWordPrintable

      Hi,

      Pls see ECOHELP-5470 for full context/background.

      Problem: All amounts in the discount_array are positive (and rounded), i.e. in the case of a SalesType=Refund the Sales amount etc in the transaction is negative ("-") but the amount in the discount_array is postitive. Looking at the sum of the original transaction and the refund transaction, the Sales amounts settle each other to 0 whereas the e.g. Expert amount in the discount array is 2x. A workaround would be to apply "x-1" on all the amounts in the discount_array if SalesType=Refund, but (a) the newly introduced "includeManualInvoice=true" doesn't have any SalesType; and, (b) it's a workaround and doesn't solve the core issue (a different logic to the amounts in the discount_array vs in the "main" (VendorAmount etc) amounts in the transaction).

      Solution: Discount_array amounts should follow same logic as the amounts on the Transaction, i.e. be negative in the case of a Refund and positive in other cases. 

      (While you're at it, introduce some decimals to the discount_array so numbers become more accurate (compare Expert and partnerDiscountAmount))

      Thank you!

      // A

       

            Assignee:
            Nagendra Singh Tomar
            Reporter:
            anders.hilmansson
            Votes:
            31 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: