Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
This commit is contained in:
commit
1ef0bfac27
@ -497,8 +497,16 @@ abstract class CommonDocGenerator
|
|||||||
$resarray['object_total_up'] = $totalUp;
|
$resarray['object_total_up'] = $totalUp;
|
||||||
$resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs);
|
$resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs);
|
||||||
if (method_exists($object, 'getTotalDiscount')) {
|
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);
|
$resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs);
|
||||||
|
} else {
|
||||||
|
$resarray['object_total_discount']='';
|
||||||
|
$resarray['object_total_discount_locale']='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage suppliers invoices
|
* Class to manage suppliers invoices
|
||||||
|
|||||||
@ -450,6 +450,10 @@ if ($resql)
|
|||||||
if($type == Product::TYPE_SERVICE) $rightskey='service';
|
if($type == Product::TYPE_SERVICE) $rightskey='service';
|
||||||
if($user->rights->{$rightskey}->creer)
|
if($user->rights->{$rightskey}->creer)
|
||||||
{
|
{
|
||||||
|
if ($type === "") {
|
||||||
|
$newcardbutton.= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0');
|
||||||
|
$type = Product::TYPE_SERVICE;
|
||||||
|
}
|
||||||
$label='NewProduct';
|
$label='NewProduct';
|
||||||
if($type == Product::TYPE_SERVICE) $label='NewService';
|
if($type == Product::TYPE_SERVICE) $label='NewService';
|
||||||
$newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type);
|
$newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type);
|
||||||
|
|||||||
@ -149,7 +149,7 @@ if(localStorage.hasKeyboard) {
|
|||||||
function ClearSearch() {
|
function ClearSearch() {
|
||||||
console.log("ClearSearch");
|
console.log("ClearSearch");
|
||||||
$("#search").val('');
|
$("#search").val('');
|
||||||
<?php if ($conf->browser->layer == 'classic') { ?>
|
<?php if ($conf->browser->layout == 'classic') { ?>
|
||||||
setFocusOnSearchField();
|
setFocusOnSearchField();
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
@ -349,6 +349,7 @@ function deleteline() {
|
|||||||
$("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() {
|
$("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() {
|
||||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||||
});
|
});
|
||||||
|
ClearSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
function Customer() {
|
function Customer() {
|
||||||
@ -398,6 +399,7 @@ function New() {
|
|||||||
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
|
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
|
||||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||||
});
|
});
|
||||||
|
ClearSearch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
|
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
|
||||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||||
* Copyright (C) 2018 Regis Houssin <regis.houssin@inodbox.com>
|
* 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
|
* 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
|
* 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)";
|
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.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
|
||||||
$sql.= " WHERE t.entity IN (".getEntity($object->element).")";
|
$sql.= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||||
|
if ($socid > 0)
|
||||||
|
{
|
||||||
|
$sql.= " AND t.fk_soc = ".$socid;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($search as $key => $val)
|
foreach($search as $key => $val)
|
||||||
{
|
{
|
||||||
if ($key == 'fk_statut')
|
if ($key == 'fk_statut')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user