Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
e7c044cc05
@ -825,7 +825,7 @@ if (empty($reshook))
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for proposal.
|
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht === '' && $price_ht_devise === '') // Unit price can be 0 but not ''. Also price can be negative for proposal.
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -966,7 +966,7 @@ if (empty($reshook))
|
|||||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||||
|
|
||||||
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
||||||
if (!empty($price_ht)) {
|
if (!empty($price_ht) || $price_ht === '0') {
|
||||||
$pu_ht = price2num($price_ht, 'MU');
|
$pu_ht = price2num($price_ht, 'MU');
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
} // On reevalue prix selon taux tva car taux tva transaction peut etre different
|
} // On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||||
|
|||||||
@ -820,7 +820,7 @@ if (empty($reshook))
|
|||||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||||
|
|
||||||
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
||||||
if (!empty($price_ht)) {
|
if (!empty($price_ht) || $price_ht === '0') {
|
||||||
$pu_ht = price2num($price_ht, 'MU');
|
$pu_ht = price2num($price_ht, 'MU');
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2012,7 +2012,7 @@ if (empty($reshook))
|
|||||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||||
|
|
||||||
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
|
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
|
||||||
if (!empty($price_ht))
|
if (!empty($price_ht) || $price_ht === '0')
|
||||||
{
|
{
|
||||||
$pu_ht = price2num($price_ht, 'MU');
|
$pu_ht = price2num($price_ht, 'MU');
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
|
|||||||
@ -240,18 +240,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
$permok = $user->rights->agenda->myactions->create;
|
$permok = $user->rights->agenda->myactions->create;
|
||||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
||||||
{
|
{
|
||||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') $out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '');
|
||||||
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') $out .= '&socid='.$objthirdparty->id;
|
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&origin=contact&originid='.$object->id.'&percentage=-1&backtopage='.urlencode($_SERVER['PHP_SELF'].($objcon->id > 0 ? '?id='.$objcon->id : ''));
|
||||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1';
|
$out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'));
|
||||||
//$out.=$langs->trans("AddAnAction").' ';
|
|
||||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
|
||||||
//$out.="</a>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//print '<div class="tabsAction">';
|
|
||||||
//print '</div>';
|
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if (!empty($conf->agenda->enabled))
|
if (!empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -202,7 +202,7 @@ class FormActions
|
|||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create))
|
if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create))
|
||||||
{
|
{
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
|
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')).'&origin='.urlencode($typeelement).'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -139,19 +139,11 @@ if ($socid > 0)
|
|||||||
$permok = $user->rights->agenda->myactions->create;
|
$permok = $user->rights->agenda->myactions->create;
|
||||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
||||||
{
|
{
|
||||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') $out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '').'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objthirdparty->id > 0 ? '?socid='.$objthirdparty->id : ''));
|
||||||
if (get_class($objthirdparty) == 'Societe') $out .= '&socid='.$objthirdparty->id;
|
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&percentage=-1';
|
||||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1';
|
$out .= '&datep='.dol_print_date(dol_now(), 'dayhourlog');
|
||||||
//$out.=$langs->trans("AddAnAction").' ';
|
|
||||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
|
||||||
//$out.="</a>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//print '<div class="tabsAction">';
|
|
||||||
//print '</div>';
|
|
||||||
|
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if (!empty($conf->agenda->enabled))
|
if (!empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user