report and apply GETPOST method for $datev and $datep

fix for usage GETPOST() for input  $datev and $datep
And report definition $datev and $datep in top ection file for support GET params for action create
This commit is contained in:
oscim 2020-02-07 09:31:58 +01:00 committed by GitHub
parent 5e71366ff2
commit e408ea463c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,11 @@ $action=GETPOST("action", "alpha");
$refund=GETPOST("refund", "int");
if (empty($refund)) $refund=0;
$datev=dol_mktime(12, 0, 0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
$datep=dol_mktime(12, 0, 0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear"));
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) $socid=$user->socid;
@ -70,7 +75,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer)
if ($action == 'setdatev' && $user->rights->tax->charges->creer)
{
$object->fetch($id);
$object->datev=dol_mktime(12, 0, 0, GETPOST('datevmonth', 'int'), GETPOST('datevday', 'int'), GETPOST('datevyear', 'int'));
$object->datev=$datev;
$result=$object->update($user);
if ($result < 0) dol_print_error($db, $object->error);
@ -81,8 +86,6 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
$error=0;
$datev=dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
$datep=dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
$object->accountid=GETPOST("accountid");
$object->type_payment=GETPOST("type_payment");