批发单打印格式需要添加客户上期欠款的金额,比如上一次单据总额1W,已付6000,剩4000未付如何添加在下次开单打印格式里面,这个可以提醒下客户,不是要总累计欠款
批发单上期欠款问题
- 提问者: qqonqqqq
- 等级:普通会员
- 时间:2014-08-15 13:32
- 悬赏:0
- 解决时间:2014-08-15 19:49
最佳答案
上一单的欠款:
db_data2(~"select a.sheet_amt- a.order_amt- a.paid_amt- a.free_amt From t_cust_accout_flow a, (select top 1 sheet_no From t_pf_out_master where sheet_no in( select top 2 sheet_no From t_pf_out_master where cust_no=? order by sheet_no desc) order by sheet_no ) b where a.sheet_no =b.sheet_no~",db_data2(~"select cust_no from t_pf_out_master where sheet_no=?~",max(sheet_no)))
上次欠款:
db_data2('SELECT SUM((a.sheet_amt-a.order_amt-a.paid_amt-a.free_amt)*a.pay_type) FROM dbo.t_cust_accout_flow a,dbo.t_pf_out_master b WHERE a.cust_no=b.cust_no AND b.sheet_no=? AND a.oper_date<b.oper_date',max(sheet_no))
db_data2(~"select a.sheet_amt- a.order_amt- a.paid_amt- a.free_amt From t_cust_accout_flow a, (select top 1 sheet_no From t_pf_out_master where sheet_no in( select top 2 sheet_no From t_pf_out_master where cust_no=? order by sheet_no desc) order by sheet_no ) b where a.sheet_no =b.sheet_no~",db_data2(~"select cust_no from t_pf_out_master where sheet_no=?~",max(sheet_no)))
上次欠款:
db_data2('SELECT SUM((a.sheet_amt-a.order_amt-a.paid_amt-a.free_amt)*a.pay_type) FROM dbo.t_cust_accout_flow a,dbo.t_pf_out_master b WHERE a.cust_no=b.cust_no AND b.sheet_no=? AND a.oper_date<b.oper_date',max(sheet_no))
- 回答者:ytkf007
- 等级:问不倒翁
- 时间:2014-08-15 14:06
- 提问者对最佳回答的评论:
- 赢通就是有效率
快到期问题