From 1daba56bbc665f666bad0af7a56dca80cfd68fc8 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Mon, 9 Jul 2018 10:05:53 +0200 Subject: [PATCH 1/5] Fix count(): Parameter must be an array or an object that implements Countable --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 381c3e7cc28..e178bcdd468 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1243,7 +1243,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); - $nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ... + $nextindextouse=is_array($colorindexused)?count($colorindexused):0; // At first run this is 0, so fist user has 0, next 1, ... //print $nextindextouse; foreach ($eventarray as $daykey => $notused) From 1e986bc39a54f73d336ff8e5da0e98e13905690c Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Fri, 20 Jul 2018 11:49:38 +0200 Subject: [PATCH 2/5] Fix: Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) --- htdocs/core/class/html.form.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f782da206da..4efedc2544e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3231,21 +3231,21 @@ class Form if ($resql && $this->db->num_rows($resql) > 0) { // Last seen cycle $ref = 0; - while ($res = $this->db->fetch_array($resql, MYSQL_NUM)) { + while ($obj = $this->db->fetch_object($resql)){ //Same company ? - if ($socid == $res[5]) { + if ($socid == $obj->fk_soc) { //Same cycle ? - if ($res[2] != $ref) { + if ($obj->situation_cycle_ref != $ref) { // Just seen this cycle - $ref = $res[2]; + $ref = $obj->situation_cycle_ref; //not final ? - if ($res[4] != 1) { + if ($obj->situation_final != 1) { //Not prov? - if (substr($res[1], 1, 4) != 'PROV') { - if ($selected == $res[0]) { - $opt .= ''; + if (substr($obj->facnumber, 1, 4) != 'PROV') { + if ($selected == $obj->situation_final) { + $opt .= ''; } else { - $opt .= ''; + $opt .= ''; } } } From d582f72bd95fd290b2ab1efa8fb0b29b74d003d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 22 Jul 2018 17:27:02 +0200 Subject: [PATCH 3/5] __NEXT_MONTH __PREVIOUS_MONTH give day instead month --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0b0f74c1a09..9cbd8562949 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5159,9 +5159,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); - $tmp3=dol_get_prev_month($tmp['mday'], $tmp['mon'], $tmp['year']); + $tmp3=dol_get_prev_month($tmp['mon'], $tmp['year']); $tmp4=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); - $tmp5=dol_get_next_month($tmp['mday'], $tmp['mon'], $tmp['year']); + $tmp5=dol_get_next_month($tmp['mon'], $tmp['year']); } $substitutionarray=array_merge($substitutionarray, array( '__DAY__' => $tmp['mday'], From 4341e367d26e5136b05128a8e95e3a32a5025a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 23 Jul 2018 10:30:28 +0200 Subject: [PATCH 4/5] remove % in supplier order pdf --- htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index b70a299fa03..196d1f0c6a2 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -430,7 +430,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($object->lines[$i]->remise_percent) { $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); - $pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent."%", 0, 'R'); + $pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R'); } // Total HT line From bde30b85ad7a493d9421379dfff3c467b7ac48e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 24 Jul 2018 17:06:12 +0200 Subject: [PATCH 5/5] use defaut currency for supplier order --- htdocs/fourn/commande/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fa1cef8fe0e..7a1d80daa28 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1342,6 +1342,8 @@ if ($action=='create') dol_htmloutput_events(); + $currency_code = $conf->currency; + $societe=''; if ($socid>0) {