27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/paymentexpensereport.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/modules/expensereport/modules_expensereport.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/expensereport.lib.php';
32if (isModEnabled(
"bank")) {
33 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
45$langs->loadLangs(array(
'bills',
'banks',
'companies',
'trips'));
48$action =
GETPOST(
'action',
'aZ09');
53 $socid = $user->socid;
73if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'expensereport',
'supprimer')) {
76 $result =
$object->delete($user);
79 header(
"Location: ".DOL_URL_ROOT.
"/expensereport/index.php");
92llxHeader(
'', $langs->trans(
"ExpenseReportPayment"));
98print
dol_get_fiche_head($head,
'payment', $langs->trans(
"ExpenseReportPayment"), -1,
'payment');
103if ($action ==
'delete') {
104 print $form->formconfirm(
'card.php?id='.
$object->id, $langs->trans(
"DeletePayment"), $langs->trans(
"ConfirmDeletePayment"),
'confirm_delete',
'', 0, 2);
110dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref',
'');
112print
'<div class="fichecenter">';
113print
'<div class="underbanner clearboth"></div>';
115print
'<table class="border centpercent">'.
"\n";
118print
'<tr><td class="titlefield">'.$langs->trans(
'Date').
'</td><td>'.
dol_print_date(
$object->datep,
'day').
'</td></tr>';
121print
'<tr><td>'.$langs->trans(
'PaymentMode').
'</td><td>'.$langs->trans(
"PaymentType".
$object->type_code).
'</td></tr>';
127print
'<tr><td>'.$langs->trans(
'Amount').
'</td><td>'.
price(
$object->amount, 0, $outputlangs, 1, -1, -1,
$conf->currency).
'</td></tr>';
134if (isModEnabled(
"bank")) {
137 $bankline->fetch(
$object->bank_line);
138 if ($bankline->rappro) {
140 $title_button =
dol_escape_htmltag($langs->transnoentitiesnoconv(
"CantRemoveConciliatedPayment"));
144 print
'<td>'.$langs->trans(
'BankTransactionLine').
'</td>';
145 print
'<td colspan="3">';
146 print $bankline->getNomUrl(1, 0,
'showconciliated');
151 print
'<td>'.$langs->trans(
'BankAccount').
'</td>';
152 print
'<td colspan="3">';
153 $accountstatic =
new Account($db);
154 $accountstatic->fetch($bankline->fk_account);
155 print $accountstatic->getNomUrl(1);
172$sql =
'SELECT er.rowid as eid, er.paid, er.total_ttc, per.amount';
173$sql .=
' FROM '.MAIN_DB_PREFIX.
'payment_expensereport as per,'.MAIN_DB_PREFIX.
'expensereport as er';
174$sql .=
' WHERE per.fk_expensereport = er.rowid';
175$sql .=
' AND er.entity IN ('.getEntity(
'expensereport').
')';
176$sql .=
' AND per.rowid = '.((int) $id);
178dol_syslog(
"expensereport/payment/card.php", LOG_DEBUG);
179$resql = $db->query($sql);
181 $num = $db->num_rows($resql);
187 print
'<div class="div-table-responsive">';
188 print
'<table class="noborder centpercent">';
190 print
'<tr class="liste_titre">';
191 print
'<td>'.$langs->trans(
'ExpenseReport').
'</td>';
192 print
'<td class="right">'.$langs->trans(
'ExpectedToPay').
'</td>';
193 print
'<td class="right">'.$langs->trans(
'PayedByThisPayment').
'</td>';
194 print
'<td class="right">'.$langs->trans(
'RemainderToPay').
'</td>';
195 print
'<td class="center">'.$langs->trans(
'Status').
'</td>';
200 $objp = $db->fetch_object($resql);
202 print
'<tr class="oddeven">';
205 $expensereport->fetch($objp->eid);
209 print $expensereport->getNomUrl(1);
213 print
'<td class="right">'.price($objp->total_ttc).
'</td>';
216 print
'<td class="right">'.price($objp->amount).
'</td>';
219 print
'<td class="right">'.price($objp->total_ttc - $objp->amount).
'</td>';
222 print
'<td class="center">'.$expensereport->getLibStatut(4).
'</td>';
226 if ($objp->paid == 1) {
228 $title_button = $langs->trans(
"CantRemovePaymentWithOneInvoicePaid");
230 $total += $objp->amount;
249print
'<div class="tabsAction">';
253 if ($user->hasRight(
'expensereport',
'supprimer')) {
254 if (!$disable_delete) {
257 print
dolGetButtonAction($title_button, $langs->trans(
"Delete"),
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', 0);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage Trips and Expenses.
Class to manage payments of expense report.
payment_expensereport_prepare_head(PaymentExpenseReport $object)
Returns an array with the tabs for the "Expense report payment" section It loads tabs from modules lo...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0)
Clean a string to keep only desirable HTML tags.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...