FIX If bank module on, field must be required to register payment of
expense report.
This commit is contained in:
parent
ea4a83838c
commit
0d1bb5e7eb
@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
$langs->load("banks");
|
||||||
|
|
||||||
$chid=GETPOST("id");
|
$chid=GETPOST("id");
|
||||||
$action=GETPOST('action');
|
$action=GETPOST('action');
|
||||||
@ -62,22 +63,22 @@ if ($action == 'add_payment')
|
|||||||
|
|
||||||
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||||
|
|
||||||
if (! $_POST["fk_typepayment"] > 0)
|
if (! ($_POST["fk_typepayment"] > 0))
|
||||||
{
|
{
|
||||||
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
|
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if ($datepaid == '')
|
if ($datepaid == '')
|
||||||
{
|
{
|
||||||
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date"));
|
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (! empty($conf->banque->enabled) && ! $accountid > 0)
|
if (! empty($conf->banque->enabled) && ! ($accountid > 0))
|
||||||
{
|
{
|
||||||
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit"));
|
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToDebit")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$paymentid = 0;
|
$paymentid = 0;
|
||||||
@ -163,7 +164,6 @@ $form=new Form($db);
|
|||||||
// Form to create expense report payment
|
// Form to create expense report payment
|
||||||
if (GETPOST("action") == 'create')
|
if (GETPOST("action") == 'create')
|
||||||
{
|
{
|
||||||
|
|
||||||
$expensereport = new ExpenseReport($db);
|
$expensereport = new ExpenseReport($db);
|
||||||
$expensereport->fetch($chid);
|
$expensereport->fetch($chid);
|
||||||
|
|
||||||
@ -171,11 +171,6 @@ if (GETPOST("action") == 'create')
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("DoPayment"));
|
print load_fiche_titre($langs->trans("DoPayment"));
|
||||||
|
|
||||||
if ($mesg)
|
|
||||||
{
|
|
||||||
print "<div class=\"error\">$mesg</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="id" value="'.$chid.'">';
|
print '<input type="hidden" name="id" value="'.$chid.'">';
|
||||||
@ -222,12 +217,15 @@ if (GETPOST("action") == 'create')
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
if (! empty($conf->banque->enabled))
|
||||||
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
|
{
|
||||||
print '<td colspan="2">';
|
print '<tr>';
|
||||||
$form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$expensereport->accountid, "accountid", 0, '',1); // Show open bank account list
|
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
|
||||||
print '</td></tr>';
|
print '<td colspan="2">';
|
||||||
|
$form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$expensereport->accountid, "accountid", 0, '',1); // Show open bank account list
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
print '<tr><td>'.$langs->trans('Numero');
|
print '<tr><td>'.$langs->trans('Numero');
|
||||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||||
@ -243,9 +241,7 @@ if (GETPOST("action") == 'create')
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
/*
|
// List of expenses ereport not already paid completely
|
||||||
* Autres charges impayees
|
|
||||||
*/
|
|
||||||
$num = 1;
|
$num = 1;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
|||||||
@ -1687,8 +1687,10 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
|
|||||||
else $appli.=" ".DOL_VERSION;
|
else $appli.=" ".DOL_VERSION;
|
||||||
print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">';
|
print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">';
|
||||||
if ($doliurl) print '<a class="help" target="_blank" href="'.$doliurl.'">';
|
if ($doliurl) print '<a class="help" target="_blank" href="'.$doliurl.'">';
|
||||||
|
else print '<span class="help">';
|
||||||
print $appli;
|
print $appli;
|
||||||
if ($doliurl) print '</a>';
|
if ($doliurl) print '</a>';
|
||||||
|
else print '</span>';
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|
||||||
// Link to bugtrack
|
// Link to bugtrack
|
||||||
|
|||||||
@ -1633,7 +1633,7 @@ font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php p
|
|||||||
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; white-space: nowrap; }
|
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; white-space: nowrap; }
|
||||||
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
||||||
|
|
||||||
a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print $fontsizesmaller ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #666666; text-decoration: none; }
|
a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:<?php print $fontsizesmaller ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #666666; text-decoration: none; }
|
||||||
|
|
||||||
.vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks
|
.vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1644,7 +1644,7 @@ font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php p
|
|||||||
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; white-space: nowrap; }
|
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; white-space: nowrap; }
|
||||||
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
||||||
|
|
||||||
a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print $fontsizesmaller ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #666666; text-decoration: none; }
|
a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:<?php print $fontsizesmaller ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #666666; text-decoration: none; }
|
||||||
|
|
||||||
|
|
||||||
div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
|
div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user