New: Removed limit on cheque receipts

This commit is contained in:
Laurent Destailleur 2011-03-20 16:52:43 +00:00
parent 57d4fc840c
commit 66313efa6e
2 changed files with 7 additions and 5 deletions

View File

@ -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);

View File

@ -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>';
}
}