|
|
@@ -927,38 +927,53 @@ Ext.define('saas.view.money.verification.FormPanel', {
|
|
|
|
|
|
defaultConditions: {
|
|
|
receipts_offset_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
|
|
|
- ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
|
|
|
-
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and ((sl_kind=\'收款单\') or ' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
|
|
|
|
|
|
'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
|
|
|
- ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and (sl_kind in (\'出货单\',\'销售退货单\') or '+
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
|
|
|
],
|
|
|
prepaid_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
|
|
|
- ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and ((sl_kind=\'付款单\') or ' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
|
|
|
|
|
|
|
|
|
'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
|
|
|
- ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
|
|
|
],
|
|
|
receivable_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
|
|
|
- ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or ' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
|
|
|
|
|
|
'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
|
|
|
- ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
|
|
|
],
|
|
|
receivable_to_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
|
|
|
- ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
|
|
|
],
|
|
|
payable_to_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
|
|
|
- ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
|
|
|
- '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
|
|
|
+ 'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
|
|
|
+ ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
|
|
|
+ '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
|
|
|
+ 'and sl_ym>=(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
|
|
|
]
|
|
|
}
|
|
|
},
|