Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop-api
This commit is contained in:
commit
0202f8d488
@ -4644,13 +4644,19 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$out .= '<tr '.$class.$csstyle.' class="'.$this->element.'_extras_'.$key.'">';
|
$out .= '<tr '.$class.$csstyle.' class="'.$this->element.'_extras_'.$key.'">';
|
||||||
}
|
}
|
||||||
// Convert date into timestamp format
|
// Convert date into timestamp format (value in memory must be a timestamp)
|
||||||
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
|
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
|
||||||
{
|
{
|
||||||
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]);
|
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]);
|
||||||
}
|
}
|
||||||
|
// Convert float submited string into real php numeric (value in memory must be a php numeric)
|
||||||
|
if (in_array($extrafields->attribute_type[$key],array('price','double')))
|
||||||
|
{
|
||||||
|
$value = isset($_POST["options_".$key])?price2num($_POST["options_".$key]):$this->array_options['options_'.$key];
|
||||||
|
}
|
||||||
|
|
||||||
$labeltoshow = $langs->trans($label);
|
$labeltoshow = $langs->trans($label);
|
||||||
|
|
||||||
if($extrafields->attribute_required[$key])
|
if($extrafields->attribute_required[$key])
|
||||||
{
|
{
|
||||||
$labeltoshow = '<span'.($mode != 'view' ? ' class="fieldrequired"':'').'>'.$labeltoshow.'</span>';
|
$labeltoshow = '<span'.($mode != 'view' ? ' class="fieldrequired"':'').'>'.$labeltoshow.'</span>';
|
||||||
|
|||||||
@ -804,7 +804,7 @@ class ExtraFields
|
|||||||
* Return HTML string to put an input field into a page
|
* Return HTML string to put an input field into a page
|
||||||
*
|
*
|
||||||
* @param string $key Key of attribute
|
* @param string $key Key of attribute
|
||||||
* @param string $value Preselected value to show (for date type it must be in timestamp format)
|
* @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value)
|
||||||
* @param string $moreparam To add more parametes on html input tag
|
* @param string $moreparam To add more parametes on html input tag
|
||||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||||
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
||||||
@ -927,11 +927,14 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
elseif ($type == 'price')
|
elseif ($type == 'price')
|
||||||
{
|
{
|
||||||
$out='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keysuffix.'options_'.$key.$keyprefix.'" value="'.price2num($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
|
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
|
||||||
|
$value=price($value);
|
||||||
|
}
|
||||||
|
$out.='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keysuffix.'options_'.$key.$keyprefix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
|
||||||
}
|
}
|
||||||
elseif ($type == 'double')
|
elseif ($type == 'double')
|
||||||
{
|
{
|
||||||
if (!empty($value)) {
|
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
|
||||||
$value=price($value);
|
$value=price($value);
|
||||||
}
|
}
|
||||||
$out='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keysuffix.'options_'.$key.$keyprefix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
|
$out='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keysuffix.'options_'.$key.$keyprefix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
|
||||||
|
|||||||
@ -2554,15 +2554,10 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (empty($this->tva_tx)) {
|
if (empty($this->remise_percent)) $this->remise_percent = 0;
|
||||||
$this->tva_tx = 0;
|
if (empty($this->tva_tx)) $this->tva_tx = 0;
|
||||||
}
|
if (empty($this->localtax1_tx)) $this->localtax1_tx = 0;
|
||||||
if (empty($this->localtax1_tx)) {
|
if (empty($this->localtax2_tx)) $this->localtax2_tx = 0;
|
||||||
$this->localtax1_tx = 0;
|
|
||||||
}
|
|
||||||
if (empty($this->localtax2_tx)) {
|
|
||||||
$this->localtax2_tx = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user