From 6b557fd92f75e4ce8783f2ed647658472e87546a Mon Sep 17 00:00:00 2001 From: fappels Date: Tue, 17 Oct 2017 22:19:45 +0200 Subject: [PATCH 1/7] Fix old batches not displayed in multi warehouse shipping Old batches not available in product_lot table are not shown for shipping from multiple warehouses --- htdocs/expedition/card.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f0aaad677d6..6bd275d94d2 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1212,11 +1212,16 @@ if ($action == 'create') print ''; print ''; - //print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); $productlotObject->fetch(0, $line->fk_product, $dbatch->batch); - print $langs->trans("Batch").': '.$productlotObject->getNomUrl(1); - print ' ('.$dbatch->qty.')'; - //print $langs->trans("DetailBatchFormat", 'ee'.$dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); + if (!empty($productlotObject->batch)) + { + print $langs->trans("Batch").': '.$productlotObject->getNomUrl(1); + print ' ('.$dbatch->qty.')'; + } + else + { + print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); + } $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) { From 3793ae323a8bf3ad7521cd272db6f3e8ba2d3f23 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 19 Oct 2017 09:46:19 +0200 Subject: [PATCH 2/7] FIX : wrong personnal project time spent --- htdocs/core/lib/project.lib.php | 2 +- htdocs/projet/class/task.class.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index fa3967284d9..b70e037cbf4 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -762,7 +762,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ // Time spent by user print ''; - $tmptimespent=$taskstatic->getSummaryOfTimeSpent(); + $tmptimespent=$taskstatic->getSummaryOfTimeSpent('', $fuser->id); if ($tmptimespent['total_duration']) print convertSecondToTime($tmptimespent['total_duration'],'allhourmin'); else print '--:--'; print "\n"; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ca8ed73e10d..ae257d6eff4 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -911,9 +911,10 @@ class Task extends CommonObject * Calculate total of time spent for task * * @param int $id Id of object (here task) + * @param int $user_id Filter on user time * @return array Array of info for task array('min_date', 'max_date', 'total_duration') */ - function getSummaryOfTimeSpent($id='') + function getSummaryOfTimeSpent($id='', $user_id='') { global $langs; @@ -927,6 +928,7 @@ class Task extends CommonObject $sql.= " SUM(t.task_duration) as total_duration"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql.= " WHERE t.fk_task = ".$id; + if(!empty($user_id)) $sql.= " AND t.fk_user = ".$user_id; dol_syslog(get_class($this)."::getSummaryOfTimeSpent", LOG_DEBUG); $resql=$this->db->query($sql); From 75580f253e93898c49ff8635bf23741fb5ac02a5 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 20 Oct 2017 12:57:32 +0200 Subject: [PATCH 3/7] FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart --- htdocs/comm/action/class/actioncomm.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 375365eaf41..c111b8861a6 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2,8 +2,8 @@ /* Copyright (C) 2002-2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2015 Marcos García + * Copyright (C) 2011-2017 Juanjo Menent + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1255,6 +1255,7 @@ class ActionComm extends CommonObject { // Note: Output of sql request is encoded in $conf->file->character_set_client // This assignment in condition is not a bug. It allows walking the results. + $diff = 0; while ($obj=$this->db->fetch_object($resql)) { $qualified=true; @@ -1289,8 +1290,9 @@ class ActionComm extends CommonObject if ($qualified && $datestart) { - $eventarray[$datestart]=$event; + $eventarray[$datestart+$diff]=$event; } + $diff++; } } else From eaafe83ae4d55799c6744284f1e63e44d088f73a Mon Sep 17 00:00:00 2001 From: fappels Date: Tue, 24 Oct 2017 16:05:41 +0200 Subject: [PATCH 4/7] Only show old batch number and qty --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6bd275d94d2..37aed77bce6 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1220,7 +1220,7 @@ if ($action == 'create') } else { - print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); + print $dbatch->batch.' ('.$dbatch->qty.')'; } $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) From 78e3c63eade6c0391daccfa7d1d7779f1e07e2d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Oct 2017 02:26:37 +0200 Subject: [PATCH 5/7] Update card.php --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 37aed77bce6..2dabf0dc3c4 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1218,9 +1218,9 @@ if ($action == 'create') print $langs->trans("Batch").': '.$productlotObject->getNomUrl(1); print ' ('.$dbatch->qty.')'; } - else + else // When lot not found in lot table (this can happen with old record) { - print $dbatch->batch.' ('.$dbatch->qty.')'; + print $langs->trans("Batch").': '.$dbatch->batch.' ('.$dbatch->qty.')'; } $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) From bc8127d68597d6db1702687f2208260da29ab132 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 27 Oct 2017 11:52:05 +0200 Subject: [PATCH 6/7] Fix: paid supplier invoices are shown as abandoned on the consumption card. --- htdocs/societe/consumption.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index c5e9d45c53e..b686c08f579 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2013-2015 Juanjo Menent * Copyright (C) 2015 Marcos García - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -245,7 +245,7 @@ if ($type_element == 'supplier_invoice') { // Supplier : Show products from invoices. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $documentstatic=new FactureFournisseur($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; $tables_from = MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."facture_fourn_det as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_facture_fourn = f.rowid"; From 7c1d6251f7acc38c3a7b5b82eacfd8e4eb191467 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 27 Oct 2017 13:27:38 +0200 Subject: [PATCH 7/7] Fix : contract lines from origin were containing all lines desc --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 322220c5d4f..2409056cb1f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -327,7 +327,7 @@ if (empty($reshook)) $label = $lines[$i]->product_label; } - $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; + $desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; } else { $desc = dol_htmlentitiesbr($lines[$i]->desc);