<para style="terp_default_Bold_9_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
- <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
- <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.name or '' ]]</para>
++ <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
</td>
</tr>
</blockTable>
</section>
</pto>
</story>
--</document>
++</document>
<blockTable rowHeights="0.55cm" colWidths="490.0,65.0,65.0,75.0,75.0" style="Table8">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
<tr>
<td>
- <para style="terp_default_Bold_8"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
+ <para style="terp_default_Bold_7"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
</td>
<td>
- <para style="terp_default_Bold_8_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
+ <para style="terp_default_Bold_7_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
</td>
<td>
- <para style="terp_default_Bold_8_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
+ <para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
</td>
<td>
- <para style="terp_default_Bold_8_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
+ <para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
- <para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
- <para style="terp_default_Bold_8_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.name or '' ]]</para>
++ <para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
</td>
</tr>
</blockTable>
sale_order s,
(
select l.id as id,
- l.product_id as product_id,
- u.name as uom_name,
- sum(l.product_uom_qty * u.factor) as product_uom_qty,
- sum(l.product_uom_qty*l.price_unit) as price_total,
- (sum(l.product_uom_qty*l.price_unit)/sum(nullif(l.product_uom_qty * u.factor,0))*count(l.product_id))::decimal(16,2) as price_average,
- pt.categ_id, l.order_id
+ l.product_id as product_id,
+ (case when u.uom_type not in ('reference') then
+ (select name from product_uom where uom_type='reference' and category_id=u.category_id)
+ else
+ u.name
+ end) as uom_name,
- sum(l.product_uom_qty/u.factor) as product_uom_qty,
- sum(l.product_uom_qty*l.price_unit) as price_total,
++ sum(l.product_uom_qty * u.factor) as product_uom_qty,
++ sum(l.product_uom_qty * l.price_unit) as price_total,
+ pt.categ_id, l.order_id
from
- sale_order_line l
- left join product_uom u on (u.id=l.product_uom)
- left join product_template pt on (pt.id=l.product_id)
- group by l.id, l.order_id, l.product_id, u.name, pt.categ_id) el
+ sale_order_line l ,product_uom u, product_product p, product_template pt
+ where u.id = l.product_uom
+ and pt.id = p.product_tmpl_id
+ and p.id = l.product_id
+ group by l.id, l.order_id, l.product_id, u.name, pt.categ_id, u.uom_type, u.category_id) el
where s.id = el.order_id
group by el.id,
el.product_id,