mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Fix CI warnings
This commit is contained in:
@@ -886,9 +886,9 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$sql .= " t.fk_soc,";
|
$sql .= " t.fk_soc,";
|
||||||
$sql .= " t.datec,";
|
$sql .= " t.datec,";
|
||||||
$sql .= " t.datef,";
|
$sql .= " t.datef,";
|
||||||
$sql .= " t.tms,";
|
$sql .= " t.tms as datem,";
|
||||||
$sql .= " t.libelle as label,";
|
$sql .= " t.libelle as label,";
|
||||||
$sql .= " t.paye,";
|
$sql .= " t.paye as paid,";
|
||||||
$sql .= " t.close_code,";
|
$sql .= " t.close_code,";
|
||||||
$sql .= " t.close_note,";
|
$sql .= " t.close_note,";
|
||||||
$sql .= " t.tva,";
|
$sql .= " t.tva,";
|
||||||
@@ -953,14 +953,15 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
|
$this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
|
||||||
$this->subtype = (int) $obj->subtype;
|
$this->subtype = (int) $obj->subtype;
|
||||||
$this->socid = $obj->fk_soc;
|
$this->socid = $obj->fk_soc;
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
|
||||||
$this->date = $this->db->jdate($obj->datef);
|
$this->date = $this->db->jdate($obj->datef);
|
||||||
//$this->datep = $this->db->jdate($obj->datef);
|
$this->date_creation = $this->db->jdate($obj->datec);
|
||||||
$this->tms = $this->db->jdate($obj->tms);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
|
$this->date_modification = $this->db->jdate($obj->datem);
|
||||||
|
$this->tms = $this->db->jdate($obj->datem);
|
||||||
$this->libelle = $obj->label; // deprecated
|
$this->libelle = $obj->label; // deprecated
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->paye = $obj->paye;
|
$this->paye = $obj->paid;
|
||||||
$this->paid = $obj->paye;
|
$this->paid = $obj->paid;
|
||||||
$this->close_code = $obj->close_code;
|
$this->close_code = $obj->close_code;
|
||||||
$this->close_note = $obj->close_note;
|
$this->close_note = $obj->close_note;
|
||||||
$this->total_localtax1 = $obj->localtax1;
|
$this->total_localtax1 = $obj->localtax1;
|
||||||
@@ -1186,11 +1187,11 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->label = trim($this->label);
|
$this->label = trim($this->label);
|
||||||
}
|
}
|
||||||
if (isset($this->paid)) {
|
if (isset($this->paid)) {
|
||||||
$this->paid = (int) (bool) $this->paye;
|
$this->paid = (int) (bool) $this->paid;
|
||||||
$this->paye = $this->paid;
|
$this->paye = $this->paid; // deprecated
|
||||||
} elseif (isset($this->paye)) {
|
} elseif (isset($this->paye)) {
|
||||||
$this->paid = (int) (bool) $this->paye;
|
$this->paid = (int) (bool) $this->paye;
|
||||||
$this->paye = $this->paid;
|
$this->paye = $this->paid; // deprecared
|
||||||
}
|
}
|
||||||
if (isset($this->close_code)) {
|
if (isset($this->close_code)) {
|
||||||
$this->close_code = trim($this->close_code);
|
$this->close_code = trim($this->close_code);
|
||||||
@@ -1268,7 +1269,9 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$sql .= " fk_soc=".(isset($this->socid) ? ((int) $this->socid) : "null").",";
|
$sql .= " fk_soc=".(isset($this->socid) ? ((int) $this->socid) : "null").",";
|
||||||
$sql .= " datec=".(dol_strlen((string) $this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
|
$sql .= " datec=".(dol_strlen((string) $this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
|
||||||
$sql .= " datef=".(dol_strlen((string) $this->date) != 0 ? "'".$this->db->idate($this->date)."'" : 'null').",";
|
$sql .= " datef=".(dol_strlen((string) $this->date) != 0 ? "'".$this->db->idate($this->date)."'" : 'null').",";
|
||||||
if (dol_strlen((string) $this->tms) != 0) {
|
if (dol_strlen((string) $this->date_modification) != 0) {
|
||||||
|
$sql .= " tms=".(dol_strlen((string) $this->date_modification) != 0 ? "'".$this->db->idate($this->date_modification)."'" : 'null').",";
|
||||||
|
} elseif (dol_strlen((string) $this->tms) != 0) { // For backward compatibility
|
||||||
$sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
|
$sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
|
||||||
}
|
}
|
||||||
$sql .= " libelle=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").",";
|
$sql .= " libelle=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").",";
|
||||||
@@ -2647,9 +2650,9 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON f.rowid = ff.fk_facture_source";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON f.rowid = ff.fk_facture_source";
|
||||||
$sql .= " WHERE (f.fk_statut = ".self::STATUS_VALIDATED." OR (f.fk_statut = ".self::STATUS_ABANDONED." AND f.close_code = '".self::CLOSECODE_ABANDONED."'))";
|
$sql .= " WHERE (f.fk_statut = ".self::STATUS_VALIDATED." OR (f.fk_statut = ".self::STATUS_ABANDONED." AND f.close_code = '".self::CLOSECODE_ABANDONED."'))";
|
||||||
$sql .= " AND f.entity = ".$conf->entity;
|
$sql .= " AND f.entity = ".$conf->entity;
|
||||||
$sql .= " AND f.paye = 0"; // Pas classee payee completement
|
$sql .= " AND f.paye = 0"; // Not closed completely
|
||||||
$sql .= " AND pf.fk_paiementfourn IS NULL"; // Aucun paiement deja fait
|
$sql .= " AND pf.fk_paiementfourn IS NULL"; // No payment already done
|
||||||
$sql .= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de replacement
|
$sql .= " AND ff.fk_statut IS NULL"; // Return true (is null) if it is not a replacing invoice (we can't replace a replacing invoice)
|
||||||
if ($socid > 0) {
|
if ($socid > 0) {
|
||||||
$sql .= " AND f.fk_soc = ".((int) $socid);
|
$sql .= " AND f.fk_soc = ".((int) $socid);
|
||||||
}
|
}
|
||||||
@@ -2680,8 +2683,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
* (validated + payment in progress) or classified (paid in full or paid in part) + not already replaced + not already having
|
* (validated + payment in progress) or classified (paid in full or paid in part) + not already replaced + not already having
|
||||||
*
|
*
|
||||||
* @param int $socid Thirdparty id
|
* @param int $socid Thirdparty id
|
||||||
* @return array<int,array{ref:string,status:int,type:int,paye:int<0,1>,paymentornot:int<0,1>}>|int<-1,-1> Table of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
|
* @return array<int,array{ref:string,status:int,type:int,paid:int<0,1>,paye:int<0,1>,paymentornot:int<0,1>}>|int<-1,-1> Table of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) or <0 if error
|
||||||
* <0 if error
|
|
||||||
*/
|
*/
|
||||||
public function list_qualified_avoir_supplier_invoices($socid = 0)
|
public function list_qualified_avoir_supplier_invoices($socid = 0)
|
||||||
{
|
{
|
||||||
@@ -2690,7 +2692,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
||||||
$sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut, f.type, f.subtype, f.paye, pf.fk_paiementfourn";
|
$sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut, f.type, f.subtype, f.paye as paid, pf.fk_paiementfourn";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf ON f.rowid = pf.fk_facturefourn";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf ON f.rowid = pf.fk_facturefourn";
|
||||||
$sql .= " WHERE f.entity = ".$conf->entity;
|
$sql .= " WHERE f.entity = ".$conf->entity;
|
||||||
@@ -2716,7 +2718,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
if ($qualified) {
|
if ($qualified) {
|
||||||
$paymentornot = ($obj->fk_paiementfourn ? 1 : 0);
|
$paymentornot = ($obj->fk_paiementfourn ? 1 : 0);
|
||||||
$return[$obj->rowid] = array('ref' => (string) $obj->ref, 'status' => (int) $obj->fk_statut, 'type' => (int) $obj->type, 'paye' => (int) $obj->paye, 'paymentornot' => (int) $paymentornot);
|
$return[$obj->rowid] = array('ref' => (string) $obj->ref, 'status' => (int) $obj->fk_statut, 'type' => (int) $obj->type, 'paid' => (int) $obj->paid, 'paye' => (int) $obj->paid, 'paymentornot' => (int) $paymentornot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ function getSupplierInvoice($authentication, $id = 0, $ref = '', $ref_ext = '')
|
|||||||
foreach ($invoice->lines as $line) {
|
foreach ($invoice->lines as $line) {
|
||||||
//var_dump($line); exit;
|
//var_dump($line); exit;
|
||||||
$linesresp[] = array(
|
$linesresp[] = array(
|
||||||
'id' => $line->rowid,
|
'id' => $line->id,
|
||||||
'type' => $line->product_type,
|
'type' => $line->product_type,
|
||||||
'total_net' => $line->total_ht,
|
'total_net' => $line->total_ht,
|
||||||
'total_vat' => $line->total_tva,
|
'total_vat' => $line->total_tva,
|
||||||
@@ -310,8 +310,8 @@ function getSupplierInvoice($authentication, $id = 0, $ref = '', $ref_ext = '')
|
|||||||
'total_net' => $invoice->total_ht,
|
'total_net' => $invoice->total_ht,
|
||||||
'total_vat' => $invoice->total_tva,
|
'total_vat' => $invoice->total_tva,
|
||||||
'total' => $invoice->total_ttc,
|
'total' => $invoice->total_ttc,
|
||||||
'date_creation' => dol_print_date($invoice->datec, 'dayhourrfc'),
|
'date_creation' => dol_print_date($invoice->date_creation, 'dayhourrfc'),
|
||||||
'date_modification' => dol_print_date($invoice->datem, 'dayhourrfc'),
|
'date_modification' => dol_print_date($invoice->date_modification, 'dayhourrfc'),
|
||||||
'date_invoice' => dol_print_date($invoice->date, 'dayhourrfc'),
|
'date_invoice' => dol_print_date($invoice->date, 'dayhourrfc'),
|
||||||
'date_term' => dol_print_date($invoice->date_echeance, 'dayhourrfc'),
|
'date_term' => dol_print_date($invoice->date_echeance, 'dayhourrfc'),
|
||||||
'label' => $invoice->label,
|
'label' => $invoice->label,
|
||||||
@@ -436,8 +436,8 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty)
|
|||||||
'total_net' => $invoice->total_ht,
|
'total_net' => $invoice->total_ht,
|
||||||
'total_vat' => $invoice->total_tva,
|
'total_vat' => $invoice->total_tva,
|
||||||
'total' => $invoice->total_ttc,
|
'total' => $invoice->total_ttc,
|
||||||
'date_creation' => dol_print_date($invoice->datec, 'dayhourrfc'),
|
'date_creation' => dol_print_date($invoice->date_creation, 'dayhourrfc'),
|
||||||
'date_modification' => dol_print_date($invoice->datem, 'dayhourrfc'),
|
'date_modification' => dol_print_date($invoice->date_modification, 'dayhourrfc'),
|
||||||
'date_invoice' => dol_print_date($invoice->date, 'dayhourrfc'),
|
'date_invoice' => dol_print_date($invoice->date, 'dayhourrfc'),
|
||||||
'date_term' => dol_print_date($invoice->date_echeance, 'dayhourrfc'),
|
'date_term' => dol_print_date($invoice->date_echeance, 'dayhourrfc'),
|
||||||
'label' => $invoice->label,
|
'label' => $invoice->label,
|
||||||
|
|||||||
Reference in New Issue
Block a user