【脚本】处理已销结算单的已销状态未变更
2018-08-23    
1471 0
部分早期程序,由于程序问题可能会带来已销账的结算单显示已销金额时,还是显示为0,显示为未销状态
  • 执行指令

    select * from RSM_GatheringBill where shopcode='门店编号' and  debitaccountcode='科目编号' and code not in (select ChargeUpGatheringBillCode from RSM_SettleGatheringBillDetail where shopcode='门店编号' and ChargeUpReceivableAccountCode='科目编号')

    select * from RSM_SettleGatheringBillDetail where shopcode='门店编号' and ChargeUpReceivableAccountCode='科目编号')


    查询已经销账的结算单,但是在结算单上却为显示已销,没有显示关联的销账单号。
    --------------------------------------------------------------------------------

    select RSM_GatheringBill.ExtDecimalA,RSM_SettleGatheringBillDetail.SettleAmount,Code,* from RSM_GatheringBill inner join RSM_SettleGatheringBillDetail 
    on RSM_GatheringBill.Code=RSM_SettleGatheringBillDetail.ChargeUpGatheringBillCode
    where Code in(select ChargeUpGatheringBillCode from RSM_SettleGatheringBillDetail where ParentBillCode='销账单号')
    order by RSM_GatheringBill.Code


    -----------/*修改已销的结算单状态为已销状态*/---------------

    update RSM_GatheringBill  set RSM_GatheringBill.ExtDecimalA=RSM_SettleGatheringBillDetail.SettleAmount
    from RSM_SettleGatheringBillDetail
    where RSM_GatheringBill.Code=RSM_SettleGatheringBillDetail.ChargeUpGatheringBillCode
    and Code in(select ChargeUpGatheringBillCode from RSM_SettleGatheringBillDetail where ParentBillCode='销账单号')


    -----------/*同步调整门店已销的结算单状态为已销状态*/---------------

    exec SYS_SyncPushToShop_InsertAsSQL '门店编号','
    update RSM_GatheringBill  set RSM_GatheringBill.ExtDecimalA=RSM_SettleGatheringBillDetail.SettleAmount
    from RSM_SettleGatheringBillDetail
    where RSM_GatheringBill.Code=RSM_SettleGatheringBillDetail.ChargeUpGatheringBillCode
    and Code in(select ChargeUpGatheringBillCode from RSM_SettleGatheringBillDetail where ParentBillCode=''销账单号'')
    ',10,10

章节

该文章对您有用吗?

非常感谢,您的反馈对我们很有价值!

客服电话

4006757966

微信公众号

联系我们

印特3系演示版

申请

印特5系演示版

申请

免费试用

印特软件标准演示版下载申请

请您填写您的一些信息,提交您的申请后,我们会在两个工作日内进行处理,并回复您一封邮件,内附下载链接,请您注意查收。
*
请输入正确的公司名称
*
请输入正确的联络人员
*
请输入正确的联络电话
提交申请
关闭