View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

ERP 2.50:Acceptance Testing/Create payment terms script

R2.3x version

 
 DECLARE 
 
 v_paymentterm_id NUMBER(10);
 v_client_id NUMBER(10);
 
 BEGIN
 
 SELECT MAX(AD_CLIENT_ID) INTO v_client_id FROM AD_CLIENT;
 
 SELECT COALESCE(MAX(C_PAYMENTTERM_ID),999999) +1 INTO v_paymentterm_id FROM C_PAYMENTTERM;
   
 INSERT INTO C_PAYMENTTERM
 (C_PAYMENTTERM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, 
   NAME, AFTERDELIVERY, ISDUEFIXED, NETDAYS, FIXMONTHOFFSET, ISNEXTBUSINESSDAY, ISDEFAULT, VALUE, ISVALID)
 VALUES
   (v_paymentterm_id, v_client_id, 0, 'Y', SYSDATE, 100, SYSDATE, 100, '90 DAYS', 'N', 'N', 0, 3, 'N', 'N', '90d', 'N');
 
 ad_update_sequence();
 
 commit;
 
 END;

R2.4x version (AfterDelivery column removed)

 
 DECLARE 
 
 v_paymentterm_id NUMBER(10);
 v_client_id NUMBER(10);
 
 BEGIN
 
 SELECT MAX(AD_CLIENT_ID) INTO v_client_id FROM AD_CLIENT;
 
 SELECT COALESCE(MAX(C_PAYMENTTERM_ID),999999) +1 INTO v_paymentterm_id FROM C_PAYMENTTERM;
   
 INSERT INTO C_PAYMENTTERM
 (C_PAYMENTTERM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, 
   NAME, ISDUEFIXED, NETDAYS, FIXMONTHOFFSET, ISNEXTBUSINESSDAY, ISDEFAULT, VALUE, ISVALID)
 VALUES
   (v_paymentterm_id, v_client_id, 0, 'Y', SYSDATE, 100, SYSDATE, 100, '90 DAYS', 'N', 0, 3, 'N', 'N', '90d', 'N');
 
 ad_update_sequence();
 
 commit;
 
 END;

Script for 2.50

 
  DECLARE 
 
 v_paymentterm_id VARCHAR2(32);
 v_client_id VARCHAR2(32);
 
 BEGIN
 
 SELECT AD_CLIENT_ID INTO v_client_id FROM AD_CLIENT WHERE CREATED = (SELECT MAX(CREATED) FROM AD_CLIENT);
 
 AD_SEQUENCE_NEXT('C_Paymentterm', v_client_id, v_paymentterm_id);
   
 INSERT INTO C_PAYMENTTERM
 (C_PAYMENTTERM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, 
   NAME, ISDUEFIXED, NETDAYS, FIXMONTHOFFSET, ISNEXTBUSINESSDAY, ISDEFAULT, VALUE, ISVALID)
 VALUES
   (v_paymentterm_id, v_client_id, 0, 'Y', SYSDATE, 100, SYSDATE, 100, '90 DAYS', 'N', 0, 3, 'N', 'N', '90d', 'N');
 
 commit;
 
 END;

Retrieved from "http://wiki.openbravo.com/wiki/ERP_2.50:Acceptance_Testing/Create_payment_terms_script"

This page has been accessed 5,128 times. This page was last modified on 3 April 2012, at 10:59. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.