forked from Wavyzz/dolibarr
Fix: change the parameter value of dol_getIdFromCode
This commit is contained in:
@@ -3660,7 +3660,7 @@ class Facture extends CommonInvoice
|
||||
if (! $error)
|
||||
{
|
||||
// Force payment mode of invoice to withdraw
|
||||
$payment_mode_id = dol_getIdFromCode($this->db, 'PRE', 'c_paiement', 'code', 'id', getEntity('c_paiement'));
|
||||
$payment_mode_id = dol_getIdFromCode($this->db, 'PRE', 'c_paiement', 'code', 'id', 1);
|
||||
if ($payment_mode_id > 0)
|
||||
{
|
||||
$result=$this->setPaymentMethods($payment_mode_id);
|
||||
|
||||
@@ -251,7 +251,7 @@ if (empty($reshook))
|
||||
$paiement->datepaye = $datepaye;
|
||||
$paiement->amounts = $amounts; // Array with all payments dispatching with invoice id
|
||||
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
|
||||
$paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement','code','id',getEntity('c_paiement'));
|
||||
$paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement','code','id',1);
|
||||
$paiement->num_paiement = GETPOST('num_paiement');
|
||||
$paiement->note = GETPOST('comment');
|
||||
|
||||
|
||||
@@ -478,8 +478,8 @@ class RemiseCheque extends CommonObject
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
@@ -489,9 +489,9 @@ class RemiseCheque extends CommonObject
|
||||
function load_board($user)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
|
||||
$sql = "SELECT b.rowid, b.datev as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
@@ -500,28 +500,28 @@ class RemiseCheque extends CommonObject
|
||||
$sql.= " AND b.fk_type = 'CHQ'";
|
||||
$sql.= " AND b.fk_bordereau = 0";
|
||||
$sql.= " AND b.amount > 0";
|
||||
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$langs->load("banks");
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->bank->cheque->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("BankChecksToReceipt");
|
||||
$response->url=DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank';
|
||||
$response->img=img_object('',"payment");
|
||||
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
|
||||
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->cheque->warning_delay)) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
@@ -531,8 +531,8 @@ class RemiseCheque extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
@@ -541,9 +541,9 @@ class RemiseCheque extends CommonObject
|
||||
function load_state_board()
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
|
||||
$sql = "SELECT count(b.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
@@ -551,11 +551,11 @@ class RemiseCheque extends CommonObject
|
||||
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
$sql.= " AND b.fk_type = 'CHQ'";
|
||||
$sql.= " AND b.amount > 0";
|
||||
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["cheques"]=$obj->nb;
|
||||
@@ -792,7 +792,7 @@ class RemiseCheque extends CommonObject
|
||||
$rejectedPayment = new Paiement($db);
|
||||
$rejectedPayment->amounts = array();
|
||||
$rejectedPayment->datepaye = $rejection_date;
|
||||
$rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement','code','id',getEntity('c_paiement'));
|
||||
$rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement','code','id',1);
|
||||
$rejectedPayment->num_paiement = $payment->numero;
|
||||
|
||||
while($obj = $db->fetch_object($resql))
|
||||
|
||||
Reference in New Issue
Block a user