/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AR_BALANCE') 
 CREATE TABLE T_AR_BALANCE (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FASSTACTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FASSTACTID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FSTOPDATE DATETIME,
FESTIMATEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALESTIMATEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALRECEIVEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVABLEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALRECEIVABLEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPERIODAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALPERIODAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVEDPERIODAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALRECEIVEDPERIODAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBALANCEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALBALANCEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVEDBALANCEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALRECEIVEDBALANCEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AR_JOURNAL') 
 CREATE TABLE T_AR_JOURNAL (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZDATE DATETIME,
FASSTACTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FASSTACTID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FRECEIVABLEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALRECEIVABLEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FESTIMATEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALESTIMATEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALRECEIVEDAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
