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/Business partner category script

Script for 2.40/2.3x

 
 DECLARE
 
 v_bp_category_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_BP_GROUP_ID),999999)+1 INTO v_bp_category_id FROM C_BP_GROUP;
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id,  v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'VEN' ,'VENDOR');
 
 v_bp_category_id:=v_bp_category_id+1;
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id,  v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'CRT' ,'CREDITOR');
 		   
  
 v_bp_category_id:=v_bp_category_id+1;
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY,UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id, v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'EM' ,'EMPLOYEE');
 			   
 v_bp_category_id:=v_bp_category_id+1;
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id, v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'SM' ,'SALESMAN');
 		   
 
 commit;
 
 END;

Script for 2.50

 
 DECLARE
 
 v_bp_category_id varchar2(32);
 v_client_id varchar2(32);
 
 BEGIN
 
 SELECT AD_CLIENT_ID INTO v_client_id FROM AD_CLIENT WHERE updated=(SELECT max(updated) FROM ad_client);
 AD_SEQUENCE_NEXT('C_Bp_Group', v_client_id, v_bp_category_id);
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id,  v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'VEN' ,'VENDOR');
 
 AD_SEQUENCE_NEXT('C_Bp_Group', v_client_id, v_bp_category_id);
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id,  v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'CRT' ,'CREDITOR');
 		   
  
 AD_SEQUENCE_NEXT('C_Bp_Group', v_client_id, v_bp_category_id);
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY,UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id, v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'EM' ,'EMPLOYEE');
 			   
 AD_SEQUENCE_NEXT('C_Bp_Group', v_client_id, v_bp_category_id);
 
 INSERT INTO C_BP_GROUP (C_BP_GROUP_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE,NAME) 
 VALUES ( v_bp_category_id, v_client_id, 0, 'Y',sysdate ,100 ,sysdate ,100 ,'SM' ,'SALESMAN');
 		   
 commit;
 
 END;

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

This page has been accessed 4,799 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.