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

This commit is contained in:
Laurent Destailleur 2018-02-04 23:18:33 +01:00
commit 8fe773204e
10 changed files with 45 additions and 45 deletions

View File

@ -683,7 +683,7 @@ if (empty($reshook))
$i = 0;
foreach ($object->lines as $line)
{
if ($line->total_ht!=0)
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9
{ // no need to create discount if amount is null
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;

View File

@ -1508,7 +1508,7 @@ function dol_print_reduction($reduction,$langs)
}
else
{
$string = price($reduction).'%';
$string = vatrate($reduction,true);
}
return $string;

View File

@ -139,10 +139,10 @@ class pdf_einstein extends ModelePDFCommandes
$this->posxdesc=$this->marge_gauche+1;
if($conf->global->PRODUCT_USE_UNITS)
{
$this->posxtva=99;
$this->posxup=114;
$this->posxqty=130;
$this->posxunit=147;
$this->posxtva=101;
$this->posxup=118;
$this->posxqty=135;
$this->posxunit=151;
}
else
{

View File

@ -121,10 +121,10 @@ class pdf_crabe extends ModelePDFFactures
$this->posxdesc=$this->marge_gauche+1;
if($conf->global->PRODUCT_USE_UNITS)
{
$this->posxtva=99;
$this->posxup=114;
$this->posxqty=130;
$this->posxunit=147;
$this->posxtva=101;
$this->posxup=118;
$this->posxqty=135;
$this->posxunit=151;
}
else
{

View File

@ -109,10 +109,10 @@ class pdf_azur extends ModelePDFPropales
$this->posxdesc=$this->marge_gauche+1;
if($conf->global->PRODUCT_USE_UNITS)
{
$this->posxtva=99;
$this->posxup=114;
$this->posxqty=130;
$this->posxunit=147;
$this->posxtva=101;
$this->posxup=118;
$this->posxqty=135;
$this->posxunit=151;
}
else
{

View File

@ -789,18 +789,18 @@ elseif ($object->id > 0)
print '</td>';
print '</tr>';
// Opportunity probability
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td>';
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(isset($_POST['opp_percent'])?GETPOST('opp_percent'):(strcmp($object->opp_percent,'')?price($object->opp_percent,0,$langs,1,0):'')).'"> %';
print '<span id="oldopppercent"></span>';
print '</td>';
print '</tr>';
// Opportunity probability
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td>';
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(isset($_POST['opp_percent'])?GETPOST('opp_percent'):(strcmp($object->opp_percent,'')?vatrate($object->opp_percent):'')).'"> %';
print '<span id="oldopppercent"></span>';
print '</td>';
print '</tr>';
// Opportunity amount
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td>';
print '<td><input size="5" type="text" name="opp_amount" value="'.(isset($_POST['opp_amount'])?GETPOST('opp_amount'):(strcmp($object->opp_amount,'')?price($object->opp_amount,0,$langs,1,0):'')).'"></td>';
print '</tr>';
}
// Opportunity amount
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td>';
print '<td><input size="5" type="text" name="opp_amount" value="'.(isset($_POST['opp_amount'])?GETPOST('opp_amount'):(strcmp($object->opp_amount,'')?price2num($object->opp_amount):'')).'"></td>';
print '</tr>';
}
// Date start
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';

View File

@ -305,7 +305,7 @@ if (! GETPOST("source") && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -392,7 +392,7 @@ if (GETPOST("source") == 'order' && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -480,7 +480,7 @@ if (GETPOST("source") == 'invoice' && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -656,7 +656,7 @@ if (GETPOST("source") == 'contractline' && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -786,7 +786,7 @@ if (GETPOST("source") == 'membersubscription' && $valid)
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
}
else {
$valtoshow=$amount;

View File

@ -647,7 +647,7 @@ if (! $source)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -738,7 +738,7 @@ if ($source == 'order')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -858,7 +858,7 @@ if ($source == 'invoice')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"), 'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"), 'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -1079,7 +1079,7 @@ if ($source == 'contractline')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -1239,7 +1239,7 @@ if ($source == 'membersubscription')
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
}
else {
$valtoshow=$amount;

View File

@ -387,7 +387,7 @@ if (! GETPOST("source"))
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -472,7 +472,7 @@ if (GETPOST("source") == 'order')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -582,7 +582,7 @@ if (GETPOST("source") == 'invoice')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -780,7 +780,7 @@ if (GETPOST("source") == 'contractline')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -936,7 +936,7 @@ if (GETPOST("source") == 'membersubscription')
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
}
else {
$valtoshow=$amount;

View File

@ -455,7 +455,7 @@ if (! GETPOST("source"))
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -541,7 +541,7 @@ if (GETPOST("source") == 'order')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -652,7 +652,7 @@ if (GETPOST("source") == 'invoice')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -852,7 +852,7 @@ if (GETPOST("source") == 'contractline')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount","alpha"),'MT').'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -1008,7 +1008,7 @@ if (GETPOST("source") == 'membersubscription')
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
}
else {
$valtoshow=$amount;