FIX #3757 Can't set amount in a social contribution with some languages
This commit is contained in:
parent
c64c1a0201
commit
afe4057a97
@ -79,7 +79,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
|||||||
{
|
{
|
||||||
$dateech=@dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
|
$dateech=@dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
|
||||||
$dateperiod=@dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
|
$dateperiod=@dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
|
||||||
$amount=GETPOST('amount');
|
$amount=price2num(GETPOST('amount'));
|
||||||
$actioncode=GETPOST('actioncode');
|
$actioncode=GETPOST('actioncode');
|
||||||
if (! $dateech)
|
if (! $dateech)
|
||||||
{
|
{
|
||||||
@ -114,7 +114,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
|||||||
$chargesociales->lib=GETPOST('label');
|
$chargesociales->lib=GETPOST('label');
|
||||||
$chargesociales->date_ech=$dateech;
|
$chargesociales->date_ech=$dateech;
|
||||||
$chargesociales->periode=$dateperiod;
|
$chargesociales->periode=$dateperiod;
|
||||||
$chargesociales->amount=price2num($amount);
|
$chargesociales->amount=$amount;
|
||||||
|
|
||||||
$id=$chargesociales->create($user);
|
$id=$chargesociales->create($user);
|
||||||
if ($id <= 0)
|
if ($id <= 0)
|
||||||
@ -130,7 +130,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
|||||||
{
|
{
|
||||||
$dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
|
$dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
|
||||||
$dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
|
$dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
|
||||||
$amount=GETPOST('amount');
|
$amount=price2num(GETPOST('amount'));
|
||||||
if (! $dateech)
|
if (! $dateech)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
|
||||||
@ -146,7 +146,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
|||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
|
||||||
$action = 'edit';
|
$action = 'edit';
|
||||||
}
|
}
|
||||||
else
|
elseif (! is_numeric($amount))
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
|
||||||
|
$action = 'create';
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$chargesociales=new ChargeSociales($db);
|
$chargesociales=new ChargeSociales($db);
|
||||||
$result=$chargesociales->fetch($id);
|
$result=$chargesociales->fetch($id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user