minor fix
This commit is contained in:
parent
9d4951840f
commit
bf51a4e9ab
14
shop.py
14
shop.py
|
@ -559,7 +559,7 @@ class ShopDailyCategoryReport(Report):
|
|||
continue
|
||||
numbers.append(invoice.number)
|
||||
|
||||
for line in invoice.lines:
|
||||
for line in sale.lines:
|
||||
category_id = '0'
|
||||
if line.product.id in products_exception:
|
||||
continue
|
||||
|
@ -573,24 +573,24 @@ class ShopDailyCategoryReport(Report):
|
|||
'products': {line.product.template.id: {
|
||||
'name': line.product.template.name,
|
||||
'quantity': line.quantity,
|
||||
'amount': line.unit_price * Decimal(line.quantity),
|
||||
'amount': line.amount_w_tax,
|
||||
}
|
||||
}
|
||||
}
|
||||
total_payments.append(line.unit_price * Decimal(line.quantity))
|
||||
total_payments.append(line.amount_w_tax)
|
||||
else:
|
||||
categories[category_id]['base'].append(line.amount)
|
||||
if line.product.template.id in categories[category_id]['products'].keys():
|
||||
categories[category_id]['products'][line.product.template.id]['quantity'] += line.quantity
|
||||
categories[category_id]['products'][line.product.template.id]['amount'] += line.unit_price * Decimal(line.quantity)
|
||||
total_payments.append(line.unit_price)
|
||||
categories[category_id]['products'][line.product.template.id]['amount'] += line.amount_w_tax
|
||||
total_payments.append(line.amount_w_tax)
|
||||
else:
|
||||
categories[category_id]['products'][line.product.template.id] = {
|
||||
'name': line.product.template.name,
|
||||
'quantity': line.quantity,
|
||||
'amount': line.unit_price * Decimal(line.quantity)
|
||||
'amount': line.amount_w_tax,
|
||||
}
|
||||
total_payments.append(line.unit_price * Decimal(line.quantity))
|
||||
total_payments.append(line.amount_w_tax)
|
||||
if numbers:
|
||||
min_number = min(numbers)
|
||||
max_number = max(numbers)
|
||||
|
|
Loading…
Reference in New Issue