Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-09-15 22:40:08 +02:00
commit 93ea2714a9
12 changed files with 78 additions and 60 deletions

View File

@ -53,6 +53,7 @@ For users:
- New: User permissions on margin module - New: User permissions on margin module
- New: Add ref supplier into muscadet model - New: Add ref supplier into muscadet model
- New: Can use tag {mm} before {yy} even when there is a reset into numbering masks. - 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: For translators:
- Qual: Normalized sort order of all languages files with english reference files. - 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: Delete linked element to supplier invoice when deleted
Fix: [ bug #1061 ] Bad info shipped products Fix: [ bug #1061 ] Bad info shipped products
Fix: [ bug #1062 ] Documents lost in propals and contracts validating 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 Qual: Add travis-ci integration

View File

@ -1775,8 +1775,8 @@ class Form
{ {
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity; $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; $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 $opt.= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
$outval.= $langs->transnoentities("Units"); $outval.= ' '.$langs->transnoentities("Units");
} }
if ($objp->quantity >= 1) if ($objp->quantity >= 1)

View File

@ -166,14 +166,16 @@ class MenuManager
{ {
// We add sub entry // We add sub entry
print str_pad('',1).'<li data-role="list-divider" class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic print str_pad('',1).'<li data-role="list-divider" class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
print '<a href="'.$relurl.'">'; print '<a href="'.$relurl.'"';
//print ' data-ajax="false"';
print '>';
print str_pad('',12,'&nbsp;'); print str_pad('',12,'&nbsp;');
if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") print $langs->trans("Access"); // No translation 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"); else print $langs->trans(ucfirst($val['mainmenu'])."Dashboard");
print '</a>'; print '</a>';
print '</li>'."\n"; print '</li>'."\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=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); $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 (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).'<li'.($val2['level']==0?' data-role="list-divider"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-divider"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic
if ($relurl2) print '<a href="'.$relurl2.'">'; if ($relurl2)
{
print '<a href="'.$relurl2.'"';
//print ' data-ajax="false"';
print '>';
}
print str_pad('',($val2['level']+1)*12,'&nbsp;'); print str_pad('',($val2['level']+1)*12,'&nbsp;');
print $val2['titre']; print $val2['titre'];
if ($relurl2) print '</a>'; if ($relurl2) print '</a>';

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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; $vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this // Retrieve type from database for backward compatibility with old records
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; {
//end TODO $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0)

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -377,11 +377,14 @@ class pdf_proforma extends ModelePDFCommandes
$vatrate=(string) $object->lines[$i]->tva_tx; $vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this // Retrieve type from database for backward compatibility with old records
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; {
//end TODO $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0)

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -379,11 +379,14 @@ class pdf_crabe extends ModelePDFFactures
$vatrate=(string) $object->lines[$i]->tva_tx; $vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this // Retrieve type from database for backward compatibility with old records
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; {
//end TODO $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0)

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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; $vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this // Retrieve type from database for backward compatibility with old records
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; {
//end TODO $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0)

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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; if (! empty($object->remise_percent)) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx; $vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); // Retrieve type from database for backward compatibility with old records
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
//end TODO {
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0)

View File

@ -48,7 +48,7 @@ if (! empty($idprod))
{ {
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
$sql.= " pfp.ref_fourn,"; $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.= " s.nom";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $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"; $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); $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.' - '; $title = $objp->nom.' - '.$objp->ref_fourn.' - ';
if ($objp->quantity == 1) if ($objp->quantity == 1)
{ {
$title.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/"; $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/";
$price = $objp->fprice;
} }
$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) if ($objp->quantity > 1)
{ {
$title.=" - "; $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.=" + ";
$title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency); $title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency);
$price += $objp->unitcharges; $price += $objp->unitcharges;

View File

@ -181,7 +181,7 @@ class ProductFournisseur extends Product
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " SET fk_user = " . $user->id." ,"; $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.= " price = ".price2num($buyprice).",";
$sql.= " quantity = ".$qty.","; $sql.= " quantity = ".$qty.",";
$sql.= " remise_percent = ".$remise_percent.","; $sql.= " remise_percent = ".$remise_percent.",";

View File

@ -2221,7 +2221,7 @@ else
/* /*
* Linked object block * Linked object block
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@ -126,7 +126,7 @@ SizeUnitmm=mm
SizeUnitinch=pouce SizeUnitinch=pouce
SizeUnitfoot=pied SizeUnitfoot=pied
SizeUnitpoint=point 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.<br>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.<br>Surveillez votre messagerie. SendNewPasswordDesc=Ce formulaire permet d'envoyer un nouveau mot de passe. Il sera envoyé à l'adresse email de votre utilisateur.<br>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.<br>Surveillez votre messagerie.
BackToLoginPage=Retour page de connexion BackToLoginPage=Retour page de connexion
AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "<b>%s</b>".<br>Dans ce mode, Dolibarr n'a pas la possibilité de connaître ni de modifier votre mot de passe.<br>Contactez votre administrateur pour connaitre les modalités de changement. AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "<b>%s</b>".<br>Dans ce mode, Dolibarr n'a pas la possibilité de connaître ni de modifier votre mot de passe.<br>Contactez votre administrateur pour connaitre les modalités de changement.