From 2c22c7707f1422d92078da9d2aac3fbf6cc79dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 6 Mar 2014 08:55:04 +0100 Subject: [PATCH 1/3] Created locale ODT line tags for invoice, shipment and order modules, and corrected the use of line_price_ht, line_price_ttc and line_price_vat tags --- ChangeLog | 1 + .../commande/doc/doc_generic_order_odt.modules.php | 5 ++++- .../doc/doc_generic_shipment_odt.modules.php | 11 +++++++---- .../facture/doc/doc_generic_invoice_odt.modules.php | 5 ++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 606a5577e80..1485ec14b1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ For users: - New: Add filter on text and status into survey list. Can also sorter on id, text and date end. - New: Add option MAIN_FAVICON_URL - Fix: Project Task numbering rule customs rule works +- New: Created {line_price_ht_locale}, {line_price_vat_locale} and {line_price_ttc_locale} ODT tags TODO - New: Predefined product and free product use same form. diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index e3ca8814a70..549914fe8d8 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -93,7 +93,7 @@ class doc_generic_order_odt extends ModelePDFCommandes * @param Translate $outputlangs Lang object to use for output * @return array Array of substitution */ - function get_substitutionarray_object($object,$outputlangs) + function get_substitutionarray_object($object, Translate $outputlangs) { global $conf; @@ -176,6 +176,9 @@ class doc_generic_order_odt extends ModelePDFCommandes 'line_price_ht'=>price($line->total_ht, 0, $outputlangs), 'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat'=>price($line->total_tva, 0, $outputlangs), + 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), + 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), + 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), 'line_date_start'=>$line->date_start, 'line_date_end'=>$line->date_end ); diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 4b1433ddd77..786ebec65e4 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -150,7 +150,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - function get_substitutionarray_lines($line,$outputlangs) + function get_substitutionarray_lines($line, Translate $outputlangs) { global $conf; @@ -163,9 +163,12 @@ class doc_generic_shipment_odt extends ModelePdfExpedition 'line_up'=>price($line->subprice, 0, $outputlangs), 'line_qty'=>$line->qty, 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), - 'line_price_ht'=>price($line->total_ht, 0, $outputlangs), - 'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs), - 'line_price_vat'=>price($line->total_tva, 0, $outputlangs), + 'line_price_ht'=>price2num($line->total_ht), + 'line_price_ttc'=>price2num($line->total_ttc), + 'line_price_vat'=>price2num($line->total_tva), + 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), + 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), + 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), 'line_date_start'=>$line->date_start, 'line_date_end'=>$line->date_end ); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d1642023c24..9f31c3743b2 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -175,7 +175,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures * @param Translate $outputlangs Lang object to use for output * @return array Return substitution array */ - function get_substitutionarray_lines($line,$outputlangs) + function get_substitutionarray_lines($line, Translate $outputlangs) { global $conf; @@ -191,6 +191,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures 'line_price_ht'=>price2num($line->total_ht), 'line_price_ttc'=>price2num($line->total_ttc), 'line_price_vat'=>price2num($line->total_tva), + 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), + 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), + 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), 'line_date_start'=>dol_print_date($line->date_start, 'day', false, $outputlangs), 'line_date_end'=>dol_print_date($line->date_end, 'day', false, $outputlangs), ); From c7566893a31607204ab584a6f4ace56c5f8b350a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 6 Mar 2014 08:56:28 +0100 Subject: [PATCH 2/3] Corrected array indentation --- .../doc/doc_generic_order_odt.modules.php | 26 +++++++++---------- .../doc/doc_generic_shipment_odt.modules.php | 20 +++++++------- .../doc/doc_generic_invoice_odt.modules.php | 26 +++++++++---------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 549914fe8d8..68cf2ae044a 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -165,22 +165,22 @@ class doc_generic_order_odt extends ModelePDFCommandes global $conf; return array( - 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), - 'line_product_ref'=>$line->product_ref, - 'line_product_label'=>$line->product_label, - 'line_desc'=>$line->desc, - 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), - 'line_up'=>price($line->subprice, 0, $outputlangs), - 'line_qty'=>$line->qty, - 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), - 'line_price_ht'=>price($line->total_ht, 0, $outputlangs), - 'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs), - 'line_price_vat'=>price($line->total_tva, 0, $outputlangs), + 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), + 'line_product_ref'=>$line->product_ref, + 'line_product_label'=>$line->product_label, + 'line_desc'=>$line->desc, + 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), + 'line_up'=>price($line->subprice, 0, $outputlangs), + 'line_qty'=>$line->qty, + 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), + 'line_price_ht'=>price($line->total_ht, 0, $outputlangs), + 'line_price_ttc'=>price($line->total_ttc, 0, $outputlangs), + 'line_price_vat'=>price($line->total_tva, 0, $outputlangs), 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), - 'line_date_start'=>$line->date_start, - 'line_date_end'=>$line->date_end + 'line_date_start'=>$line->date_start, + 'line_date_end'=>$line->date_end ); } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 786ebec65e4..ea1fea62c13 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -155,22 +155,22 @@ class doc_generic_shipment_odt extends ModelePdfExpedition global $conf; return array( - 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), - 'line_product_ref'=>$line->product_ref, - 'line_product_label'=>$line->product_label, - 'line_desc'=>$line->desc, - 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), - 'line_up'=>price($line->subprice, 0, $outputlangs), - 'line_qty'=>$line->qty, - 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), + 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), + 'line_product_ref'=>$line->product_ref, + 'line_product_label'=>$line->product_label, + 'line_desc'=>$line->desc, + 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), + 'line_up'=>price($line->subprice, 0, $outputlangs), + 'line_qty'=>$line->qty, + 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), 'line_price_ht'=>price2num($line->total_ht), 'line_price_ttc'=>price2num($line->total_ttc), 'line_price_vat'=>price2num($line->total_tva), 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), - 'line_date_start'=>$line->date_start, - 'line_date_end'=>$line->date_end + 'line_date_start'=>$line->date_start, + 'line_date_end'=>$line->date_end ); } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 9f31c3743b2..d9c79d7e119 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -180,22 +180,22 @@ class doc_generic_invoice_odt extends ModelePDFFactures global $conf; return array( - 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), - 'line_product_ref'=>$line->product_ref, - 'line_product_label'=>$line->product_label, - 'line_desc'=>$line->desc, - 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), - 'line_up'=>price($line->subprice, 0, $outputlangs), - 'line_qty'=>$line->qty, - 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), - 'line_price_ht'=>price2num($line->total_ht), - 'line_price_ttc'=>price2num($line->total_ttc), - 'line_price_vat'=>price2num($line->total_tva), + 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), + 'line_product_ref'=>$line->product_ref, + 'line_product_label'=>$line->product_label, + 'line_desc'=>$line->desc, + 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), + 'line_up'=>price($line->subprice, 0, $outputlangs), + 'line_qty'=>$line->qty, + 'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''), + 'line_price_ht'=>price2num($line->total_ht), + 'line_price_ttc'=>price2num($line->total_ttc), + 'line_price_vat'=>price2num($line->total_tva), 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), - 'line_date_start'=>dol_print_date($line->date_start, 'day', false, $outputlangs), - 'line_date_end'=>dol_print_date($line->date_end, 'day', false, $outputlangs), + 'line_date_start'=>dol_print_date($line->date_start, 'day', false, $outputlangs), + 'line_date_end'=>dol_print_date($line->date_end, 'day', false, $outputlangs), ); } From 4433f6e8b7271d39e3fe22565d80262aaa61898e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 6 Mar 2014 09:01:44 +0100 Subject: [PATCH 3/3] Missing copyright info --- .../modules/commande/doc/doc_generic_order_odt.modules.php | 1 + .../expedition/doc/doc_generic_shipment_odt.modules.php | 1 + .../modules/facture/doc/doc_generic_invoice_odt.modules.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 68cf2ae044a..296f509fd7e 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index ea1fea62c13..f48afddb368 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d9c79d7e119..fa5484eb593 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -1,7 +1,8 @@ * Copyright (C) 2012 Regis Houssin - +* Copyright (C) 2014 Marcos García +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or