28require
'../../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
33$langs->loadLangs(array(
'banks',
'categories',
'compta',
'bills'));
36$accountstatic =
new Account($db);
40 $socid = $user->socid;
44$usercancreate = $user->hasRight(
'banque',
'cheque');
48$arrayofpaymentmodetomanage = explode(
',',
getDolGlobalString(
'BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT',
'CHQ'));
63 $title = $langs->trans(
"ChequesArea");
65 $title = $langs->trans(
"DocumentsDepositArea");
72 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewDeposit'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?action=new');
77print
'<div class="fichecenter"><div class="fichethirdleft">';
79print
'<div class="div-table-responsive-no-min">';
80print
'<table class="noborder centpercent">';
81print
'<tr class="liste_titre">';
82print
'<th colspan="2">'.$langs->trans(
"DocumentsForDeposit").
"</th>\n";
85foreach ($arrayofpaymentmodetomanage as $val) {
86 $sql =
"SELECT count(b.rowid) as nb";
87 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
88 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
89 $sql .=
" WHERE ba.rowid = b.fk_account";
90 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
91 $sql .=
" AND b.fk_type = '".$db->escape($val).
"'";
92 $sql .=
" AND b.fk_bordereau = 0";
93 $sql .=
" AND b.amount > 0";
95 $resql = $db->query($sql);
98 if ($obj = $db->fetch_object($resql)) {
101 print
'<tr class="oddeven">';
104 print $langs->trans(
"BankChecks");
106 print($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $langs->trans(
"PaymentMode").
' '.$val);
109 print
'<td class="right">';
110 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>';
117print
"</table></div>\n";
120print
'</div><div class="fichetwothirdright">';
124foreach ($arrayofpaymentmodetomanage as $val) {
125 $sql =
"SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
126 $sql .=
" bc.statut as status, bc.nbcheque, bc.type,";
127 $sql .=
" ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
129 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc, ".MAIN_DB_PREFIX.
"bank_account as ba";
130 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
131 $sql .=
" WHERE ba.rowid = bc.fk_bank_account";
132 $sql .=
" AND bc.entity = ".((int) $conf->entity);
133 $sql .=
" AND bc.type = '".$db->escape($val).
"'";
134 $sql .=
" ORDER BY bc.date_bordereau DESC, rowid DESC";
135 $sql .= $db->plimit($max);
137 $resql = $db->query($sql);
139 print
'<div class="div-table-responsive-no-min">';
140 print
'<table class="noborder centpercent">';
141 print
'<tr class="liste_titre">';
144 print $langs->trans(
"LastCheckReceiptShort", $max);
146 $labelpaymentmode = ($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $val);
147 print $langs->trans(
"LastPaymentForDepositShort", $max, $labelpaymentmode);
150 print
'<th>'.$langs->trans(
"Date").
"</th>";
151 print
'<th>'.$langs->trans(
"BankAccount").
'</th>';
152 print
'<th class="right">'.$langs->trans(
"NbOfCheques").
'</th>';
153 print
'<th class="right">'.$langs->trans(
"Amount").
'</th>';
154 print
'<th class="right">'.$langs->trans(
"Status").
'</th>';
158 while ($objp = $db->fetch_object($resql)) {
161 $checkdepositstatic->id = $objp->rowid;
162 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
163 $checkdepositstatic->statut = $objp->status;
164 $checkdepositstatic->status = $objp->status;
166 $accountstatic->id = $objp->bid;
167 $accountstatic->ref = $objp->bref;
168 $accountstatic->label = $objp->label;
169 $accountstatic->number = $objp->number;
170 $accountstatic->currency_code = $objp->currency_code;
171 $accountstatic->account_number = $objp->account_number;
172 $accountstatic->accountancy_journal = $objp->code;
173 $accountstatic->fk_accountancy_journal = $objp->fk_accountancy_journal;
175 print
'<tr class="oddeven">'.
"\n";
177 print
'<td class="nowraponall">'.$checkdepositstatic->getNomUrl(1).
'</td>';
178 print
'<td>'.dol_print_date($db->jdate($objp->db),
'day').
'</td>';
179 print
'<td class="nowraponall">'.$accountstatic->getNomUrl(1).
'</td>';
180 print
'<td class="right">'.dol_escape_htmltag($objp->nbcheque).
'</td>';
181 print
'<td class="right"><span class="amount nowraponall">'.price($objp->amount).
'</span></td>';
182 print
'<td class="right">'.$checkdepositstatic->LibStatut($objp->status, 3).
'</td>';
187 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()
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 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...
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.