diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index f552382bcce..2cf3c120af6 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -346,7 +346,7 @@ if ($object->id > 0)
print '
';
if ($action == 'editmode')
{
- $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
+ $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id', 'CRDT');
}
else
{
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 879fcc3f5e2..be5494fbb75 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2098,7 +2098,7 @@ if ($action == 'create')
print '';
print ' | ';
if (! empty($object->brouillon) && $action == 'editmode' && $usercancreate) {
- $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
+ $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 81e0d345229..0b0348ee5e0 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2190,7 +2190,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
print ' | ';
if ($action == 'editmode') {
- $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
+ $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 6e701662f07..242ec5d1465 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -2025,10 +2025,10 @@ class FactureFournisseur extends CommonInvoice
$sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut, f.type, f.paye, pf.fk_paiementfourn";
$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."facture_fourn as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_statut in (".self::STATUS_VALIDATED.",".self::STATUS_CLOSED.")";
- $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement
+ $sql.= " AND NOT EXISTS (SELECT rowid from ".MAIN_DB_PREFIX."facture_fourn as ff WHERE f.rowid = ff.fk_facture_source";
+ $sql.= " AND ff.type=".self::TYPE_REPLACEMENT.")";
$sql.= " AND f.type != ".self::TYPE_CREDIT_NOTE; // Type non 2 si facture non avoir
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
$sql.= " ORDER BY f.ref";
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 590bf14949e..f018b9574d1 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -517,6 +517,7 @@ if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ;
if ($search_billed != '' && $search_billed >= 0) $sql .= " AND cf.billed = ".$db->escape($search_billed);
+if ($search_product_category > 0) $sql.= " AND cp.fk_categorie = ".$search_product_category;
//Required triple check because statut=0 means draft filter
if (GETPOST('statut', 'intcomma') !== '')
|