main #7

Merged
admin merged 620 commits from main into dev 2026-03-29 13:03:25 +00:00
Showing only changes of commit e6519d30ee - Show all commits

View File

@@ -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)