From 441a8c4a74462643243c4dea038ce062d7de427c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Jul 2016 18:28:06 +0200 Subject: [PATCH 1/4] FIX Can make a movement on "out of sell" products --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index dc102d8eb05..d6c603332b5 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -61,7 +61,7 @@ $langs->load("productbatch"); { print ''.$langs->trans("Product").''; print ''; - print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':'')); + print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''),20,0,-1); print ''; } print ''; From 2d037eb34eb427f9af13d07a6dbf334f480c7ab0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jul 2016 19:35:00 +0200 Subject: [PATCH 2/4] FIX Direction of movement lost if an error occurs --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index d6c603332b5..3cb8ba47298 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -67,7 +67,7 @@ $langs->load("productbatch"); print ''; print ''; print ''.$langs->trans("NumberOfUnit").''; print ''; From 80354cd8d624491a202603a9cf41861f4502b8d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Jul 2016 18:43:44 +0200 Subject: [PATCH 3/4] FIX Can correct stock of lot using eatby or sell by date --- htdocs/product/stock/mouvement.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index d5deffb2c12..0a979a0add7 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -109,8 +109,12 @@ if ($action == "correct_stock") if ($product->hasbatch()) { $batch=GETPOST('batch_number'); - $eatby=GETPOST('eatby'); - $sellby=GETPOST('sellby'); + + //$eatby=GETPOST('eatby'); + //$sellby=GETPOST('sellby'); + $eatby=dol_mktime(12, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear')); + $sellby=dol_mktime(12, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear')); + $result=$product->correct_stock_batch( $user, $id, From 5bbd8eded902724d6ef939a1bb4a44de58bace63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Jul 2016 18:32:45 +0200 Subject: [PATCH 4/4] Code comment --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 33d6e23c6b3..5c0a5f22391 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -387,8 +387,8 @@ class Facture extends CommonInvoice { $newinvoiceline=$this->lines[$i]; $newinvoiceline->fk_facture=$this->id; - $newinvoiceline->origin = $this->element; - $newinvoiceline->origin_id = $this->lines[$i]->id; + $newinvoiceline->origin = $this->element; // TODO This seems not used. Here we but origin 'facture' but after + $newinvoiceline->origin_id = $this->lines[$i]->id; // we put an id of object ! if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 { // Reset fk_parent_line for no child products and special product