New: Removed limit on cheque receipts
This commit is contained in:
parent
57d4fc840c
commit
66313efa6e
@ -114,11 +114,12 @@ class RemiseCheque extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a receipt to send cheques
|
* Create a receipt to send cheques
|
||||||
* @param user Utilisateur qui effectue l'operation
|
* @param user User making creation
|
||||||
* @param account_id Compte bancaire concerne
|
* @param account_id Bank account for cheque receipt
|
||||||
|
* @param limit Limit number of cheque to this
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $account_id)
|
function create($user, $account_id, $limit=40)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -186,7 +187,7 @@ class RemiseCheque extends CommonObject
|
|||||||
$sql.= " AND b.amount > 0";
|
$sql.= " AND b.amount > 0";
|
||||||
$sql.= " AND b.fk_bordereau = 0";
|
$sql.= " AND b.fk_bordereau = 0";
|
||||||
$sql.= " AND b.fk_account='".$account_id."'";
|
$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);
|
dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -86,7 +86,7 @@ if ($_POST['action'] == 'setdate' && $user->rights->banque->cheque)
|
|||||||
if ($_GET['action'] == 'create' && $_GET["accountid"] > 0 && $user->rights->banque->cheque)
|
if ($_GET['action'] == 'create' && $_GET["accountid"] > 0 && $user->rights->banque->cheque)
|
||||||
{
|
{
|
||||||
$remisecheque = new RemiseCheque($db);
|
$remisecheque = new RemiseCheque($db);
|
||||||
$result = $remisecheque->create($user, $_GET["accountid"]);
|
$result = $remisecheque->create($user, $_GET["accountid"], 0);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if ($remisecheque->statut == 1) // If statut is validated, we build doc
|
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;
|
$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);
|
$formfile->show_documents("remisecheque",$remisecheque->ref,$dirchequereceipts,$_SERVER["PHP_SELF"].'?id='.$remisecheque->id,1,1);
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user