2014年9月20日 星期六

根據 iDempiere GPL 版權 adempiere.tg_rmtransaction

根據 iDempiere GPL 版權
改過的程式如果散播出去(買賣或無償)都需公告,
由顧問教導客製化寫作, 顧問並非散播程式僅教學示範,
由顧問教導後由客戶自行客製化的公司, 如屬自用無須公告客製化程式碼.

:::下面案例要求交付程式碼
因此顧問在此對大家公告程式碼內容
有些資料是給程式判斷, 然資料屬於公司機密
因此無法公告資料內容, 在此只能公告程式碼
這是目前台灣保稅系統成本與原料帳資料表架構



-- Table: adempiere.tg_rmtransaction

-- DROP TABLE adempiere.tg_rmtransaction;

CREATE TABLE adempiere.tg_rmtransaction
(
  tg_rmtransaction_id  numeric(10,0) NOT NULL,
  tg_rmtransaction_uu character varying(36) DEFAULT NULL::character varying,

  ad_client_id               numeric(10,0) NOT NULL,
  ad_org_id                  numeric(10,0) NOT NULL,
  isactive                      character(1) NOT NULL DEFAULT 'Y'::bpchar,
  created                      timestamp without time zone NOT NULL,
  createdby                  numeric(10,0) NOT NULL,
  updated                     timestamp without time zone NOT NULL,
  updatedby                 numeric(10,0) NOT NULL,
  m_transaction_id      numeric(10,0) DEFAULT NULL::numeric,
  m_product_id            numeric(10,0) NOT NULL,
  m_locator_id             numeric(10,0) NOT NULL,

  declarationno            character varying(30) DEFAULT NULL::character varying,
  declarationqty           numeric,
  documentnumber     character varying(30) DEFAULT NULL::character varying,
  domesticsaleqty       numeric,

  movementdate          timestamp without time zone,
  movementqty            numeric NOT NULL,
  releasedate               timestamp without time zone,
  otherqty                     numeric,
  internaluseqty            numeric,
  importqty                    numeric,
  bondingimportqty       numeric,
  productionqty             numeric DEFAULT (0)::numeric,

  sk_no character varying(40),  --料號
  docdate date,
  sp_no character varying(40),   --存(出)倉單證號碼
  in_qty numeric(10,2),     --存倉數量
  out_qty numeric(10,2),     --出倉數量
  sk_nowqty numeric(10,2),   --帳面庫存數量 sk_nowqty
  out_date date,        --驗放日期
  bonding_no character varying(20),--報單號碼
  exp_qty numeric(10,2),    --出口數量 exp_qty
  loc_qty numeric(10,2),     --內銷數量 loc_qty

bonding_no declarationno
exp_qty declarationqty
in_qty/out_qty movementqty 以欄位documentnumber單據編號做判斷, 編號開頭TGDO的 就放out_qty(負號拿掉) 編號開頭是數字的就放in_qty
docdate movementdate
out_date releasedate
loc_qty domesticsaleqty
sp_no documentnumber

  CONSTRAINT tg_rmtransaction_key PRIMARY KEY (tg_rmtransaction_id),
  CONSTRAINT adclient_tgrmtransaction FOREIGN KEY (ad_client_id)
      REFERENCES adempiere.ad_client (ad_client_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT adorg_tgrmtransaction FOREIGN KEY (ad_org_id)
      REFERENCES adempiere.ad_org (ad_org_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT createdby_tgrmtransaction FOREIGN KEY (createdby)
      REFERENCES adempiere.ad_user (ad_user_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT mlocator_tgrmtransaction FOREIGN KEY (m_locator_id)
      REFERENCES adempiere.m_locator (m_locator_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT mproduct_tgrmtransaction FOREIGN KEY (m_product_id)
      REFERENCES adempiere.m_product (m_product_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT mtransaction_tgrmtransaction FOREIGN KEY (m_transaction_id)
      REFERENCES adempiere.m_transaction (m_transaction_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT updatedby_tgrmtransaction FOREIGN KEY (updatedby)
      REFERENCES adempiere.ad_user (ad_user_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED,
  CONSTRAINT tg_rmtransaction_uu_idx UNIQUE (tg_rmtransaction_uu),
  CONSTRAINT tg_rmtransaction_isactive_check CHECK (isactive = ANY (ARRAY['Y'::bpchar, 'N'::bpchar]))
)
WITH (
  OIDS=FALSE
);
ALTER TABLE adempiere.tg_rmtransaction
  OWNER TO adempiere;

沒有留言:

張貼留言