From e6519d30ee4cbb77d87f912e7e09697165c5bc10 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Mon, 23 Mar 2026 10:43:02 +0100 Subject: [PATCH] 23.03.26 --- modules/purchase_trade/lot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/purchase_trade/lot.py b/modules/purchase_trade/lot.py index 72a0634..964734d 100755 --- a/modules/purchase_trade/lot.py +++ b/modules/purchase_trade/lot.py @@ -1253,8 +1253,12 @@ class LotQt( #wh &= (((lqt.create_date >= asof) & ((lqt.create_date-datetime.timedelta(1)) <= todate))) if ps == 'P': wh &= ((lqt.lot_p != None) & (lqt.lot_s == None)) + if not finished: + wh &= (pl.finished == False) elif ps == 'S': wh &= (((lqt.lot_s != None) & (lqt.lot_p == None)) | ((lqt.lot_s != None) & (lqt.lot_p != None) & (lp.lot_type == 'virtual'))) + if not finished: + wh &= (sl.finished == False) if purchase: wh &= (pu.id == purchase) if sale: @@ -1292,9 +1296,6 @@ class LotQt( wh &= (pu.party == supplier) if client and sa: wh &= (sa.party == client) - if not finished: - wh &= (pl.finished == False) - wh &= (sl.finished == False) AvQt = Case(((lqt.lot_p>0) & (lqt.lot_s>0), 0),else_=Case((lqt.lot_p>0,lqt.lot_quantity),else_=-lqt.lot_quantity)) MaQt = Case(((lqt.lot_p>0) & (lqt.lot_s>0), lqt.lot_quantity),else_=0)