Fix: Support strict mode
This commit is contained in:
parent
cc407f6216
commit
67fe67e0b1
@ -36,7 +36,7 @@ $langs->load('companies');
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'banque', '','');
|
$result = restrictedArea($user, 'cheque', '','');
|
||||||
|
|
||||||
$mesg='';
|
$mesg='';
|
||||||
|
|
||||||
@ -54,18 +54,18 @@ $offset = $limit * $page ;
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET['action'] == 'create' && $_GET["accountid"] > 0 && $user->rights->banque)
|
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"]);
|
||||||
if ($result >= 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$remisecheque->id);
|
Header("Location: fiche.php?id=".$remisecheque->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$remisecheque->error.'</div>';
|
$mesg='<div class="error">'.$remisecheque->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ if ($_GET['action'] == 'new')
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
if ($user->rights->banque->modifier)
|
if ($user->rights->banque->cheque)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?action=create&accountid='.$bid.'">'.$langs->trans('NewCheckDepositOn',$account_label).'</a>';
|
print '<a class="butAction" href="fiche.php?action=create&accountid='.$bid.'">'.$langs->trans('NewCheckDepositOn',$account_label).'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class RemiseCheque extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Crée bordereau en base
|
\brief Create a receipt to send cheques
|
||||||
\param user Utilisateur qui effectue l'operation
|
\param user Utilisateur qui effectue l'operation
|
||||||
\param account_id Compte bancaire concerne
|
\param account_id Compte bancaire concerne
|
||||||
\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)
|
||||||
{
|
{
|
||||||
@ -124,8 +124,8 @@ class RemiseCheque extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bordereau_cheque (datec, date_bordereau,fk_user_author,fk_bank_account)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bordereau_cheque (datec, date_bordereau, fk_user_author, fk_bank_account, amount, number, nbcheque)";
|
||||||
$sql .= " VALUES (now(),now(),".$user->id.",".$account_id.")";
|
$sql.= " VALUES (now(),now(),".$user->id.",".$account_id.",0,0,0)";
|
||||||
|
|
||||||
dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
|
dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -209,6 +209,7 @@ class RemiseCheque extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = -1;
|
$result = -1;
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
dolibarr_syslog("RemiseCheque::Create Erreur $result INSERT Mysql");
|
dolibarr_syslog("RemiseCheque::Create Erreur $result INSERT Mysql");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,8 +460,8 @@ class RemiseCheque extends CommonObject
|
|||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||||
$sql.= " SET amount='".ereg_replace(",",".",$total)."'";
|
$sql.= " SET amount='".price2num($total)."'";
|
||||||
$sql.= " ,nbcheque=$nb";
|
$sql.= " ,nbcheque=".$nb;
|
||||||
$sql.= " WHERE rowid='".$this->id."';";
|
$sql.= " WHERE rowid='".$this->id."';";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql)
|
||||||
|
|||||||
@ -273,7 +273,7 @@ if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($user->societe_id == 0 && $allow_delete && $paiement->statut == 0 && $_GET['action'] == '')
|
if ($user->societe_id == 0 && $allow_delete && $_GET['action'] == '')
|
||||||
{
|
{
|
||||||
if ($user->rights->facture->paiement)
|
if ($user->rights->facture->paiement)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user