Update Menu Production Record
1. Tambahkan Tarik data dari ReceivedOrder
2. isi otomatis Description dari SR, Style dari RO(ReceiveORder), item dari RO Received Order
3. gambar jika ditarik dari SR akan isi gambar langsung dari tabel SR.
Update Purchase Order
Header Sesuai dengan yang diinginkan.
SQL:
create or replace
TRIGGER T_PR
  AFTER INSERT  ON PRODUCTIONRECORD
  FOR EACH ROW
WHEN (new.SELECTID > 0)

BEGIN
    
    insert into  productionrecorditem(id,samplerecordid,itemid,qty,comp,tolerance,qtyneed,version)
    select id,:new.ID,itemid,qty,comp,tolerance,qtyneed,version
    from
    reservedorderitem
    where
    samplerecordid=:new.SELECTID;

END;

insert into buyer(id,nama) values(0,'???');

drop table purchaseorder;

CREATE TABLE "SAMPLE"."PURCHASEORDER"
  (
    "ID" NUMBER(18,0),
    "STATUSID" NUMBER(18,0),
    "TERMPAYMENTID" NUMBER(18,0),
    "CURRENCYID" NUMBER(18,0),
    "NOMOR" NVARCHAR2(255),
    "PODATE" DATE,
    "SUPPLIERID" NUMBER(18,0),
    "SUPPLIER_TEXT01" NVARCHAR2(255),
    "SUPPLIER_TEXT02" NVARCHAR2(255),
    "SUPPLIER_TEXT03" NVARCHAR2(255),
    "SUPPLIER_TEXT04" NVARCHAR2(255),
    "ISSUEDBY" NVARCHAR2(255),
    "CHECKEDBY" NVARCHAR2(255),
    "AUTHORIZEDBY" NVARCHAR2(255),
    "ISSUEDDATE" DATE,
    "CHECKEDDATE" DATE,
    "AUTHORIZEDDATE" DATE,
    "DELIVERYDATE" DATE,
    "VERSION" NUMBER(13,0),
    CONSTRAINT "PURCHASEORDER_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE
  )
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
  (
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
  )
  TABLESPACE "USERS" ;
  
  CREATE TABLE "SAMPLE"."PURCHASEORDERSTATUS"
  (
    "ID" NUMBER(18,0),
    "NAME" NVARCHAR2(255),
    "VERSION" NUMBER(13,0),
    CONSTRAINT "PURCHASEORDERSTATUS_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE
 )   
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
  (
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
  )
  TABLESPACE "USERS" ;
  
  CREATE TABLE "SAMPLE"."PURCHASEORDERTERM"
  (
    "ID" NUMBER(18,0),
    "NAME" NVARCHAR2(255),
    "VERSION" NUMBER(13,0),
    CONSTRAINT "PURCHASEORDERTERM_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE
 )   
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
  (
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
  )
  TABLESPACE "USERS" ;
  
---
insert into purchaseorderstatus(id,name) values(0,'???');
insert into purchaseorderstatus(id,name) values(1,'VOID');

insert into purchaseorderterm(id,name) values(0,'???');
insert into purchaseorderterm(id,name) values(1,'30 Days');



-- negara
drop table supplier

CREATE TABLE "SAMPLE"."SUPPLIER"
  (
    "ID" NUMBER(18,0),
    "NAMA" NVARCHAR2(255),
    "ALAMAT" NVARCHAR2(255),
    "TELP" NVARCHAR2(100),
    "FAX" NVARCHAR2(100),
    "NEGARA" NVARCHAR2(100),
    "NPWP" NVARCHAR2(100),
    "CONTACTNAME" NVARCHAR2(100),
    "VERSION" NUMBER(13,0),
    CONSTRAINT "SUPPLIER_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE
  )
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
  (
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
  )
  TABLESPACE "USERS" ;
Update ProblemDomain
Update ProblemDomain 
1. Tambah tanggal PO dan Tanggal Delivery
2. Update Supplier tambahkan contactname
TODO:
1 Report Puchase Order
2 System Approval bagaimana?
3 Digital Signature?
Commit WebApp