29require
'../../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
42$langs->loadLangs(array(
'banks',
'categories',
'compta',
'bills'));
45$accountstatic =
new Account($db);
49 $socid = $user->socid;
53$usercancreate = $user->hasRight(
'banque',
'cheque');
57$arrayofpaymentmodetomanage = explode(
',',
getDolGlobalString(
'BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT',
'CHQ'));
72 $title = $langs->trans(
"ChequesArea");
74 $title = $langs->trans(
"DocumentsDepositArea");
81 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewDeposit'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?action=new');
86print
'<div class="fichecenter"><div class="fichethirdleft">';
88print
'<div class="div-table-responsive-no-min">';
89print
'<table class="noborder centpercent">';
90print
'<tr class="liste_titre">';
91print
'<th colspan="2">'.$langs->trans(
"DocumentsForDeposit").
"</th>\n";
94foreach ($arrayofpaymentmodetomanage as $val) {
95 $sql =
"SELECT count(b.rowid) as nb";
96 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
97 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
98 $sql .=
" WHERE ba.rowid = b.fk_account";
99 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
100 $sql .=
" AND b.fk_type = '".$db->escape($val).
"'";
101 $sql .=
" AND b.fk_bordereau = 0";
102 $sql .=
" AND b.amount > 0";
104 $resql = $db->query($sql);
107 if ($obj = $db->fetch_object($resql)) {
110 print
'<tr class="oddeven">';
113 print $langs->trans(
"BankChecks");
115 print($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $langs->trans(
"PaymentMode").
' '.$val);
118 print
'<td class="right">';
119 print
'<a class="badge badge-info" href="'.DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?leftmenu=customers_bills_checks&action=new&type='.urlencode($val).
'">'.
dol_escape_htmltag($num).
'</a>';
126print
"</table></div>\n";
129print
'</div><div class="fichetwothirdright">';
133foreach ($arrayofpaymentmodetomanage as $val) {
134 $sql =
"SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
135 $sql .=
" bc.statut as status, bc.nbcheque, bc.type,";
136 $sql .=
" ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
138 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc, ".MAIN_DB_PREFIX.
"bank_account as ba";
139 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
140 $sql .=
" WHERE ba.rowid = bc.fk_bank_account";
141 $sql .=
" AND bc.entity = ".((int)
$conf->entity);
142 $sql .=
" AND bc.type = '".$db->escape($val).
"'";
143 $sql .=
" ORDER BY bc.date_bordereau DESC, rowid DESC";
144 $sql .= $db->plimit($max);
146 $resql = $db->query($sql);
148 print
'<div class="div-table-responsive-no-min">';
149 print
'<table class="noborder centpercent">';
150 print
'<tr class="liste_titre">';
153 print $langs->trans(
"LastCheckReceiptShort", $max);
155 $labelpaymentmode = ($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $val);
156 print $langs->trans(
"LastPaymentForDepositShort", $max, $labelpaymentmode);
159 print
'<th>'.$langs->trans(
"Date").
"</th>";
160 print
'<th>'.$langs->trans(
"BankAccount").
'</th>';
161 print
'<th class="right">'.$langs->trans(
"NbOfCheques").
'</th>';
162 print
'<th class="right">'.$langs->trans(
"Amount").
'</th>';
163 print
'<th class="right">'.$langs->trans(
"Status").
'</th>';
167 while ($objp = $db->fetch_object($resql)) {
170 $checkdepositstatic->id = $objp->rowid;
171 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
172 $checkdepositstatic->statut = $objp->status;
173 $checkdepositstatic->status = $objp->status;
175 $accountstatic->id = $objp->bid;
176 $accountstatic->ref = $objp->bref;
177 $accountstatic->label = $objp->label;
178 $accountstatic->number = $objp->number;
179 $accountstatic->currency_code = $objp->currency_code;
180 $accountstatic->account_number = $objp->account_number;
181 $accountstatic->accountancy_journal = $objp->code;
182 $accountstatic->fk_accountancy_journal = $objp->fk_accountancy_journal;
184 print
'<tr class="oddeven">'.
"\n";
186 print
'<td class="nowraponall">'.$checkdepositstatic->getNomUrl(1).
'</td>';
187 print
'<td>'.dol_print_date($db->jdate($objp->db),
'day').
'</td>';
188 print
'<td class="nowraponall">'.$accountstatic->getNomUrl(1).
'</td>';
189 print
'<td class="right">'.dol_escape_htmltag($objp->nbcheque).
'</td>';
190 print
'<td class="right"><span class="amount nowraponall">'.price($objp->amount).
'</span></td>';
191 print
'<td class="right">'.$checkdepositstatic->LibStatut($objp->status, 3).
'</td>';
196 print
'<tr><td colspan="6"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
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 cheque delivery receipts.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.