Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
ebc2289292
@ -2747,23 +2747,23 @@ class Form
|
||||
}
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$opt.= price($objp->fprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$outval.= price($objp->fprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$opt.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$outval.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 0, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.=$langs->transnoentities("Unit");
|
||||
}
|
||||
else
|
||||
{
|
||||
$opt.= price($objp->fprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$outval.= price($objp->fprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$opt.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$outval.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$opt.= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.= ' '.$langs->transnoentities("Units");
|
||||
}
|
||||
|
||||
if ($objp->quantity >= 1)
|
||||
{
|
||||
$opt.=" (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.=" (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$opt.=" (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.=" (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
}
|
||||
if ($objp->remise_percent >= 1)
|
||||
{
|
||||
@ -2854,7 +2854,7 @@ class Form
|
||||
$langs->load('stocks');
|
||||
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, pfp.fk_soc,";
|
||||
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,";
|
||||
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
|
||||
$sql.= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
@ -2914,7 +2914,7 @@ class Form
|
||||
}
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$opt.= price($objp->fprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$opt.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
}
|
||||
|
||||
$opt.= $objp->quantity.' ';
|
||||
@ -2930,7 +2930,7 @@ class Form
|
||||
if ($objp->quantity > 1)
|
||||
{
|
||||
$opt.=" - ";
|
||||
$opt.= price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
|
||||
$opt.= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
|
||||
}
|
||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||
$opt .= "</option>\n";
|
||||
|
||||
@ -62,7 +62,9 @@ class FormAdmin
|
||||
public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
if (!empty($conf->global->MAIN_DEFAULT_LANGUAGE_FILTER)) $filter[$conf->global->MAIN_DEFAULT_LANGUAGE_FILTER] = 1;
|
||||
|
||||
$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT, 12);
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -65,6 +65,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
|
||||
}
|
||||
|
||||
$menu_arr = array();
|
||||
// Home
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Home',
|
||||
|
||||
@ -132,6 +132,8 @@ dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
$invoice_status_except_list = array(Facture::STATUS_DRAFT, Facture::STATUS_ABANDONED);
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,";
|
||||
$sql.= " u.rowid as agent, u.login, u.lastname, u.firstname,";
|
||||
@ -153,7 +155,7 @@ if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
|
||||
else
|
||||
$sql .= " AND sc.fk_user = u.rowid";
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
$sql.= " AND f.fk_statut NOT IN (" . implode(', ', $invoice_status_except_list) . ")";
|
||||
$sql.= ' AND s.entity IN ('.getEntity('societe').')';
|
||||
$sql.= " AND d.fk_facture = f.rowid";
|
||||
if ($agentid > 0) {
|
||||
|
||||
@ -183,6 +183,7 @@ dol_fiche_end();
|
||||
$arrayfields=array();
|
||||
$massactionbutton='';
|
||||
|
||||
$invoice_status_except_list = array(Facture::STATUS_DRAFT, Facture::STATUS_ABANDONED);
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql .= " f.ref, f.rowid as invoiceid, d.rowid as invoicedetid, d.buy_price_ht, d.total_ht, d.subprice, d.label, d.description , d.qty";
|
||||
@ -190,7 +191,7 @@ $sql .= " ,d.fk_product";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f ";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as d ON d.fk_facture = f.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON d.fk_product = p.rowid";
|
||||
$sql .= " WHERE f.fk_statut > 0";
|
||||
$sql .= " WHERE f.fk_statut NOT IN (" . implode(', ', $invoice_status_except_list) . ")";
|
||||
$sql .= " AND f.entity IN (" . getEntity('invoice') . ") ";
|
||||
if (! empty($startdate)) $sql .= " AND f.datef >= '" . $db->idate($startdate) . "'";
|
||||
if (! empty($enddate)) $sql .= " AND f.datef <= '" . $db->idate($enddate) . "'";
|
||||
|
||||
@ -200,6 +200,8 @@ dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
$invoice_status_except_list = array(Facture::STATUS_DRAFT, Facture::STATUS_ABANDONED);
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,";
|
||||
if ($client) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,";
|
||||
@ -218,7 +220,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PRE
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
|
||||
if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
$sql.= " AND f.fk_statut NOT IN (" . implode(', ', $invoice_status_except_list) . ")";
|
||||
$sql.= ' AND s.entity IN ('.getEntity('societe').')';
|
||||
$sql.= " AND d.fk_facture = f.rowid";
|
||||
$sql.= " AND (d.product_type = 0 OR d.product_type = 1)";
|
||||
|
||||
@ -174,6 +174,8 @@ dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
$invoice_status_except_list = array(Facture::STATUS_DRAFT, Facture::STATUS_ABANDONED);
|
||||
|
||||
$sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref, p.entity as pentity,";
|
||||
if ($id > 0) $sql.= " d.fk_product,";
|
||||
if ($id > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,";
|
||||
@ -190,7 +192,7 @@ if (! empty($TSelectedCats)) {
|
||||
}
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
$sql.= " AND f.fk_statut NOT IN (" . implode(', ', $invoice_status_except_list) . ")";
|
||||
$sql.= " AND d.fk_facture = f.rowid";
|
||||
if ($id > 0)
|
||||
$sql.= " AND d.fk_product =".$id;
|
||||
|
||||
@ -61,7 +61,7 @@ if (defined('THEME_ONLY_CONSTANT')) return;
|
||||
|
||||
session_cache_limiter('public');
|
||||
|
||||
require_once __DIR__.'/../../main.inc.php'; // __DIR__ allow this script to be included in custom themes
|
||||
require_once '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user