diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index c9eaadf93fc..344a52b71da 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -34,6 +34,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; /** * @var Conf $conf @@ -355,7 +356,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { $sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement"; $sql .= " AND f.module_source = '".$db->escape($posmodule)."'"; $sql .= " AND f.pos_source = '".$db->escape($terminalid)."'"; - $sql .= " AND f.paye = 1"; + $sql .= " AND (f.fk_statut = ".Facture::STATUS_VALIDATED." OR f.fk_statut = ".Facture::STATUS_CLOSED.")"; $sql .= " AND p.entity IN (".getEntity('facture').")"; if ($key == 'cash') { $sql .= " AND cp.code = 'LIQ'"; diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 4572ab7380f..be0b776bf9a 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -454,7 +454,8 @@ class MouvementStock extends CommonObject $qtyisnotenough = 0; if (isset($product->stock_warehouse[$entrepot_id])) { foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { - if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c' + // Lot '59' must be different than lot '59c' and also '0123' must be different than '123' + if ((string) $batch !== (string) $batchcursor) { continue; }