REPORTFORM;BILL7_E.frf
TITLE;UNBILL REPORT
SQL;select arcard.DOCNO, arcard.DATEDOC, arcard.DUEDATE,
SQL;arcard.SALEID, salemst.SNAME, arcard.AMOUNT_D, 
SQL;arcard.VATAMT, arcard.INVAMT, arcard.ACCID, armst.XCOMP
SQL;from arcard 
SQL;left join armst on arcard.ACCID = armst.ACCID
SQL;left join salemst on arcard.SALEID = salemst.SID
SQL;where (isnull(arcard.BILLDOC) or trim(arcard.BILLDOC) = "") or arcard.BILLDOC = 'X'  and
SQL;left(arcard.DOCNO,2) = 'IV'
SQL;order by arcard.ACCID, arcard.DATEDOC, arcard.DOCNO
CONDITION;FROM CUSTOMER CODE~ARCARD.ACCID~Chr~2~SELECT ACCID FROM ARMST~AR
CONDITION;FROM DATE~ARCARD.DATEDOC~Date~2~~
EXCELSQL;SELECT BILLHD.BDOCNO AS "เลขที่เอกสาร", BILLHD.DATEDOC AS "วันที่เอกสาร", BILLHD.ACCID AS "รหัสลูกค้า", ARMST.XCOMP AS "ชื่อบริษัท",
EXCELSQL;BILLHD.BILLDATE AS "วันที่วางบิล", BILLHD.DATEREC AS "วันนัดรับ", BILLHD.AMOUNT_D AS "ยอดเงินรวม"
EXCELSQL;FROM BILLHD
EXCELSQL;LEFT JOIN ARMST ON BILLHD.ACCID = ARMST.ACCID
EXCELSQL;ORDER BY BILLHD.BDOCNO, BILLHD.ACCID, ARMST.XCOMP
