src-db/database/model/functions/C_INVOICE_POST.xml
changeset 7819 110640fbe62b
parent 7808 801436f99c13
child 7929 acce63739f67
--- a/src-db/database/model/functions/C_INVOICE_POST.xml	Wed Jul 07 11:50:31 2010 +0200
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml	Wed Jul 07 16:58:42 2010 +0530
@@ -1178,7 +1178,11 @@
       FROM C_INVOICETAX
       WHERE C_Invoice_ID = v_Record_ID
         AND Recalculate = 'N';
-      SELECT c_getwithholding(v_record_id) INTO withholdamount FROM dual;
+      IF (v_IsSOTrx = 'N') THEN
+        SELECT c_getwithholding(v_record_id) INTO withholdamount FROM dual;
+      ELSE
+        withholdamount:=0;
+      END IF;
 
       v_GrandTotal:=C_Currency_Round(v_GrandTotal+v_TaxNoRecalculable, v_Currency_ID, NULL) ;
       SELECT COALESCE(SUM(TAXAMT), 0) INTO v_GrandTotal