mirror of
https://bitbucket.org/presik/trytonpsk-sale_pos.git
synced 2023-12-14 07:13:02 +01:00
minor fix
This commit is contained in:
parent
3733f079e7
commit
00c6ed1f05
1 changed files with 7 additions and 3 deletions
10
sale.py
10
sale.py
|
@ -7,7 +7,7 @@ from itertools import chain
|
|||
|
||||
from sql import Table
|
||||
from sql import Null
|
||||
from sql.operators import NotIn
|
||||
from sql.operators import NotIn, Or
|
||||
from sql.aggregate import Sum, Count
|
||||
from sql.conditionals import Case
|
||||
|
||||
|
@ -1713,7 +1713,9 @@ class SaleByKindReport(Report):
|
|||
]
|
||||
else:
|
||||
columns_ = [
|
||||
Sum(Case((sale.kind == Null or sale.kind == '', 1), else_=0)).as_('sales_'+k),
|
||||
Sum(Case(
|
||||
(((sale.kind == '') | (sale.kind == Null)), 1)
|
||||
, else_=0)).as_('sales_'+k),
|
||||
]
|
||||
columns1.extend(columns_)
|
||||
query = sale.join(shop, condition=shop.id == sale.shop
|
||||
|
@ -1746,7 +1748,9 @@ class SaleByKindReport(Report):
|
|||
]
|
||||
else:
|
||||
columns_ = [
|
||||
Sum(Case((sale.kind == Null or sale.kind == '', (line.quantity*line.unit_price)), else_=0)).as_('amount_'+k),
|
||||
Sum(Case(
|
||||
(((sale.kind == '') | (sale.kind == Null)), (line.quantity*line.unit_price)),
|
||||
else_=0)).as_('amount_'+k),
|
||||
]
|
||||
columns2.extend(columns_)
|
||||
|
||||
|
|
Loading…
Reference in a new issue