28 require
'../../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
30 require_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');
58 llxHeader(
'', $langs->trans(
"ChequesArea"));
62 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewDeposit'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?action=new');
65 print
load_fiche_titre($langs->trans(
"ChequesArea"), $newcardbutton, $checkdepositstatic->picto);
67 print
'<div class="fichecenter"><div class="fichethirdleft">';
69 $sql =
"SELECT count(b.rowid) as nb";
70 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
71 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
72 $sql .=
" WHERE ba.rowid = b.fk_account";
73 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
74 $sql .=
" AND b.fk_type = 'CHQ'";
75 $sql .=
" AND b.fk_bordereau = 0";
76 $sql .=
" AND b.amount > 0";
80 print
'<div class="div-table-responsive-no-min">';
81 print
'<table class="noborder centpercent">';
82 print
'<tr class="liste_titre">';
83 print
'<th colspan="2">'.$langs->trans(
"BankChecks").
"</th>\n";
88 if ($obj = $db->fetch_object(
$resql)) {
91 print
'<tr class="oddeven">';
92 print
'<td>'.$langs->trans(
"BankChecksToReceipt").
'</td>';
93 print
'<td class="right">';
94 print
'<a class="badge badge-info" href="'.DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?leftmenu=customers_bills_checks&action=new">'.$num.
'</a>';
99 print
"</table></div>\n";
102 print
'</div><div class="fichetwothirdright">';
106 $sql =
"SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
107 $sql .=
" bc.statut, bc.nbcheque,";
108 $sql .=
" ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
110 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc, ".MAIN_DB_PREFIX.
"bank_account as ba";
111 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
112 $sql .=
" WHERE ba.rowid = bc.fk_bank_account";
113 $sql .=
" AND bc.entity = ".$conf->entity;
114 $sql .=
" ORDER BY bc.date_bordereau DESC, rowid DESC";
115 $sql .= $db->plimit($max);
117 $resql = $db->query($sql);
119 print
'<div class="div-table-responsive-no-min">';
120 print
'<table class="noborder centpercent">';
121 print
'<tr class="liste_titre">';
122 print
'<th>'.$langs->trans(
"LastCheckReceiptShort", $max).
'</th>';
123 print
'<th>'.$langs->trans(
"Date").
"</th>";
124 print
'<th>'.$langs->trans(
"Account").
'</th>';
125 print
'<th class="right">'.$langs->trans(
"NbOfCheques").
'</th>';
126 print
'<th class="right">'.$langs->trans(
"Amount").
'</th>';
127 print
'<th class="right">'.$langs->trans(
"Status").
'</th>';
130 while ($objp = $db->fetch_object(
$resql)) {
131 $checkdepositstatic->id = $objp->rowid;
132 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
133 $checkdepositstatic->statut = $objp->statut;
135 $accountstatic->id = $objp->bid;
136 $accountstatic->ref = $objp->bref;
137 $accountstatic->label = $objp->label;
138 $accountstatic->number = $objp->number;
139 $accountstatic->currency_code = $objp->currency_code;
140 $accountstatic->account_number = $objp->account_number;
141 $accountstatic->accountancy_journal = $objp->code;
142 $accountstatic->fk_accountancy_journal = $objp->fk_accountancy_journal;
144 print
'<tr class="oddeven">'.
"\n";
146 print
'<td class="nowraponall">'.$checkdepositstatic->getNomUrl(1).
'</td>';
147 print
'<td>'.dol_print_date($db->jdate($objp->db),
'day').
'</td>';
148 print
'<td class="nowraponall">'.$accountstatic->getNomUrl(1).
'</td>';
149 print
'<td class="right">'.$objp->nbcheque.
'</td>';
150 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
151 print
'<td class="right">'.$checkdepositstatic->LibStatut($objp->statut, 3).
'</td>';
164 print
'</div></div>';
Class to manage bank accounts.
Class to manage cheque delivery receipts.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
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.