diff --git a/.~lock.shop_daily_category.fodt# b/.~lock.shop_daily_category.fodt# new file mode 100644 index 0000000..3392921 --- /dev/null +++ b/.~lock.shop_daily_category.fodt# @@ -0,0 +1 @@ +,presik,presik,21.04.2023 14:15,file:///home/presik/.config/libreoffice/4; \ No newline at end of file diff --git a/shop.py b/shop.py index 0368e0c..260748c 100644 --- a/shop.py +++ b/shop.py @@ -577,7 +577,7 @@ class ShopDailyCategoryReport(Report): } } } - total_payments.append(line.unit_price) + total_payments.append(line.unit_price * Decimal(line.quantity)) else: categories[category_id]['base'].append(line.amount) if line.product.template.id in categories[category_id]['products'].keys(): @@ -590,7 +590,7 @@ class ShopDailyCategoryReport(Report): 'quantity': line.quantity, 'amount': line.unit_price * Decimal(line.quantity) } - total_payments.append(line.unit_price) + total_payments.append(line.unit_price * Decimal(line.quantity)) if numbers: min_number = min(numbers) max_number = max(numbers) @@ -598,7 +598,6 @@ class ShopDailyCategoryReport(Report): else: min_number = '' max_number = '' - print(categories.values()) report_context['date'] = data['sale_date'] report_context['company'] = company.party report_context['shop'] = Shop(data['shop']).name @@ -609,4 +608,5 @@ class ShopDailyCategoryReport(Report): report_context['sum_total_amount'] = sum(total_amount) report_context['payments'] = _payments.values() report_context['total_payments'] = sum(total_payments) + print(report_context['total_payments']) return report_context diff --git a/shop_daily_category.fodt b/shop_daily_category.fodt index 03a9dc2..943cfc7 100644 --- a/shop_daily_category.fodt +++ b/shop_daily_category.fodt @@ -1,28 +1,28 @@ - 2023-04-20T10:17:41.990552036LibreOffice/7.3.7.2$Linux_X86_64 LibreOffice_project/30$Build-22023-04-21T10:49:06.495588972PT5H2M39S40 + 2023-04-20T10:17:41.990552036LibreOffice/7.3.7.2$Linux_X86_64 LibreOffice_project/30$Build-22023-04-21T14:15:07.275587988PT5H26M59S49 - 16 + 4022 0 - 34927 - 14478 + 23470 + 10440 true false view2 - 16053 - 4763 + 12936 + 9197 0 - 16 - 34925 - 14492 + 4022 + 23469 + 14460 0 1 false - 140 + 200 false false false @@ -88,7 +88,7 @@ true true - 2296802 + 2424469 true false @@ -152,14 +152,14 @@ - + - + @@ -170,17 +170,17 @@ - + - + - + @@ -193,16 +193,16 @@ - - + + - - + + @@ -211,7 +211,7 @@ - + @@ -267,7 +267,7 @@ - + $ @@ -279,38 +279,51 @@ + + + + + + + + - + + + + + - + - + - + - + - + - + - + - + - + @@ -330,81 +343,89 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + @@ -427,17 +448,20 @@ + + + - + - - + + - + @@ -448,7 +472,7 @@ - + iVBORw0KGgoAAAANSUhEUgAAAMgAAAA/CAYAAAClz4c/AAASt3pUWHRSYXcgcHJvZmlsZSB0 eXBlIGV4aWYAAHjarZppchw5koX/xyn6CHBsDhwHq9ncYI4/34sk1ZJKZV1m02QpmUxGRgDu z98SWc/53/+5z7/4yrnVJxdvtdca+Mo99zh40sLna7yPFvL7+H6t77/Zr68/6X79IfJS4mf6 @@ -727,9 +751,9 @@ <company.rec_name> - LISTADO PRODUCTOS VENDIDOS - - FECHA DE ARQUEO: <date> + LISTADO PRODUCTOS VENDIDOS + + FECHA: <date> @@ -738,7 +762,7 @@ - <for each="category in categories"> + <for each="category in categories"> @@ -746,7 +770,7 @@ - + @@ -754,7 +778,7 @@ - <category.name> + <category.name> @@ -774,7 +798,7 @@ - <for each="product in category['products'].values()"> + <for each="product in category['products'].values()"> @@ -782,41 +806,41 @@ - <product['name']> + <product['name']> - <product['quantity']> + <product['quantity']> - <product['amount']> + <format_number(product['amount'], company.lang, 0)> - </for> + </for> - + - + - Total por Categoria: + Total por Categoria: - <sum(product['amount'] for product in category['products'].values())> + <format_number(sum(product['amount'] for product in category['products'].values()), company.lang, 0)> - </for> + </for> @@ -824,7 +848,7 @@ - + @@ -832,16 +856,16 @@ - Total: + Total: - <total_payments> + <format_number(total_payments, company.lang, 0)> - + \ No newline at end of file