diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index c36cc582deb32ac33b0932b3864d4a87623d3cb0..1457c7f9c9f0d9987c0502c73b205b761ebf262f 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -114,11 +114,12 @@ class RemiseCheque extends CommonObject /** * Create a receipt to send cheques - * @param user Utilisateur qui effectue l'operation - * @param account_id Compte bancaire concerne + * @param user User making creation + * @param account_id Bank account for cheque receipt + * @param limit Limit number of cheque to this * @return int <0 if KO, >0 if OK */ - function create($user, $account_id) + function create($user, $account_id, $limit=40) { global $conf; @@ -186,7 +187,7 @@ class RemiseCheque extends CommonObject $sql.= " AND b.amount > 0"; $sql.= " AND b.fk_bordereau = 0"; $sql.= " AND b.fk_account='".$account_id."'"; - $sql.= " LIMIT 40"; // On limite a 40 pour ne generer des PDF que d'une page + if ($limit) $sql.= $this->db->plimit($limit); dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 718df6f595899431355d6570d3cee99ed5730066..818fb394837cad6cba8e0390f2e7676df9020dbc 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -86,7 +86,7 @@ if ($_POST['action'] == 'setdate' && $user->rights->banque->cheque) if ($_GET['action'] == 'create' && $_GET["accountid"] > 0 && $user->rights->banque->cheque) { $remisecheque = new RemiseCheque($db); - $result = $remisecheque->create($user, $_GET["accountid"]); + $result = $remisecheque->create($user, $_GET["accountid"], 0); if ($result > 0) { if ($remisecheque->statut == 1) // If statut is validated, we build doc @@ -536,6 +536,7 @@ if ($_GET['action'] != 'new') { $dirchequereceipts = $dir.get_exdir($remisecheque->number,2,1).$remisecheque->ref; $formfile->show_documents("remisecheque",$remisecheque->ref,$dirchequereceipts,$_SERVER["PHP_SELF"].'?id='.$remisecheque->id,1,1); + print '<br>'; } }