Skip to content

Commit

Permalink
Debug v21
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 10, 2024
1 parent 4e86e65 commit 082e6a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions htdocs/compta/prelevement/class/bonprelevement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ public function create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL'
// Pre-store some values into variables to simplify following sql requests
if ($sourcetype != 'salary') {
$entities = $type != 'bank-transfer' ? getEntity('invoice') : getEntity('supplier_invoice');
$sqlTable = $type != 'bank-transfer' ? "facture" : "facture_fourn";
$socOrUser = 'fk_soc';
$societeOrUser = 'societe';
} else {
Expand All @@ -1099,8 +1100,6 @@ public function create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL'
$societeOrUser = 'user';
}

$sqlTable = $type != 'bank-transfer' ? "facture" : "facture_fourn";

$thirdpartyBANId = 0;

// Check if there is an iban associated to the bank transfer request or if we take the default
Expand Down Expand Up @@ -1160,7 +1159,7 @@ public function create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL'
$sql .= ", CONCAT(s.firstname,' ',s.lastname) as name";
$sql .= ", f.ref, sr.bic, sr.iban_prefix, 'FRST' as frstrecur";
}
$sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f";
$sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f"; // f is salary, facture or facture_fourn
$sql .= " LEFT JOIN " . $this->db->prefix() . "prelevement_demande as pd ON f.rowid = pd.fk_".$this->db->sanitize($sqlTable);
$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser)." as s ON s.rowid = f.".$this->db->sanitize($socOrUser);
$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser."_rib")." as sr ON s.rowid = sr.".$this->db->sanitize($socOrUser);
Expand Down

0 comments on commit 082e6a7

Please sign in to comment.