src-db/database/model/functions/C_INVOICE_POST.xml
changeset 21909 5b7d0ffec363
parent 21626 f64403aac66c
child 22357 74df619a7316
equal deleted inserted replaced
21908:a917e66ec065 21909:5b7d0ffec363
    20   * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
    20   * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
    21   * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
    21   * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
    22   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
    22   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
    23   * All Rights Reserved.
    23   * All Rights Reserved.
    24   * Contributor(s): Openbravo SLU
    24   * Contributor(s): Openbravo SLU
    25   * Contributions are Copyright (C) 2001-2013 Openbravo, S.L.U.
    25   * Contributions are Copyright (C) 2001-2014 Openbravo, S.L.U.
    26   *
    26   *
    27   * Specifically, this derivative work is based upon the following Compiere
    27   * Specifically, this derivative work is based upon the following Compiere
    28   * file and version.
    28   * file and version.
    29   *************************************************************************
    29   *************************************************************************
    30   * $Id: C_Invoice_Post.sql,v 1.32 2003/07/22 05:41:27 jjanke Exp $
    30   * $Id: C_Invoice_Post.sql,v 1.32 2003/07/22 05:41:27 jjanke Exp $
   315     -- Check the cash vat flag for all the taxes matches the invoice one
   315     -- Check the cash vat flag for all the taxes matches the invoice one
   316     select count(1)
   316     select count(1)
   317     into v_count
   317     into v_count
   318     from c_invoicetax it inner join c_tax t on (it.c_tax_id = t.c_tax_id)
   318     from c_invoicetax it inner join c_tax t on (it.c_tax_id = t.c_tax_id)
   319     where it.c_invoice_id = v_Record_ID
   319     where it.c_invoice_id = v_Record_ID
       
   320     and t.iswithholdingtax = 'N'
       
   321     and t.rate <> 0
   320     and t.IsCashVat <> v_iscashvat;
   322     and t.IsCashVat <> v_iscashvat;
   321 
   323 
   322     IF (v_count > 0) THEN
   324     IF (v_count > 0) THEN
   323       RAISE_APPLICATION_ERROR(-20000, '@CashVATNotMatch@');
   325       RAISE_APPLICATION_ERROR(-20000, '@CashVATNotMatch@');
   324     END IF;
   326     END IF;