23.03.26
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user