diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml index a37c844c..f7add966 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -581,7 +581,7 @@ ) - and (abs(dh.change_amount)+(select ifnull(sum(ai.each_amount),0) from jsh_account_item ai where ai.bill_id=dh.id and ifnull(ai.delete_flag,'0') !='1')) + and (abs(dh.change_amount)+(select ifnull(sum(abs(ai.each_amount)),0) from jsh_account_item ai where ai.bill_id=dh.id and ifnull(ai.delete_flag,'0') !='1')) < (dh.discount_last_money + dh.other_money) and ifnull(dh.delete_flag,'0') !='1' order by dh.id desc