diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 483df326566..591b8e45bef 100755 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -469,7 +469,7 @@ class BonPrelevement extends CommonObject $message = $langs->trans("InfoCreditMessage", $this->ref, dol_print_date($date, 'dayhour')); //Add payment of withdrawal into bank - $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); + $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); $facs = array(); $amounts = array(); $amountsperthirdparty = array(); @@ -2186,7 +2186,7 @@ class BonPrelevement extends CommonObject // Get data of bank account //$id = $configuration->global->PRELEVEMENT_ID_BANKACCOUNT; - $id = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); + $id = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); $account = new Account($this->db); if ($account->fetch($id) > 0) { diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index c831d4f3e0f..e80a2f28dff 100755 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -15,7 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -39,7 +38,7 @@ class RejetPrelevement * @var DoliDB Database handler. */ public $db; - + public $type; //prelevement or bank transfer @@ -95,7 +94,7 @@ class RejetPrelevement $now = dol_now(); dol_syslog("RejetPrelevement::Create id $id"); - $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); + $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); $facs = $this->getListInvoices(1); $this->db->begin(); @@ -141,14 +140,14 @@ class RejetPrelevement for ($i = 0; $i < $num; $i++) { if($this->type == 'bank-transfer'){ - $fac = new FactureFournisseur($this->db); + $fac = new FactureFournisseur($this->db); $pai = new PaiementFourn($this->db); } else{ $fac = new Facture($this->db); $pai = new Paiement($this->db); } - + $fac->fetch($facs[$i][0]); // Make a negative payment @@ -307,7 +306,7 @@ class RejetPrelevement //$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)"; if ($this->type == 'bank-transfer') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON (pf.fk_facture_fourn = f.rowid)"; else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)"; - + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_lignes as pl ON (pf.fk_prelevement_lignes = pl.rowid)"; $sql .= " WHERE pf.fk_prelevement_lignes = ".$this->id; $sql .= " AND f.entity IN (".getEntity('invoice').")"; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 78a0723aef2..07a79e5eda8 100755 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -97,11 +97,11 @@ if ($action == 'confirm_rejet') if ($lipre->fetch($id) == 0) { - $rej = new RejetPrelevement($db, $user,$type); + $rej = new RejetPrelevement($db, $user, $type); $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int')); - header("Location: line.php?id=".$id.'&type='.$type); + header("Location: line.php?id=".urlencode($id).'&type='.urlencode($type)); exit; } } @@ -112,7 +112,7 @@ if ($action == 'confirm_rejet') } else { - header("Location: line.php?id=".$id.'&type='.$type); + header("Location: line.php?id=".urlencode($id).'&type='.urlencode($type)); exit; } } @@ -208,7 +208,7 @@ if ($id) print '
'; print ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 730cb01c82b..ee41343dfc2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2264,7 +2264,6 @@ class ExpenseReport extends CommonObject $langs->load("trips"); if (!dol_strlen($modele)) { - if ($this->modelpdf) { $modele = $this->modelpdf; } elseif (!empty($conf->global->EXPENSEREPORT_ADDON_PDF)) { @@ -2278,7 +2277,6 @@ class ExpenseReport extends CommonObject } else { return 0; } - } /**