FIX travis error - use double quote instead simple quote
This commit is contained in:
parent
b6f9500d46
commit
a1dc6e7e9b
@ -130,8 +130,8 @@ abstract class CommonInvoice extends CommonObject
|
||||
$field = 'fk_facturefourn';
|
||||
}
|
||||
|
||||
$sql = 'SELECT sum(amount) as amount, sum(multicurrency_amount) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().$table;
|
||||
$sql = "SELECT sum(amount) as amount, sum(multicurrency_amount) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix().$table;
|
||||
$sql .= " WHERE ".$field." = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG);
|
||||
@ -226,10 +226,10 @@ abstract class CommonInvoice extends CommonObject
|
||||
{
|
||||
$idarray = array();
|
||||
|
||||
$sql = 'SELECT rowid';
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element;
|
||||
$sql .= " WHERE fk_facture_source = ".((int) $this->id);
|
||||
$sql .= ' AND type = 2';
|
||||
$sql .= " AND type = 2";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -253,10 +253,10 @@ abstract class CommonInvoice extends CommonObject
|
||||
*/
|
||||
public function getIdReplacingInvoice($option = '')
|
||||
{
|
||||
$sql = 'SELECT rowid';
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element;
|
||||
$sql .= " WHERE fk_facture_source = ".((int) $this->id);
|
||||
$sql .= ' AND type < 2';
|
||||
$sql .= " AND type < 2";
|
||||
if ($option == 'validated') {
|
||||
$sql .= ' AND fk_statut = 1';
|
||||
}
|
||||
@ -265,7 +265,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
// and another no, priority is given to the valid one.
|
||||
// Should not happen (unless concurrent access and 2 people have created a
|
||||
// replacement invoice for the same invoice at the same time)
|
||||
$sql .= ' ORDER BY fk_statut DESC';
|
||||
$sql .= " ORDER BY fk_statut DESC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -601,8 +601,8 @@ abstract class CommonInvoice extends CommonObject
|
||||
$cdr_type = 0;
|
||||
$cdr_decalage = 0;
|
||||
|
||||
$sqltemp = 'SELECT c.type_cdr, c.nbjour, c.decalage';
|
||||
$sqltemp .= ' FROM '.$this->db->prefix().'c_payment_term as c';
|
||||
$sqltemp = "SELECT c.type_cdr, c.nbjour, c.decalage";
|
||||
$sqltemp .= " FROM ".$this->db->prefix()."c_payment_term as c";
|
||||
if (is_numeric($cond_reglement)) {
|
||||
$sqltemp .= " WHERE c.rowid=".((int) $cond_reglement);
|
||||
} else {
|
||||
@ -697,15 +697,15 @@ abstract class CommonInvoice extends CommonObject
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
$bac->fetch(0, $this->socid);
|
||||
|
||||
$sql = 'SELECT count(*)';
|
||||
$sql .= ' FROM '.$this->db->prefix().'prelevement_facture_demande';
|
||||
$sql = "SELECT count(*)";
|
||||
$sql .= " FROM ".$this->db->prefix()."prelevement_facture_demande";
|
||||
if ($type == 'bank-transfer') {
|
||||
$sql .= ' WHERE fk_facture_fourn = '.((int) $this->id);
|
||||
$sql .= " WHERE fk_facture_fourn = ".((int) $this->id);
|
||||
} else {
|
||||
$sql .= ' WHERE fk_facture = '.((int) $this->id);
|
||||
$sql .= " WHERE fk_facture = ".((int) $this->id);
|
||||
}
|
||||
$sql .= ' AND ext_payment_id IS NULL'; // To exclude record done for some online payments
|
||||
$sql .= ' AND traite = 0';
|
||||
$sql .= " AND ext_payment_id IS NULL"; // To exclude record done for some online payments
|
||||
$sql .= " AND traite = 0";
|
||||
|
||||
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -3777,8 +3777,8 @@ abstract class CommonObject
|
||||
}*/
|
||||
|
||||
// Links between objects are stored in table element_element
|
||||
$sql = 'SELECT rowid, fk_source, sourcetype, fk_target, targettype';
|
||||
$sql .= ' FROM '.$this->db->prefix().'element_element';
|
||||
$sql = "SELECT rowid, fk_source, sourcetype, fk_target, targettype";
|
||||
$sql .= " FROM ".$this->db->prefix()."element_element";
|
||||
$sql .= " WHERE ";
|
||||
if ($justsource || $justtarget) {
|
||||
if ($justsource) {
|
||||
@ -3796,7 +3796,7 @@ abstract class CommonObject
|
||||
$sql .= "(fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."')";
|
||||
$sql .= " ".$clause." (fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."')";
|
||||
}
|
||||
$sql .= ' ORDER BY '.$orderby;
|
||||
$sql .= " ORDER BY ".$orderby;
|
||||
|
||||
dol_syslog(get_class($this)."::fetchObjectLink", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -197,12 +197,12 @@ class CProductNature // extends CommonObject
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.code,";
|
||||
$sql .= " t.label,";
|
||||
$sql .= " t.active";
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
|
||||
@ -163,12 +163,12 @@ class Ctyperesource
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= ' t.rowid,';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.code,";
|
||||
$sql .= " t.label,";
|
||||
$sql .= " t.active";
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
if ($id) {
|
||||
$sql .= " WHERE t.id = ".((int) $id);
|
||||
} elseif ($code) {
|
||||
@ -228,12 +228,12 @@ class Ctyperesource
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= ' t.rowid,';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.code,";
|
||||
$sql .= " t.label,";
|
||||
$sql .= " t.active";
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
|
||||
@ -237,7 +237,7 @@ class CUnits // extends CommonObject
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql = "SELECT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.code,";
|
||||
$sql .= " t.sortorder,";
|
||||
@ -246,7 +246,7 @@ class CUnits // extends CommonObject
|
||||
$sql .= " t.unit_type,";
|
||||
$sql .= " t.scale,";
|
||||
$sql .= " t.active";
|
||||
$sql .= ' FROM '.$this->db->prefix().'c_units as t';
|
||||
$sql .= " FROM ".$this->db->prefix()."c_units as t";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
@ -471,7 +471,7 @@ class CUnits // extends CommonObject
|
||||
{
|
||||
$base = 10;
|
||||
// TODO : add base col into unit dictionary table
|
||||
$unit = $this->db->getRow('SELECT scale, unit_type from '.$this->db->prefix().'c_units WHERE rowid = '.intval($id));
|
||||
$unit = $this->db->getRow("SELECT scale, unit_type from ".$this->db->prefix()."c_units WHERE rowid = ".intval($id));
|
||||
if ($unit) {
|
||||
// TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60
|
||||
if ($unit->unit_type == 'time') {
|
||||
|
||||
@ -259,10 +259,10 @@ class DefaultValues extends CommonObject
|
||||
|
||||
$records = array();
|
||||
|
||||
$sql = 'SELECT ';
|
||||
$sql = "SELECT ";
|
||||
$sql .= $this->getFieldList();
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= ' WHERE 1 = 1';
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
$sql .= " WHERE 1 = 1";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
|
||||
@ -553,15 +553,15 @@ class DiscountAbsolute
|
||||
dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG);
|
||||
|
||||
if ($invoice->element == 'facture' || $invoice->element == 'invoice') {
|
||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture as f';
|
||||
$sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.((int) $invoice->id);
|
||||
$sql .= ' AND f.type = 3';
|
||||
$sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture as f";
|
||||
$sql .= " WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = ".((int) $invoice->id);
|
||||
$sql .= " AND f.type = 3";
|
||||
} elseif ($invoice->element == 'invoice_supplier') {
|
||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture_fourn as f';
|
||||
$sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.((int) $invoice->id);
|
||||
$sql .= ' AND f.type = 3';
|
||||
$sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture_fourn as f";
|
||||
$sql .= " WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = ".((int) $invoice->id);
|
||||
$sql .= " AND f.type = 3";
|
||||
} else {
|
||||
$this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter";
|
||||
dol_print_error($this->error);
|
||||
@ -594,15 +594,15 @@ class DiscountAbsolute
|
||||
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
|
||||
|
||||
if ($invoice->element == 'facture' || $invoice->element == 'invoice') {
|
||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture as f';
|
||||
$sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.((int) $invoice->id);
|
||||
$sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE.", ".$invoice::TYPE_SITUATION).')'; // Find discount coming from credit note or excess received
|
||||
$sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture as f";
|
||||
$sql .= " WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = ".((int) $invoice->id);
|
||||
$sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE.", ".$invoice::TYPE_SITUATION).")"; // Find discount coming from credit note or excess received
|
||||
} elseif ($invoice->element == 'invoice_supplier') {
|
||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture_fourn as f';
|
||||
$sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.((int) $invoice->id);
|
||||
$sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE).')'; // Find discount coming from credit note or excess paid
|
||||
$sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture_fourn as f";
|
||||
$sql .= " WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = ".((int) $invoice->id);
|
||||
$sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE).")"; // Find discount coming from credit note or excess paid
|
||||
} else {
|
||||
$this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
|
||||
dol_print_error($this->error);
|
||||
@ -634,13 +634,13 @@ class DiscountAbsolute
|
||||
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
|
||||
|
||||
if ($invoice->element == 'facture' || $invoice->element == 'invoice') {
|
||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc';
|
||||
$sql .= ' WHERE rc.fk_facture IS NULL AND rc.fk_facture_source = '.((int) $invoice->id);
|
||||
$sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc";
|
||||
$sql .= " WHERE rc.fk_facture IS NULL AND rc.fk_facture_source = ".((int) $invoice->id);
|
||||
} elseif ($invoice->element == 'invoice_supplier') {
|
||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||
$sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc';
|
||||
$sql .= ' WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = '.((int) $invoice->id);
|
||||
$sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount";
|
||||
$sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc";
|
||||
$sql .= " WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = ".((int) $invoice->id);
|
||||
} else {
|
||||
$this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
|
||||
dol_print_error($this->error);
|
||||
|
||||
@ -242,9 +242,9 @@ class dolReceiptPrinter extends Printer
|
||||
$error = 0;
|
||||
$line = 0;
|
||||
$obj = array();
|
||||
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
|
||||
$sql .= ' FROM '.$this->db->prefix().'printer_receipt';
|
||||
$sql .= ' WHERE entity = '.$conf->entity;
|
||||
$sql = "SELECT rowid, name, fk_type, fk_profile, parameter";
|
||||
$sql .= " FROM ".$this->db->prefix()."printer_receipt";
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -310,9 +310,9 @@ class dolReceiptPrinter extends Printer
|
||||
$error = 0;
|
||||
$line = 0;
|
||||
$obj = array();
|
||||
$sql = 'SELECT rowid, name, template';
|
||||
$sql .= ' FROM '.$this->db->prefix().'printer_receipt_template';
|
||||
$sql .= ' WHERE entity = '.$conf->entity;
|
||||
$sql = "SELECT rowid, name, template";
|
||||
$sql .= " FROM ".$this->db->prefix()."printer_receipt_template";
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -873,10 +873,10 @@ class dolReceiptPrinter extends Printer
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'SELECT template';
|
||||
$sql .= ' FROM '.$this->db->prefix().'printer_receipt_template';
|
||||
$sql .= ' WHERE rowid = '.((int) $templateid);
|
||||
$sql .= ' AND entity = '.$conf->entity;
|
||||
$sql = "SELECT template";
|
||||
$sql .= " FROM ".$this->db->prefix()."printer_receipt_template";
|
||||
$sql .= " WHERE rowid = ".((int) $templateid);
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_array($resql);
|
||||
@ -910,10 +910,10 @@ class dolReceiptPrinter extends Printer
|
||||
return;
|
||||
}
|
||||
$error = 0;
|
||||
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
|
||||
$sql .= ' FROM '.$this->db->prefix().'printer_receipt';
|
||||
$sql .= ' WHERE rowid = '.((int) $printerid);
|
||||
$sql .= ' AND entity = '.((int) $conf->entity);
|
||||
$sql = "SELECT rowid, name, fk_type, fk_profile, parameter";
|
||||
$sql .= " FROM ".$this->db->prefix()."printer_receipt";
|
||||
$sql .= " WHERE rowid = ".((int) $printerid);
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_array($resql);
|
||||
|
||||
@ -347,9 +347,9 @@ class EmailSenderProfile extends CommonObject
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT rowid, date_creation as datec, tms as datem';
|
||||
$sql .= ' FROM '.$this->db->prefix().$this->table_element.' as t';
|
||||
$sql .= ' WHERE t.rowid = '.((int) $id);
|
||||
$sql = "SELECT rowid, date_creation as datec, tms as datem";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
if ($this->db->num_rows($result)) {
|
||||
|
||||
@ -414,10 +414,10 @@ class Fiscalyear extends CommonObject
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,';
|
||||
$sql .= ' fy.tms';
|
||||
$sql .= ' FROM '.$this->db->prefix().'accounting_fiscalyear as fy';
|
||||
$sql .= ' WHERE fy.rowid = '.((int) $id);
|
||||
$sql = "SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,";
|
||||
$sql .= " fy.tms";
|
||||
$sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear as fy";
|
||||
$sql .= " WHERE fy.rowid = ".((int) $id);
|
||||
|
||||
dol_syslog(get_class($this)."::fetch info", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -307,7 +307,7 @@ class FormAccounting extends Form
|
||||
// phpcs:enable
|
||||
$options = array();
|
||||
|
||||
$sql = 'SELECT DISTINCT import_key from '.$this->db->prefix().'accounting_bookkeeping';
|
||||
$sql = "SELECT DISTINCT import_key FROM ".$this->db->prefix()."accounting_bookkeeping";
|
||||
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
|
||||
$sql .= ' ORDER BY import_key DESC';
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class FormContract
|
||||
public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db, $user, $conf, $langs;
|
||||
global $user, $conf, $langs;
|
||||
|
||||
$hideunselectables = false;
|
||||
if (!empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) {
|
||||
@ -72,9 +72,9 @@ class FormContract
|
||||
}
|
||||
|
||||
// Search all contacts
|
||||
$sql = 'SELECT c.rowid, c.ref, c.fk_soc, c.statut,';
|
||||
$sql .= ' c.ref_customer, c.ref_supplier';
|
||||
$sql .= ' FROM '.$this->db->prefix().'contrat as c';
|
||||
$sql = "SELECT c.rowid, c.ref, c.fk_soc, c.statut,";
|
||||
$sql .= " c.ref_customer, c.ref_supplier";
|
||||
$sql .= " FROM ".$this->db->prefix()."contrat as c";
|
||||
$sql .= " WHERE c.entity = ".$conf->entity;
|
||||
//if ($contratListId) $sql.= " AND c.rowid IN (".$this->db->sanitize($contratListId).")";
|
||||
if ($socid > 0) {
|
||||
|
||||
@ -64,15 +64,15 @@ class FormIntervention
|
||||
public function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1, $draftonly = false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db, $user, $conf, $langs;
|
||||
global $user, $conf, $langs;
|
||||
|
||||
$out = '';
|
||||
|
||||
$hideunselectables = false;
|
||||
|
||||
// Search all contacts
|
||||
$sql = 'SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut';
|
||||
$sql .= ' FROM '.$this->db->prefix().'fichinter as f';
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut";
|
||||
$sql .= " FROM ".$this->db->prefix()."fichinter as f";
|
||||
$sql .= " WHERE f.entity = ".$conf->entity;
|
||||
if ($socid != '') {
|
||||
if ($socid == '0') {
|
||||
|
||||
@ -602,9 +602,9 @@ class FormMail extends Form
|
||||
}
|
||||
|
||||
// Add also email aliases from the c_email_senderprofile table
|
||||
$sql = 'SELECT rowid, label, email FROM '.$this->db->prefix().'c_email_senderprofile';
|
||||
$sql .= ' WHERE active = 1 AND (private = 0 OR private = '.((int) $user->id).')';
|
||||
$sql .= ' ORDER BY position';
|
||||
$sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile";
|
||||
$sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")";
|
||||
$sql .= " ORDER BY position";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
@ -164,8 +164,8 @@ class FormProjets
|
||||
}
|
||||
|
||||
// Search all projects
|
||||
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias';
|
||||
$sql .= ' FROM '.$this->db->prefix().'projet as p LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias";
|
||||
$sql .= " FROM ".$this->db->prefix()."projet as p LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||
if ($projectsListId !== false) {
|
||||
$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
|
||||
@ -338,12 +338,12 @@ class FormProjets
|
||||
}
|
||||
|
||||
// Search all projects
|
||||
$sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,';
|
||||
$sql .= ' p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,';
|
||||
$sql .= ' s.nom as name';
|
||||
$sql .= ' FROM '.$this->db->prefix().'projet as p';
|
||||
$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
|
||||
$sql .= ' '.$this->db->prefix().'projet_task as t';
|
||||
$sql = "SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,";
|
||||
$sql .= " p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,";
|
||||
$sql .= " s.nom as name";
|
||||
$sql .= " FROM ".$this->db->prefix()."projet as p";
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc,";
|
||||
$sql .= " ".$this->db->prefix()."projet_task as t";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||
$sql .= " AND t.fk_projet = p.rowid";
|
||||
if ($projectsListId) {
|
||||
@ -566,7 +566,7 @@ class FormProjets
|
||||
$sql = "SELECT t.rowid, t.ref";
|
||||
break;
|
||||
case 'stock_mouvement':
|
||||
$sql = 'SELECT t.rowid, t.label as ref';
|
||||
$sql = "SELECT t.rowid, t.label as ref";
|
||||
$projectkey = 'fk_origin';
|
||||
break;
|
||||
case "payment_salary":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user