src-db/database/model/triggers/C_INVOICELINE_TRG2.xml
changeset 25602 fbc674d56f04
parent 25568 132f3d7f9f75
child 26214 35a4e54c3ffc
equal deleted inserted replaced
25601:263028744507 25602:fbc674d56f04
   147    UPDATE C_Invoice
   147    UPDATE C_Invoice
   148      SET TotalLines = TotalLines - v_oldLine + v_newLineNetAmt,
   148      SET TotalLines = TotalLines - v_oldLine + v_newLineNetAmt,
   149      GrandTotal = CASE v_istaxincluded
   149      GrandTotal = CASE v_istaxincluded
   150                        WHEN 'Y' THEN grandtotal - v_oldgrossamt
   150                        WHEN 'Y' THEN grandtotal - v_oldgrossamt
   151                        ELSE TotalLines - v_oldLine + v_newLineNetAmt + COALESCE(v_taxAmt, 0)
   151                        ELSE TotalLines - v_oldLine + v_newLineNetAmt + COALESCE(v_taxAmt, 0)
   152                   END,  prepaymentamt=prepaymentamt - v_oldLine + v_newLineNetAmt
   152                   END
   153    --  Updated = SysDate -- Don't update as otherwise it does not save changes
   153    --  Updated = SysDate -- Don't update as otherwise it does not save changes
   154    WHERE C_Invoice_ID=:old.C_Invoice_ID;
   154    WHERE C_Invoice_ID=:old.C_Invoice_ID;
   155   END IF;
   155   END IF;
   156   IF (v_istaxincluded = 'Y') THEN
   156   IF (v_istaxincluded = 'Y') THEN
   157     SELECT totallines, grandtotal INTO v_totallines, v_grandtotal
   157     SELECT totallines, grandtotal INTO v_totallines, v_grandtotal