From 3e78233a230850e63c45823f1ba9c2c67651bc35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 30 Aug 2007 13:14:11 +0000
Subject: [PATCH] Pass "brain.total_price or 0" instead of "brain.total_price"
 to roundCurrency, for cases where total_price is NULL in SQL

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15956 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountingPeriod_createBalanceTransaction.xml             | 4 ++--
 bt5/erp5_accounting/bt/revision                               | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
index c3a4bbefc6..25312bdb71 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
@@ -138,8 +138,8 @@ for inventory in getInventoryList(\n
         group_by_resource=1,\n
         **inventory_param_dict):\n
   \n
-  total_price = roundCurrency(inventory.total_price, section_currency)\n
-  quantity = roundCurrency(inventory.total_quantity,\n
+  total_price = roundCurrency(inventory.total_price or 0, section_currency)\n
+  quantity = roundCurrency(inventory.total_quantity or 0,\n
                            inventory.resource_relative_url)\n
 \n
   if inventory.resource_uid != section_currency_uid:\n
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index c0db21d808..cbafdca534 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-392
\ No newline at end of file
+393
\ No newline at end of file
-- 
2.30.9