Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	.stickler.yml
	htdocs/takepos/invoice.php
This commit is contained in:
Laurent Destailleur 2019-09-03 17:34:49 +02:00
commit da3d230182
10 changed files with 46 additions and 9 deletions

View File

@ -7,4 +7,4 @@ linters:
fixer: true
fixers:
enable: true
enable: true

View File

@ -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".

View File

@ -452,6 +452,7 @@ if ($resql)
if (! empty($arrayfields['owner']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['c.libelle']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.label']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.'"></td>';
if (! empty($arrayfields['a.note']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.'"></td>';
if (! empty($arrayfields['a.datep']['checked'])) {
print '<td class="liste_titre nowraponall" align="center">';
print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0);

View File

@ -2500,7 +2500,7 @@ $formquestion = array_merge($formquestion, array(
if ($usercansend) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a></div>';
} else
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans('SendMail') . '</a></div>';
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">' . $langs->trans('SendMail') . '</a></div>';
}
// 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 '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=classifybilled&amp;socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
if ($usercanclose)
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=classifybilled&amp;socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">' . $langs->trans("ClassifyBilled") . '</a></div>';
}
}
}

View File

@ -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;

View File

@ -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)

View File

@ -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');

View File

@ -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('');
<?php if ($conf->browser->layer == 'classic') { ?>
<?php if ($conf->browser->layout == 'classic') { ?>
setFocusOnSearchField();
<?php } ?>
}
@ -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();
}
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2018 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
*
* 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')

View File

@ -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