forked from Wavyzz/dolibarr
Merge pull request #1867 from aspangaro/develop-patch1
Payment VAT & Salaries :: Add controls on field required
This commit is contained in:
@@ -80,7 +80,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
$sal->num_payment=GETPOST("num_payment");
|
||||
$sal->fk_user_creat=$user->id;
|
||||
|
||||
if (empty($datep) || empty($datesp) || empty($dateep))
|
||||
if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
|
||||
$error++;
|
||||
@@ -219,7 +219,7 @@ if ($action == 'create')
|
||||
print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add',1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("DateValue").'</td><td>';
|
||||
print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add',1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@@ -72,6 +72,16 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
$tva->label=GETPOST("label");
|
||||
$tva->note=GETPOST("note");
|
||||
|
||||
if (empty($tva->datev))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateValue")),'errors');
|
||||
$error++;
|
||||
}
|
||||
if (empty($tva->datep))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DatePayment")),'errors');
|
||||
$error++;
|
||||
}
|
||||
if (empty($tva->type_payment) || $tva->type_payment < 0)
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors');
|
||||
|
||||
Reference in New Issue
Block a user