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 diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 190bf676c8a..48b8d089375 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -112,8 +112,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, diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index d9f02781fd5..d65751a4296 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -63,13 +63,13 @@ { print '