diff --git a/.stickler.yml b/.stickler.yml
index 4f7c7d06c27..b68804448b2 100644
--- a/.stickler.yml
+++ b/.stickler.yml
@@ -7,4 +7,4 @@ linters:
fixer: true
fixers:
- enable: true
\ No newline at end of file
+ enable: true
diff --git a/ChangeLog b/ChangeLog
index 54b40dc0f04..7efaa290bfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,7 +18,7 @@ Following changes may create regressions for some external modules, but were nec
* The function show_theme() hase been renamed into showSkins()
* Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency.
* The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead.
-
+* The hook "moreFamily" must return payment into var "payment" and no more "paiement".
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index bd57005b7bf..2ef4c74f765 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -452,6 +452,7 @@ if ($resql)
if (! empty($arrayfields['owner']['checked'])) print '
';
if (! empty($arrayfields['c.libelle']['checked'])) print ' ';
if (! empty($arrayfields['a.label']['checked'])) print ' ';
+ if (! empty($arrayfields['a.note']['checked'])) print ' ';
if (! empty($arrayfields['a.datep']['checked'])) {
print '';
print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0);
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 9adc0bff336..5b9bf0f9eab 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2500,7 +2500,7 @@ $formquestion = array_merge($formquestion, array(
if ($usercansend) {
print '';
} else
- print '';
+ print '';
}
// Create an order
@@ -2538,7 +2538,14 @@ $formquestion = array_merge($formquestion, array(
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED))
{
- print '';
+ if ($usercanclose)
+ {
+ print '';
+ }
+ else
+ {
+ print '';
+ }
}
}
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index d89eecfed1a..29bc1db3593 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -264,7 +264,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done
}
- $parameters = array('obj' => $obj);
+ $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'payment' => $paiement);
$reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if(empty($reshook)){
$ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref;
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index fadd0c02fde..1df572c8a35 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -497,8 +497,16 @@ abstract class CommonDocGenerator
$resarray['object_total_up'] = $totalUp;
$resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs);
if (method_exists($object, 'getTotalDiscount')) {
- $resarray['object_total_discount'] = round(100 / $totalUp * $object->getTotalDiscount(), 2);
+ $totalDiscount=$object->getTotalDiscount();
+ } else {
+ $totalDiscount=0;
+ }
+ if (!empty($totalUp) && !empty($totalDiscount)) {
+ $resarray['object_total_discount'] = round(100 / $totalUp * $totalDiscount, 2);
$resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs);
+ } else {
+ $resarray['object_total_discount']='';
+ $resarray['object_total_discount_locale']='';
}
}
@@ -766,10 +774,20 @@ abstract class CommonDocGenerator
//Add value to store price with currency
$array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
}
- elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
+ elseif($extrafields->attribute_type[$key] == 'select')
{
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
}
+ elseif($extrafields->attribute_type[$key] == 'checkbox') {
+ $valArray=explode(',', $object->array_options['options_'.$key]);
+ $output=array();
+ foreach($extrafields->attribute_param[$key]['options'] as $keyopt=>$valopt) {
+ if (in_array($keyopt, $valArray)) {
+ $output[]=$valopt;
+ }
+ }
+ $object->array_options['options_'.$key] = implode(', ', $output);
+ }
elseif($extrafields->attribute_type[$key] == 'date')
{
if (strlen($object->array_options['options_'.$key])>0)
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 2e9029a45ab..c7083efc455 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
-$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk"));
+$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks"));
$id = GETPOST('id', 'int');
$action = GETPOST('action', 'alpha');
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index 46cbdd595d9..97355d7c0e2 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -47,6 +47,8 @@ if ($setterminal>0)
$_SESSION["takeposterminal"]=$setterminal;
}
+$_SESSION["urlfrom"]='/takepos/takepos.php';
+
$langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter"));
$categorie = new Categorie($db);
@@ -156,7 +158,7 @@ if(localStorage.hasKeyboard) {
function ClearSearch() {
console.log("ClearSearch");
$("#search").val('');
- browser->layer == 'classic') { ?>
+ browser->layout == 'classic') { ?>
setFocusOnSearchField();
}
@@ -356,6 +358,7 @@ function deleteline() {
$("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
+ ClearSearch();
}
function Customer() {
@@ -405,6 +408,7 @@ function New() {
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
+ ClearSearch();
}
}
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 2a4195cb07b..26b9756006c 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2013-2018 Jean-François FERRY
* Copyright (C) 2016 Christophe Battarel
* Copyright (C) 2018 Regis Houssin
+ * Copyright (C) 2019 Juanjo Menent
*
* 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
@@ -210,6 +211,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
$sql.= " WHERE t.entity IN (".getEntity($object->element).")";
+if ($socid > 0)
+{
+ $sql.= " AND t.fk_soc = ".$socid;
+}
+
foreach($search as $key => $val)
{
if ($key == 'fk_statut')
diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php
index ae3fbfcbf8f..7c1a81b594c 100644
--- a/htdocs/user/logout.php
+++ b/htdocs/user/logout.php
@@ -80,6 +80,7 @@ if (session_status() === PHP_SESSION_ACTIVE)
// Not sure this is required
unset($_SESSION['dol_login']);
unset($_SESSION['dol_entity']);
+unset($_SESSION['urlfrom']);
if (GETPOST('noredirect')) return;
header("Location: ".$url); // Default behaviour is redirect to index.php page