27require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/loan/class/paymentloan.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
42$langs->loadLangs(array(
"bills",
"banks",
"companies",
"loan"));
46$action =
GETPOST(
'action',
'aZ09');
49 $socid = $user->socid;
56 $result = $payment->fetch($id);
62if (!$user->hasRight(
'loan',
'read')) {
72if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'loan',
'delete')) {
75 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"loan_schedule SET fk_bank = 0 WHERE fk_bank = ".((int) $payment->fk_bank);
78 $fk_loan = $payment->fk_loan;
80 $result = $payment->delete($user);
83 header(
"Location: ".DOL_URL_ROOT.
"/loan/card.php?id=".urlencode((
string) ($fk_loan)));
98$title = $langs->trans(
'Loans');
99$help_url =
"EN:Module_Loan|FR:Module_Emprunt";
101llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-loan page-payment-card');
107$head[$h][0] = DOL_URL_ROOT.
'/loan/payment/card.php?id='.
$id;
108$head[$h][1] = $langs->trans(
"PaymentLoan");
112print
dol_get_fiche_head($head, $hselected, $langs->trans(
"PaymentLoan"), -1,
'payment');
117if ($action ==
'delete') {
118 print $form->formconfirm(
'card.php?id='.$payment->id, $langs->trans(
"DeletePayment"), $langs->trans(
"ConfirmDeletePayment"),
'confirm_delete',
'', 0, 2);
125dol_banner_tab($payment,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
127print
'<div class="fichecenter">';
128print
'<div class="underbanner clearboth"></div>';
130print
'<table class="border centpercent">';
133print
'<tr><td>'.$langs->trans(
'Date').
'</td><td>'.
dol_print_date($payment->datep,
'day').
'</td></tr>';
136print
'<tr><td>'.$langs->trans(
'Mode').
'</td><td>'.$langs->trans(
"PaymentType".$payment->type_code).
'</td></tr>';
139print
'<tr><td>'.$langs->trans(
'LoanCapital').
'</td><td>'.
price($payment->amount_capital, 0, $langs, 1, -1, -1,
$conf->currency).
'</td></tr>';
140print
'<tr><td>'.$langs->trans(
'Insurance').
'</td><td>'.
price($payment->amount_insurance, 0, $langs, 1, -1, -1,
$conf->currency).
'</td></tr>';
141print
'<tr><td>'.$langs->trans(
'Interest').
'</td><td>'.
price($payment->amount_interest, 0, $langs, 1, -1, -1,
$conf->currency).
'</td></tr>';
144print
'<tr><td>'.$langs->trans(
'NotePrivate').
'</td><td>'.nl2br($payment->note_private).
'</td></tr>';
147print
'<tr><td>'.$langs->trans(
'NotePublic').
'</td><td>'.nl2br($payment->note_public).
'</td></tr>';
151 if ($payment->bank_account) {
153 $bankline->fetch($payment->bank_line);
156 print
'<td>'.$langs->trans(
'BankTransactionLine').
'</td>';
158 print $bankline->getNomUrl(1, 0,
'showall');
174$sql =
'SELECT l.rowid as id, l.label, l.paid, l.capital as capital, pl.amount_capital, pl.amount_insurance, pl.amount_interest';
175$sql .=
' FROM '.MAIN_DB_PREFIX.
'payment_loan as pl,'.MAIN_DB_PREFIX.
'loan as l';
176$sql .=
' WHERE pl.fk_loan = l.rowid';
177$sql .=
' AND l.entity = '.((int)
$conf->entity);
178$sql .=
' AND pl.rowid = '.((int) $payment->id);
180dol_syslog(
"loan/payment/card.php", LOG_DEBUG);
181$resql =
$db->query($sql);
183 $num =
$db->num_rows($resql);
187 print
'<br><table class="noborder centpercent">';
188 print
'<tr class="liste_titre">';
189 print
'<td>'.$langs->trans(
'Loan').
'</td>';
190 print
'<td>'.$langs->trans(
'Label').
'</td>';
192 print
'<td class="center">'.$langs->trans(
'Status').
'</td>';
193 print
'<td class="right">'.$langs->trans(
'PayedByThisPayment').
'</td>';
198 $objp =
$db->fetch_object($resql);
200 print
'<tr class="oddeven">';
203 $loan->fetch($objp->id);
204 print $loan->getNomUrl(1);
207 print
'<td>'.$objp->label.
'</td>';
211 print
'<td class="center">'.$loan->getLibStatut(4, $objp->amount_capital).
'</td>';
213 $amount_payed = $objp->amount_capital + $objp->amount_insurance + $objp->amount_interest;
215 print
'<td class="right">'.price($amount_payed).
'</td>';
217 if ($objp->paid == 1) {
220 $total += $objp->amount_capital;
239print
'<div class="tabsAction">';
241if (empty($action) && $user->hasRight(
'loan',
'delete')) {
242 if (!$disable_delete) {
243 print dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&action=delete&token='.newToken(),
'delete', 1);
245 print dolGetButtonAction($langs->trans(
"CantRemovePaymentWithOneInvoicePaid"), $langs->trans(
"Delete"),
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.newToken(),
'delete', 0);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 transaction lines.
Class to manage payments of loans.
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_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.