diff --git a/ChangeLog b/ChangeLog
index 58aaf22595e..71a00e7b6eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,7 @@ For users:
- New: User permissions on margin module
- New: Add ref supplier into muscadet model
- New: Can use tag {mm} before {yy} even when there is a reset into numbering masks.
+- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables
For translators:
- Qual: Normalized sort order of all languages files with english reference files.
@@ -126,6 +127,7 @@ Fix: Edit propal line was losing product supplier price id
Fix: Delete linked element to supplier invoice when deleted
Fix: [ bug #1061 ] Bad info shipped products
Fix: [ bug #1062 ] Documents lost in propals and contracts validating
+Fix: Supplier price displayed on document lines didnt take discount
Qual: Add travis-ci integration
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c81afc72ad9..d8bdb60d8a4 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1775,8 +1775,8 @@ class Form
{
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
$outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
- $opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
- $outval.= $langs->transnoentities("Units");
+ $opt.= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
+ $outval.= ' '.$langs->transnoentities("Units");
}
if ($objp->quantity >= 1)
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index 4d52dfaceeb..e7c101b52e4 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -166,14 +166,16 @@ class MenuManager
{
// We add sub entry
print str_pad('',1).'
'; // ui-btn to highlight on clic
- print '';
+ print '';
print str_pad('',12,' ');
if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") print $langs->trans("Access"); // No translation
else print $langs->trans(ucfirst($val['mainmenu'])."Dashboard");
print '';
print ''."\n";
}
- foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
+ foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu']
{
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
@@ -183,7 +185,12 @@ class MenuManager
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
if ($val2['level']==0) print str_pad('',$val2['level']+1).''; // ui-btn to highlight on clic
else print str_pad('',$val2['level']+1).''; // ui-btn to highlight on clic
- if ($relurl2) print '';
+ if ($relurl2)
+ {
+ print '';
+ }
print str_pad('',($val2['level']+1)*12,' ');
print $val2['titre'];
if ($relurl2) print '';
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index b7866212b79..a954c68c906 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -1,8 +1,8 @@
+/* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand
- * Copyright (C) 2010-2012 Juanjo Menent
+ * Copyright (C) 2010-2013 Juanjo Menent
* Copyright (C) 2012 Christophe Battarel
*
* This program is free software; you can redistribute it and/or modify
@@ -377,11 +377,14 @@ class pdf_einstein extends ModelePDFCommandes
$vatrate=(string) $object->lines[$i]->tva_tx;
- // TODO : store local taxes types into object lines and remove this
- $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
- if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
- if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
- //end TODO
+ // Retrieve type from database for backward compatibility with old records
+ if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
+ && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
+ {
+ $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
+ $localtax1_type = $localtaxtmp_array[0];
+ $localtax2_type = $localtaxtmp_array[2];
+ }
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
index f90871b2471..35d7dd3f9fc 100644
--- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand
* Copyright (C) 2010-2013 Juanjo Menent
@@ -377,11 +377,14 @@ class pdf_proforma extends ModelePDFCommandes
$vatrate=(string) $object->lines[$i]->tva_tx;
- // TODO : store local taxes types into object lines and remove this
- $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
- if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
- if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
- //end TODO
+ // Retrieve type from database for backward compatibility with old records
+ if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
+ && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
+ {
+ $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
+ $localtax1_type = $localtaxtmp_array[0];
+ $localtax2_type = $localtaxtmp_array[2];
+ }
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 7c8f7307255..0f2ac346e69 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1,8 +1,8 @@
+/* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand
- * Copyright (C) 2010-2012 Juanjo Menent
+ * Copyright (C) 2010-2013 Juanjo Menent
* Copyright (C) 2012 Christophe Battarel
*
* This program is free software; you can redistribute it and/or modify
@@ -378,12 +378,15 @@ class pdf_crabe extends ModelePDFFactures
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
-
- // TODO : store local taxes types into object lines and remove this
- $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
- if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
- if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
- //end TODO
+
+ // Retrieve type from database for backward compatibility with old records
+ if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
+ && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
+ {
+ $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
+ $localtax1_type = $localtaxtmp_array[0];
+ $localtax2_type = $localtaxtmp_array[2];
+ }
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 6a3d0709963..a8b8a8dfdb6 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -1,8 +1,8 @@
+/* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand
- * Copyright (C) 2010-2012 Juanjo Menent
+ * Copyright (C) 2010-2013 Juanjo Menent
* Copyright (C) 2012 Christophe Battarel
*
* This program is free software; you can redistribute it and/or modify
@@ -432,11 +432,14 @@ class pdf_azur extends ModelePDFPropales
$vatrate=(string) $object->lines[$i]->tva_tx;
- // TODO : store local taxes types into object lines and remove this
- $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
- if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
- if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
- //end TODO
+ // Retrieve type from database for backward compatibility with old records
+ if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
+ && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
+ {
+ $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
+ $localtax1_type = $localtaxtmp_array[0];
+ $localtax2_type = $localtaxtmp_array[2];
+ }
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
index e08f9418c21..923930d5252 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -1,8 +1,8 @@
+/* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005-2011 Regis Houssin
* Copyright (C) 2007 Franky Van Liedekerke
- * Copyright (C) 2010 Juanjo Menent
+ * Copyright (C) 2010-2013 Juanjo Menent
*
* 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
@@ -377,11 +377,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (! empty($object->remise_percent)) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
- // TODO : store local taxes types into object lines and remove this
- $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
- if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
- if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
- //end TODO
+
+ // Retrieve type from database for backward compatibility with old records
+ if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
+ && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
+ {
+ $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
+ $localtax1_type = $localtaxtmp_array[0];
+ $localtax2_type = $localtaxtmp_array[2];
+ }
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php
index b19ddb2996f..dc39538fe7b 100644
--- a/htdocs/fourn/ajax/getSupplierPrices.php
+++ b/htdocs/fourn/ajax/getSupplierPrices.php
@@ -48,7 +48,7 @@ if (! empty($idprod))
{
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
$sql.= " pfp.ref_fourn,";
- $sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,";
+ $sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,";
$sql.= " s.nom";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product";
@@ -72,33 +72,26 @@ if (! empty($idprod))
{
$objp = $db->fetch_object($result);
+ $price = $objp->fprice * (1 - $objp->remise_percent / 100);
+ $unitprice = $objp->unitprice * (1 - $objp->remise_percent / 100);
+
$title = $objp->nom.' - '.$objp->ref_fourn.' - ';
if ($objp->quantity == 1)
{
- $title.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/";
-
- $price = $objp->fprice;
+ $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/";
}
+ $title.= $objp->quantity.' '.($objp->quantity == 1 ? $langs->trans("Unit") : $langs->trans("Units"));
- $title.= $objp->quantity.' ';
-
- if ($objp->quantity == 1)
- {
- $title.= strtolower($langs->trans("Unit"));
- }
- else
- {
- $title.= strtolower($langs->trans("Units"));
- }
if ($objp->quantity > 1)
{
$title.=" - ";
- $title.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
+ $title.= price($unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
- $price = $objp->unitprice;
+ $price = $unitprice;
}
- if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) {
+ if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2"))
+ {
$title.=" + ";
$title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency);
$price += $objp->unitcharges;
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index f24c7bf28c6..884fcd8d4ad 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -181,7 +181,7 @@ class ProductFournisseur extends Product
{
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " SET fk_user = " . $user->id." ,";
- $sql.= " ref_fourn = \"" . $this->db->escape($ref_fourn) . "\",";
+ $sql.= " ref_fourn = '" . $this->db->escape($ref_fourn) . "',";
$sql.= " price = ".price2num($buyprice).",";
$sql.= " quantity = ".$qty.",";
$sql.= " remise_percent = ".$remise_percent.",";
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 4e52c474149..7de2b910237 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -2221,7 +2221,7 @@ else
/*
* Linked object block
- */
+ */
$somethingshown=$object->showLinkedObjectBlock();
print '';
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 516eafc4f52..8954079ce31 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -126,7 +126,7 @@ SizeUnitmm=mm
SizeUnitinch=pouce
SizeUnitfoot=pied
SizeUnitpoint=point
-BugTracker=Gestionnaire de défauts
+BugTracker=Suivi de tickets
SendNewPasswordDesc=Ce formulaire permet d'envoyer un nouveau mot de passe. Il sera envoyé à l'adresse email de votre utilisateur.
La modification du mot de passe ne sera effective qu'après validation par le destinataire en suivant le lien de confirmation inclut dans ce mail.
Surveillez votre messagerie.
BackToLoginPage=Retour page de connexion
AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "%s".
Dans ce mode, Dolibarr n'a pas la possibilité de connaître ni de modifier votre mot de passe.
Contactez votre administrateur pour connaitre les modalités de changement.