src-db/database/model/functions/C_INVOICE_POST.xml
changeset 19389 2ea55d9cc882
parent 18972 2d71b774275e
child 19394 03c4c13bb0f0
equal deleted inserted replaced
19388:c8f2f781b915 19389:2ea55d9cc882
   468 
   468 
   469       SELECT COUNT(*)
   469       SELECT COUNT(*)
   470         INTO v_Count
   470         INTO v_Count
   471       FROM C_INVOICE I, C_INVOICELINE IL
   471       FROM C_INVOICE I, C_INVOICELINE IL
   472       WHERE I.C_INVOICE_ID = IL.C_INVOICE_ID
   472       WHERE I.C_INVOICE_ID = IL.C_INVOICE_ID
   473         AND AD_ISORGINCLUDED(IL.AD_Org_ID, I.AD_Org_ID, I.AD_Client_ID) <> -1
   473         AND AD_ISORGINCLUDED(IL.AD_Org_ID, I.AD_Org_ID, I.AD_Client_ID) = -1
   474         AND I.C_INVOICE_ID = v_Record_ID;
   474         AND I.C_INVOICE_ID = v_Record_ID;
   475       IF (v_Count=0) THEN
   475       IF (v_Count>0) THEN
   476         RAISE_APPLICATION_ERROR(-20000, '@NotCorrectOrgLines@') ;
   476         RAISE_APPLICATION_ERROR(-20000, '@NotCorrectOrgLines@') ;
   477       END IF;
   477       END IF;
   478 
   478 
   479 
   479 
   480       SELECT COUNT(*) INTO v_Count
   480       SELECT COUNT(*) INTO v_Count