|
@@ -4,9 +4,9 @@ SELECT t1.*,
|
|
|
t2.phonenumber enterprisephonenumber,
|
|
t2.phonenumber enterprisephonenumber,
|
|
|
t3.agentnum,
|
|
t3.agentnum,
|
|
|
t3.signingstate,
|
|
t3.signingstate,
|
|
|
- t4.name recname,
|
|
|
|
|
|
|
+ t4.name recname,
|
|
|
t4.phonenumber recphonenumber,
|
|
t4.phonenumber recphonenumber,
|
|
|
- t4.address recaddress,
|
|
|
|
|
|
|
+ t4.address recaddress,
|
|
|
t5.discountamount,
|
|
t5.discountamount,
|
|
|
t6.depno,
|
|
t6.depno,
|
|
|
t6.depname,
|
|
t6.depname,
|
|
@@ -14,7 +14,8 @@ SELECT t1.*,
|
|
|
t7.suppname,
|
|
t7.suppname,
|
|
|
t7.suppshortname,
|
|
t7.suppshortname,
|
|
|
t8.stockno,
|
|
t8.stockno,
|
|
|
- t8.stockname
|
|
|
|
|
|
|
+ t8.stockname,
|
|
|
|
|
+ t9.billno as dbbillno;
|
|
|
FROM st_stockbill t1
|
|
FROM st_stockbill t1
|
|
|
LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid AND t1.siteid = t2.siteid
|
|
LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid AND t1.siteid = t2.siteid
|
|
|
LEFT JOIN sa_agents t3 ON t1.sys_enterpriseid = t3.sys_enterpriseid AND t1.siteid = t3.siteid
|
|
LEFT JOIN sa_agents t3 ON t1.sys_enterpriseid = t3.sys_enterpriseid AND t1.siteid = t3.siteid
|
|
@@ -23,4 +24,5 @@ FROM st_stockbill t1
|
|
|
left join sys_department t6 on t1.departmentid=t6.departmentid and t1.siteid = t6.siteid
|
|
left join sys_department t6 on t1.departmentid=t6.departmentid and t1.siteid = t6.siteid
|
|
|
left join sa_supplier t7 on t1.sa_supplierid=t7.sa_supplierid and t1.siteid = t7.siteid
|
|
left join sa_supplier t7 on t1.sa_supplierid=t7.sa_supplierid and t1.siteid = t7.siteid
|
|
|
left join st_stock t8 on t1.stockid=t8.stockid and t1.siteid = t8.siteid
|
|
left join st_stock t8 on t1.stockid=t8.stockid and t1.siteid = t8.siteid
|
|
|
- where t1.siteid=$siteid$ and t1.st_stockbillid=$st_stockbillid$
|
|
|
|
|
|
|
+ left join st_dbstockbill t9 on t1.sourceid=t9.st_dbstockbillid and t1.sourceobject='st_dbstockbill'
|
|
|
|
|
+ where t1.siteid=$siteid$ and t1.st_stockbillid=$st_stockbillid$
|