IFS ERP Toplu Sipariş Açmak

IFS ERP Toplu Sipariş Açmak:

Başlığı oluşturulmus siparişe detay satır giren script.Declare kısmında tanımladığımız sipariş numarasına aa_temp tablosunda belirtilen malzeme kodu, miktar ve birim fiyatla satır ekler.Site vs bilgileri kendinize göre uyarlamalısınız..

 

   DECLARE 
   info_       VARCHAR2(2000);
   objid_      VARCHAR2(2000);
   objversion_ VARCHAR2(2000);
   attr_       VARCHAR2(2000);
   --sat siparişi no burada tanımlanacak
   sat_sip_no_ VARCHAR2(20):='I10104';
 
 BEGIN 
 
   FOR rec_ IN (SELECT  part_no,miktar,0 fiyat  FROM aa_temp) LOOP 
 
   client_sys.Clear_Attr(attr_);
   client_sys.Add_To_Attr('ORDER_NO',sat_sip_no_,attr_);
   client_sys.Add_To_Attr('CONTRACT','10',attr_);
   client_sys.Add_To_Attr('CATALOG_NO',rec_.part_no,attr_);
   client_sys.Add_To_Attr('PART_NO',rec_.part_no,attr_);
   client_sys.Add_To_Attr('ORDER_CODE','O',attr_);
   client_sys.Add_To_Attr('SALES_UNIT_MEAS','m2',attr_);
   client_sys.Add_To_Attr('BASE_SALE_UNIT_PRICE',rec_.fiyat,attr_);
   client_sys.Add_To_Attr('BUY_QTY_DUE',rec_.miktar,attr_);
   client_sys.Add_To_Attr('CATALOG_TYPE',Sales_Part_Type_API.Decode('INV'),attr_);
   client_sys.Add_To_Attr('CONV_FACTOR',1,attr_);
   client_sys.Add_To_Attr('COST',0,attr_);
   client_sys.Add_To_Attr('DISCOUNT',0,attr_);
   client_sys.Add_To_Attr('ORDER_DISCOUNT',0,attr_);
   client_sys.Add_To_Attr('PLANNED_DELIVERY_DATE',SYSDATE+2,attr_);
   client_sys.Add_To_Attr('PLANNED_DUE_DATE',SYSDATE+2,attr_);
   client_sys.Add_To_Attr('PRICE_CONV_FACTOR',1,attr_);
   client_sys.Add_To_Attr('PROMISED_DELIVERY_DATE',SYSDATE+2,attr_);
   client_sys.Add_To_Attr('QTY_ASSIGNED',0,attr_);
   client_sys.Add_To_Attr('QTY_INVOICED',0,attr_);
   client_sys.Add_To_Attr('QTY_ON_ORDER',0,attr_);
   client_sys.Add_To_Attr('QTY_PICKED',0,attr_);
   client_sys.Add_To_Attr('QTY_RETURNED',0,attr_);
   client_sys.Add_To_Attr('QTY_SHIPDIFF',0,attr_);
   client_sys.Add_To_Attr('QTY_SHIPPED',0,attr_);
   client_sys.Add_To_Attr('QTY_TO_SHIP',0,attr_);
   client_sys.Add_To_Attr('QTY_SHORT',0,attr_);
   client_sys.Add_To_Attr('REVISED_QTY_DUE',rec_.miktar,attr_);
   client_sys.Add_To_Attr('SALE_UNIT_PRICE',rec_.fiyat,attr_);
   client_sys.Add_To_Attr('SUPPLY_CODE',Order_Supply_Type_API.Decode('IO'),attr_);
   client_sys.Add_To_Attr('CURRENCY_RATE',1,attr_);
   client_sys.Add_To_Attr('WANTED_DELIVERY_DATE',SYSDATE+2,attr_);
   client_sys.Add_To_Attr('CONSIGNMENT_STOCK',Consignment_Stock_API.Decode('NO CONSIGNMENT STOCK'),attr_);
   client_sys.Add_To_Attr('CLOSE_TOLERANCE',0,attr_);
   client_sys.Add_To_Attr('CHARGED_ITEM',Charged_Item_API.Decode('CHARGED ITEM'),attr_);
   client_sys.Add_To_Attr('CREATE_SM_OBJECT_OPTION',Create_Sm_Object_Option_API.Decode('DONOTCREATESMOBJECT'),attr_);
   client_sys.Add_To_Attr('DEFAULT_ADDR_FLAG',Gen_Yes_No_API.Decode('Y') ,attr_);
   client_sys.Add_To_Attr('ADDR_FLAG',Gen_Yes_No_API.Decode('N') ,attr_);
   client_sys.Add_To_Attr('DELIVERY_TERMS','*',attr_);
   client_sys.Add_To_Attr('DELIVERY_LEADTIME',0,attr_);
   client_sys.Add_To_Attr('DESIRED_QTY',rec_.miktar,attr_);
   client_sys.Add_To_Attr('STAGED_BILLING',Staged_Billing_Type_API.Decode('NOT STAGED BILLING'),attr_);
   client_sys.Add_To_Attr('VAT',Pay_Vat_API.Decode('Y'),attr_);
   client_sys.Add_To_Attr('SM_CONNECTION',Service_Management_Connect_API.Decode('NOT CONNECTED') ,attr_);
   client_sys.Add_To_Attr('PART_PRICE',0,attr_);
   client_sys.Add_To_Attr('PRICE_SOURCE',Pricing_Source_API.Decode('BASE'),attr_);
   client_sys.Add_To_Attr('PRICE_FREEZE',Freeze_Flag_API.Decode('FREE'),attr_);
   client_sys.Add_To_Attr('CONFIGURATION_ID','*',attr_);
   client_sys.Add_To_Attr('CTP_PLANNED',Gen_Yes_No_API.Decode('N'),attr_);
   client_sys.Add_To_Attr('INTRASTAT_EXEMPT',Intrastat_Exempt_API.Decode('INCLUDE'),attr_);
   client_sys.Add_To_Attr('PART_OWNERSHIP',Part_Ownership_API.Decode('COMPANY OWNED'),attr_);
   client_sys.Add_To_Attr('EXCHANGE_ITEM',Exchange_Item_API.Decode('ITEM NOT EXCHANGED'),attr_);
   client_sys.Add_To_Attr('SHIP_ADDR_NO','01',attr_);
   client_sys.Add_To_Attr('SUPPLY_SITE_RESERVE_TYPE',Supply_Site_Reserve_Type_API.Decode('NOTALLOWED'),attr_);
   client_sys.Add_To_Attr('RELEASE_PLANNING',Release_Planning_API.Decode('NOTRELEASED'),attr_);
   client_sys.Add_To_Attr('SHIP_VIA_CODE','*',attr_);
 
   Customer_order_line_api.New__(info_,objid_ ,objversion_ ,attr_,'DO');
 
   END LOOP ;
   END;

Umarım Faydalı olur.

Tagged: , , , , ,

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir