diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2f607ad75cf..99dabe02fe2 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -592,7 +592,7 @@ class FactureFournisseur extends CommonInvoice $sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql .= ", ".(double) $this->multicurrency_tx; - $sql .= ", ".(isset($this->fk_facture_source) ? $this->fk_facture_source : "NULL"); + $sql .= ", ".($this->fk_facture_source ? ((int) $this->db->escape($this->fk_facture_source)) : "null"); $sql .= ", ".(isset($this->fk_fac_rec_source) ? $this->fk_fac_rec_source : "NULL"); $sql .= ")"; @@ -1255,7 +1255,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " fk_statut=".(isset($this->status) ? $this->status : (isset($this->statut) ? $this->statut : "null")).","; $sql .= " fk_user_author=".(isset($this->author) ? $this->author : "null").","; $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? $this->fk_user_valid : "null").","; - $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? $this->fk_facture_source : "null").","; + $sql .= " fk_facture_source=".($this->fk_facture_source ? ((int) $this->db->escape($this->fk_facture_source)) : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; $sql .= " date_lim_reglement=".(dol_strlen($this->date_echeance) != 0 ? "'".$this->db->idate($this->date_echeance)."'" : 'null').","; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 603c1b460af..6bc9ae679bb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2337,7 +2337,7 @@ if ($action == 'create') { print '
'; $tmp = 'global->INVOICE_CREDIT_NOTE_STANDALONE)) { $tmp .= ' disabled'; } $tmp .= '> '; @@ -2384,7 +2384,11 @@ if ($action == 'create') { } } else { print '
'; - $tmp = ' '; + if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) { + $tmp = ' '; + } else { + $tmp=' '; + } $text = $tmp.$langs->trans("InvoiceAvoir").' '; $text .= '('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);