minor fix

This commit is contained in:
Elvis 2023-11-21 17:13:00 -05:00
parent 81b446a8db
commit 63ebe591fa
1 changed files with 5 additions and 1 deletions

View File

@ -885,7 +885,7 @@ class WarehouseKardexReport(Report):
ORDER BY s.effective_date ASC, p.id ASC
"""
# and (s.origin LIKE '%purchase.line%' or s.origin LIKE '%sale.line%')
start, end = cls.get_balances(Product, product, data['from_date'], id_locations)
start, end = cls.get_balances(Product, product, data['from_date'] - timedelta(days=1), id_locations)
products_detail.append(cls.query_to_dict_detail(query, end))
wh_name = ''
for l in warehouses:
@ -994,17 +994,21 @@ class WarehouseKardexReport(Report):
party = ''
number = ''
add_item = False
print(row[8], row[0], 'origens')
if row[6] == 'sale.line':
print('paso por if')
party, number, list_price, qty_output = sale_lines_dict[int(row[7])]
balance -= qty_output
add_item = True
elif row[6] == 'purchase.line':
# qty_input = row[9]
print('paso por elif')
party, number, cost_price, qty_input = purchase_lines_dict[int(row[7])]
balance += qty_input
add_item = True
else:
move = StockMove(row[8])
print('paso por else')
if move and (move.from_location.type == 'lost_found' or move.from_location.type == 'customer' or move.from_location.type == 'supplier'):
qty_input = row[9]
balance += qty_input