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/Products Categories script

Script for 2.40/2.3x

 
 DECLARE
 v_client_id number(10);
 v_product_category_id number(10);
 
 BEGIN
 
 SELECT MAX(AD_CLIENT_ID) INTO v_client_id FROM AD_CLIENT;
 
 SELECT MAX(M_PRODUCT_CATEGORY_ID)+1 INTO v_product_category_id FROM  M_PRODUCT_CATEGORY; 
 
 INSERT INTO M_PRODUCT_CATEGORY (M_PRODUCT_CATEGORY_ID, AD_CLIENT_ID, AD_ORG_ID, 
   ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, PLANNEDMARGIN) 
 VALUES (v_product_category_id, v_client_id, 0 , 'Y', sysdate , 100, sysdate, 100, 'BOM', 'BOMs', 0);
 
 v_product_category_id:=v_product_category_id + 1;
 
 INSERT INTO M_PRODUCT_CATEGORY (M_PRODUCT_CATEGORY_ID, AD_CLIENT_ID, AD_ORG_ID, 
   ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, PLANNEDMARGIN) 
 VALUES (v_product_category_id, v_client_id, 0 , 'Y', sysdate , 100, sysdate, 100, 'FG', 'Final goods',0);
 
 AD_UPDATE_SEQUENCE();
 
 commit;
 
 end;

Script for 2.50

 
 DECLARE
 v_client_id varchar2(32);
 v_product_category_id varchar2(32);
 
 BEGIN
 
 SELECT MAX(AD_CLIENT_ID) INTO v_client_id FROM AD_CLIENT;
 
 AD_SEQUENCE_NEXT('M_PRODUCT_CATEGORY', v_client_id, v_product_category_id);
 
 
 INSERT INTO M_PRODUCT_CATEGORY (M_PRODUCT_CATEGORY_ID, AD_CLIENT_ID, AD_ORG_ID, 
   ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, PLANNEDMARGIN) 
 VALUES (v_product_category_id, v_client_id, 0 , 'Y', sysdate , 100, sysdate, 100, 'BOM', 'BOMs', 0);
 
 AD_SEQUENCE_NEXT('M_PRODUCT_CATEGORY', v_client_id, v_product_category_id);
 
 INSERT INTO M_PRODUCT_CATEGORY (M_PRODUCT_CATEGORY_ID, AD_CLIENT_ID, AD_ORG_ID, 
   ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, PLANNEDMARGIN) 
 VALUES (v_product_category_id, v_client_id, 0 , 'Y', sysdate , 100, sysdate, 100, 'FG', 'Final goods',0);
 
 commit;
 
 end;

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

This page has been accessed 5,016 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.