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

This commit is contained in:
Laurent Destailleur 2019-06-20 03:45:04 +02:00
commit a264a4766a
48 changed files with 963 additions and 94 deletions

View File

@ -11,6 +11,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -2460,8 +2461,8 @@ class Adherent extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Initialise tableau info (tableau des attributs LDAP)
*
* @return array Tableau info des attributs

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -29,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('membersindex'));
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
@ -435,6 +441,9 @@ print "</div>";
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardMembers', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -27,6 +27,7 @@
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "stocks"));
@ -77,6 +78,10 @@ llxHeader('', $langs->trans("StockSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup');
$head = stock_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock');
$form=new Form($db);

View File

@ -4,6 +4,7 @@
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
*
*
* This program is free software; you can redistribute it and/or modify
@ -707,6 +708,66 @@ class Setup extends DolibarrApi
return $list;
}
/**
* Get the list of measuring units.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number (starting from zero)
* @param int $active Payment term is active or not {@min 0} {@max 1}
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
* @return List of events types
*
* @url GET dictionary/units
*
* @throws RestException
*/
public function getListOfMeasuringUnits($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
//TODO link with multicurrency module
$sql = "SELECT t.rowid, t.code, t.label,t.short_label, t.active, t.scale, t.unit_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql.= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(503, 'Error when retrieving list of measuring units: '.$this->db->lasterror());
}
return $list;
}
/**
* Get the list of tickets categories.
*

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -37,6 +38,11 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn
if (! $user->rights->societe->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('commercialindex'));
// Load translation files required by the page
$langs->loadLangs(array("commercial", "propal"));
@ -897,6 +903,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardCommercials', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT .'/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('mailingindex'));
// Load translation files required by the page
$langs->loadLangs(array('commercial', 'orders'));
@ -207,6 +213,9 @@ if ($langs->file_exists("html/spam.html", 0)) {
print '<br>';
}
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardEmailings', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('proposalindex'));
// Load translation files required by the page
$langs->loadLangs(array('propal', 'companies'));
@ -540,6 +546,9 @@ if (! empty($conf->propal->enabled))
//print '</td></tr></table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardPropals', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -162,6 +162,8 @@ $arrayfields=array(
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
'p.total_ht_invoiced'=>array('label'=>$langs->trans("AmountInvoicedHT"), 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
'p.total_invoiced'=>array('label'=>$langs->trans("AmountInvoicedTTC"), 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
@ -644,6 +646,18 @@ if ($resql)
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
print '</td>';
}
if (! empty($arrayfields['p.total_ht_invoiced']['checked']))
{
// Amount invoiced
print '<td class="liste_titre right">';
print '</td>';
}
if (! empty($arrayfields['p.total_invoiced']['checked']))
{
// Amount invoiced
print '<td class="liste_titre right">';
print '</td>';
}
if (! empty($arrayfields['u.login']['checked']))
{
// Author
@ -709,6 +723,8 @@ if ($resql)
if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
// Extra fields
@ -933,6 +949,48 @@ if ($resql)
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
}
// Amount invoiced
if(! empty($arrayfields['p.total_ht_invoiced']['checked'])) {
$totalInvoiced = 0;
$p = new Propal($db);
$TInvoiceData = $p->InvoiceArrayList($obj->rowid);
if(! empty($TInvoiceData)) {
foreach($TInvoiceData as $invoiceData) {
$invoice = new Facture($db);
$invoice->fetch($invoiceData->facid);
if(! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
$totalInvoiced += $invoice->total_ht;
}
}
print '<td class="right">'.price($totalInvoiced)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalhtinvoicedfield']=$totalarray['nbfield'];
$totalarray['totalhtinvoiced'] += $totalInvoiced;
}
// Amount invoiced
if(! empty($arrayfields['p.total_invoiced']['checked'])) {
$totalInvoiced = 0;
$p = new Propal($db);
$TInvoiceData = $p->InvoiceArrayList($obj->rowid);
if(! empty($TInvoiceData)) {
foreach($TInvoiceData as $invoiceData) {
$invoice = new Facture($db);
$invoice->fetch($invoiceData->facid);
if(! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
$totalInvoiced += $invoice->total_ttc;
}
}
print '<td class="right">'.price($totalInvoiced)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalinvoicedfield']=$totalarray['nbfield'];
$totalarray['totalinvoiced'] += $totalInvoiced;
}
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
@ -1059,6 +1117,8 @@ if ($resql)
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
elseif ($totalarray['totalhtinvoicedfield'] == $i) print '<td class="right">'.price($totalarray['totalhtinvoiced']).'</td>';
elseif ($totalarray['totalinvoicedfield'] == $i) print '<td class="right">'.price($totalarray['totalinvoiced']).'</td>';
elseif ($totalarray['totalizable']) {
$printed = false;
foreach ($totalarray['totalizable'] as $totalizable) {

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -31,6 +32,11 @@ require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
if (!$user->rights->commande->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('ordersindex'));
// Load translation files required by the page
$langs->loadLangs(array('orders', 'bills'));
@ -478,6 +484,8 @@ if (! empty($conf->commande->enabled))
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardOrders', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();

View File

@ -3,8 +3,9 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -34,6 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('specialexpensesindex'));
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills'));
@ -568,6 +575,9 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
print '</form>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardSpecialBills', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,10 +2,11 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -63,6 +64,7 @@ if ($user->societe_id > 0)
$max=3;
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('invoiceindex'));
/*
@ -1080,6 +1082,9 @@ if ($resql)
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -9,6 +9,7 @@
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -520,7 +521,7 @@ class Contact extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Initialise tableau info (tableau des attributs LDAP)
*

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -28,6 +29,11 @@ require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('contractindex'));
// Load translation files required by the page
$langs->loadLangs(array('products', 'companies', 'contracts'));
@ -609,6 +615,8 @@ else
//print '</td></tr></table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardContracts', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter();

View File

@ -47,8 +47,8 @@ class Ccountry // extends CommonObject
*/
public $errors = array();
//var $element='ccountry'; //!< Id that identify managed objects
//var $table_element='ccountry'; //!< Name of table without prefix where object is stored
var $element='ccountry'; //!< Id that identify managed objects
var $table_element='c_country'; //!< Name of table without prefix where object is stored
/**
* @var int ID
@ -65,7 +65,9 @@ class Ccountry // extends CommonObject
public $active;
public $fields=array(
'label' => array('type'=>'varchar(250)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>15, 'notnull'=>-1, 'showoncombobox'=>'1')
);
/**

View File

@ -5234,10 +5234,12 @@ class Form
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.
* @param datetime $adddateof Add a link "Date of invoice" using the following date.
* @param string $openinghours Specify hour strat and hour end for the select ex 8,20
* @param int $stepminutes Specify step for minutes between 1 and 30
* @return string Html for selectDate
* @see form_date(), select_month(), select_year(), select_dayofweek()
*/
public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '')
public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1)
{
global $conf,$langs;
@ -5248,6 +5250,7 @@ class Form
if ($m == '') $m=0;
$emptydate=0;
$emptyhours=0;
if ($stepminutes<=0 || $stepminutes>30) $stepminutes = 1;
if ($empty == 1) { $emptydate=1; $emptyhours=1; }
if ($empty == 2) { $emptydate=0; $emptyhours=1; }
$orig_set_time=$set_time;
@ -5468,10 +5471,18 @@ class Form
if ($h)
{
$hourstart = 0;
$hourend = 24;
if ($openinghours != '') {
$openinghours = explode(',', $openinghours);
$hourstart = $openinghours[0];
$hourend = $openinghours[1];
if ($hourend<$hourstart) $hourend = $hourstart;
}
// Show hour
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++)
for ($hour = $hourstart; $hour < $hourend; $hour++)
{
if (strlen($hour) < 2) $hour = "0" . $hour;
$retstring.='<option value="'.$hour.'"'.(($hour == $shour)?' selected':'').'>'.$hour.(empty($conf->dol_optimize_smallscreen)?'':'H').'</option>';
@ -5485,7 +5496,7 @@ class Form
// Show minutes
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">';
if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++)
for ($min = 0; $min < 60 ; $min+=$stepminutes)
{
if (strlen($min) < 2) $min = "0" . $min;
$retstring.='<option value="'.$min.'"'.(($min == $smin)?' selected':'').'>'.$min.(empty($conf->dol_optimize_smallscreen)?'':'').'</option>';

View File

@ -78,3 +78,36 @@ function stock_prepare_head($object)
return $head;
}
/**
* Return array head with list of tabs to view object informations.
*
* @return array head array with tabs
*/
function stock_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/stock.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin');
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin', 'remove');
return $head;
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -26,6 +27,11 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('donationindex'));
$langs->load("donations");
// Security check
@ -238,6 +244,8 @@ else dol_print_error($db);
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardDonation', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -27,6 +28,11 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('sendingindex'));
// Load translation files required by the page
$langs->loadLangs(array('orders', 'sendings'));
@ -291,6 +297,9 @@ else dol_print_error($db);
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardWarehouseSendings', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -3,7 +3,8 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -30,6 +31,11 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('expensereportindex'));
// Load translation files required by the page
$langs->loadLangs(array('companies', 'users', 'trips'));
@ -230,6 +236,9 @@ else dol_print_error($db);
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardExpenseReport', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,8 +2,8 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -32,6 +32,11 @@ require_once DOL_DOCUMENT_ROOT .'/fichinter/class/fichinter.class.php';
if (!$user->rights->ficheinter->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('interventionindex'));
// Load translation files required by the page
$langs->load("interventions");
@ -356,6 +361,8 @@ if (! empty($conf->ficheinter->enabled))
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardInterventions', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter();

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Vinicius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Vinicius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -34,6 +35,11 @@ $orderid = GETPOST('orderid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('orderssuppliersindex'));
// Load translation files required by the page
$langs->loadLangs(array("suppliers", "orders"));
@ -432,6 +438,9 @@ print "</table><br>";
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardOrdersSuppliers', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -1133,7 +1133,6 @@ if ($resql)
print "</form>\n";
/*
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
@ -1145,8 +1144,7 @@ if ($resql)
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->creer;
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
*/
print $formfile->showdocuments('massfilesarea_supplier_invoice','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
}
else
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -36,6 +37,9 @@ if ($conf->deplacement->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/deplace
if ($conf->expensereport->enabled) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$hookmanager = new HookManager($db);
$hookmanager->initHooks('hrmindex');
// Load translation files required by the page
$langs->loadLangs(array('users', 'holidays', 'trips', 'boxes'));
@ -393,6 +397,10 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
print '</div></div></div>';
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardHRM', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -0,0 +1,15 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 11.0.0 or higher.
create table llx_entrepot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_entrepot_extrafields ADD INDEX idx_entrepot_extrafields (fk_object);

View File

@ -0,0 +1,20 @@
-- ===================================================================
-- Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_entrepot_extrafields ADD INDEX idx_entrepot_extrafields (fk_object);

View File

@ -0,0 +1,26 @@
-- ========================================================================
-- Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ========================================================================
create table llx_entrepot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -106,6 +106,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_email
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectoraction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectorfilter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expensereport FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@ -67,4 +67,5 @@ ValidateAndClose=Validate and close
Terminal=Terminal
NumberOfTerminals=Number of Terminals
TerminalSelect=Select terminal you want to use:
POSTicket=POS Ticket
POSTicket=POS Ticket
BasicPhoneLayout=Use basic layout for phones

View File

@ -347,6 +347,8 @@ PriceUTTC=P.U TTC
Amount=Montant
AmountInvoice=Montant facture
AmountInvoiced=Montant facturé
AmountInvoicedHT=Montant HT facturé
AmountInvoicedTTC=Montant TTC facturé
AmountPayment=Montant paiement
AmountHTShort=Montant HT
AmountTTCShort=Montant TTC

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -27,6 +28,11 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('mrpindex'));
// Load translation files required by the page
$langs->loadLangs(array("companies","mrp"));
@ -122,6 +128,9 @@ else
print '</div></div></div>';
$parameters = array('type' => $type, 'user' => $user);
$reshook = $hookmanager->executeHooks('dashboardMRP', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -32,6 +33,12 @@ if (!$user->rights->opensurvey->read) accessforbidden();
* View
*/
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('opensurveyindex'));
// Load translation files required by the page
$langs->load("opensurvey");
@ -78,6 +85,9 @@ print '</table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardOpenSurvey', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -0,0 +1,116 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/product/admin/stock_extrafields.php
* \ingroup stock
* \brief Page to setup extra fields of third party
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'admin', 'stocks'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$tmptype2label=ExtraFields::$type2label;
$type2label=array('');
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->transnoentitiesnoconv($val);
$action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha');
$elementtype='entrepot'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) accessforbidden();
/*
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
/*
* View
*/
$textobject=$langs->transnoentitiesnoconv("Warehouses");
llxHeader('', $langs->trans("StockSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup');
$head = stock_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Warehouses"), -1, 'stock');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit')
{
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
print "</div>";
}
/* ************************************************************************** */
/* */
/* Creation of an optional field */
/* */
/* ************************************************************************** */
if ($action == 'create')
{
print "<br>";
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
/* ************************************************************************** */
/* */
/* Edition of an optional field */
/* */
/* ************************************************************************** */
if ($action == 'edit' && ! empty($attrname))
{
print "<br>";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
llxFooter();
$db->close();

View File

@ -6,6 +6,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Pierre Ardoin <mapiolca@me.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -397,6 +398,9 @@ if (! empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM))
print '</div></div></div>';
$parameters = array('type' => $type, 'user' => $user);
$reshook = $hookmanager->executeHooks('dashboardProductsServices', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -56,6 +56,7 @@ $search_barcode=GETPOST("search_barcode", 'alpha');
$search_label=GETPOST("search_label", 'alpha');
$search_type = GETPOST("search_type", 'int');
$search_sale = GETPOST("search_sale", 'int');
$search_vatrate=GETPOST("search_vatrate", 'alpha');
$search_categ = GETPOST("search_categ", 'int');
$search_tosell = GETPOST("search_tosell", 'int');
$search_tobuy = GETPOST("search_tobuy", 'int');
@ -174,7 +175,8 @@ $arrayfields=array(
'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.tva_tx'=>array('label'=>$langs->trans("VATRate"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
@ -229,6 +231,7 @@ if (empty($reshook))
$search_categ=0;
$search_tosell="";
$search_tobuy="";
$search_vatrate="";
$search_tobatch='';
//$search_type=''; // There is 2 types of list: a list of product and a list of services. No list with both. So when we clear search criteria, we must keep the filter on type.
@ -276,7 +279,7 @@ else
$texte = $langs->trans("ProductsAndServices");
}
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,';
$sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
$sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,';
$sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp, p.stock,';
@ -323,6 +326,7 @@ if ($search_label) $sql .= natural_search('p.label', $search_label);
if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode);
if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell);
if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy);
if ($search_vatrate) $sql .= natural_search('p.tva_tx', $search_vatrate);
if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
@ -341,7 +345,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type,";
$sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
$sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp, p.stock,';
$sql.= ' p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.width, p.width_units, p.height, p.height_units';
@ -421,6 +425,7 @@ if ($resql)
if ($search_label) $param.="&search_label=".urlencode($search_label);
if ($search_tosell != '') $param.="&search_tosell=".urlencode($search_tosell);
if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy);
if ($search_vatrate) $sql .= natural_search('p.tva_tx', $search_vatrate);
if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:"");
if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):"");
if ($show_childproducts) $param.=($show_childproducts?"&search_show_childproducts=".urlencode($show_childproducts):"");
@ -613,6 +618,13 @@ if ($resql)
print '&nbsp;';
print '</td>';
}
// Sell price
if (! empty($arrayfields['p.tva_tx']['checked']))
{
print '<td class="liste_titre right">';
print '<input class="right flat maxwidth50" placeholder="%" type="text" name="search_vatrate" size="1" value="'.dol_escape_htmltag($search_vatrate).'">';
print '</td>';
}
// WAP
if (! empty($arrayfields['p.pmp']['checked']))
{
@ -715,6 +727,9 @@ if ($resql)
if (! empty($arrayfields['p.numbuyprice']['checked'])) {
print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
if (! empty($arrayfields['p.tva_tx']['checked'])) {
print_liste_field_titre($arrayfields['p.tva_tx']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
if (! empty($arrayfields['p.pmp']['checked'])) {
print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
@ -983,6 +998,15 @@ if ($resql)
print '</td>';
}
// Sell Tax Rate
if (! empty($arrayfields['p.tva_tx']['checked']))
{
print '<td class="right">';
print vatrate($obj->tva_tx,true);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// WAP
if (! empty($arrayfields['p.pmp']['checked']))
{

View File

@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'companies', 'categories'));
@ -55,16 +56,32 @@ $backtopage=GETPOST('backtopage', 'alpha');
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
$result=restrictedArea($user, 'stock');
$object = new Entrepot($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('entrepot');
// Load object
if ($id > 0 || ! empty($ref)) {
$ret = $object->fetch($id, $ref);
// if ($ret > 0)
// $ret = $object->fetch_thirdparty();
if ($ret <= 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('warehousecard','globalcard'));
$object = new Entrepot($db);
/*
* Actions
*/
$error = 0;
$usercanread = (($user->rights->stock->lire));
$usercancreate = (($user->rights->stock->creer));
$usercandelete = (($user->rights->stock->supprimer));
@ -85,27 +102,30 @@ if ($action == 'add' && $user->rights->stock->creer)
if (! empty($object->libelle))
{
$id = $object->create($user);
if ($id > 0)
{
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error++;
$action = 'create';
}
if (! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
else
{
header("Location: card.php?id=".$id);
exit;
}
}
else
{
$action = 'create';
setEventMessages($object->error, $object->errors, 'errors');
}
if (! $error) {
$id = $object->create($user);
if ($id > 0) {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
if (!empty($backtopage)) {
header("Location: " . $backtopage);
exit;
} else {
header("Location: card.php?id=" . $id);
exit;
}
} else {
$action = 'create';
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
else
{
@ -147,15 +167,21 @@ if ($action == 'update' && $cancel <> $langs->trans("Cancel"))
$object->town = GETPOST("town");
$object->country_id = GETPOST("country_id");
if ( $object->update($id, $user) > 0)
{
$action = '';
}
else
{
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error++;
if (! $error) {
$ret = $object->update($id, $user);
if ($ret < 0) $error++;
}
if ($error) {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
$action = '';
}
}
else
{
@ -163,6 +189,22 @@ if ($action == 'update' && $cancel <> $langs->trans("Cancel"))
setEventMessages($object->error, $object->errors, 'errors');
}
}
elseif ($action == 'update_extras') {
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error) {
$result = $object->insertExtraFields();
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
if ($error) $action = 'edit_extras';
}
if ($cancel == $langs->trans("Cancel"))
{
@ -257,6 +299,9 @@ if ($action == 'create')
print '</select>';
print '</td></tr>';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
print '</table>';
dol_fiche_end();
@ -392,6 +437,9 @@ else
}
print "</td></tr>";
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print "</table>";
print '</div>';
@ -638,6 +686,7 @@ else
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '</td></tr>';
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td>';
print '<select name="statut" class="flat">';
foreach ($object->statuts as $key => $value)
@ -654,6 +703,15 @@ else
print '</select>';
print '</td></tr>';
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'cols'=>3);
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit');
}
print '</table>';
dol_fiche_end();

View File

@ -163,6 +163,19 @@ class Entrepot extends CommonObject
}
}
// Actions on extra fields
if (! $error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
}
if (! $error)
{
$this->db->commit();
@ -199,6 +212,10 @@ class Entrepot extends CommonObject
*/
public function update($id, $user)
{
global $conf;
$error=0;
if (empty($id)) $id = $this->id;
// Check if new parent is already a child of current warehouse
@ -239,13 +256,24 @@ class Entrepot extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
if (! $resql) {
$error++;
$this->errors[]="Error ".$this->db->lasterror();
}
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) {
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
if (!$error) {
$this->db->commit();
return 1;
}
else
{
} else {
$this->db->rollback();
$this->error=$this->db->lasterror();
return -1;
@ -262,6 +290,10 @@ class Entrepot extends CommonObject
*/
public function delete($user, $notrigger = 0)
{
global $conf;
$error = 0;
$this->db->begin();
if (! $error && empty($notrigger))
@ -293,17 +325,30 @@ class Entrepot extends CommonObject
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."entrepot";
$sql.= " WHERE rowid = " . $this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql1=$this->db->query($sql);
if (!$resql1) $error++;
// Update denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql
$sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET stock = (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)";
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql2=$this->db->query($sql);
if (!$resql2) $error++;
if ($resql1 && $resql2)
// Removed extrafields
if (! $error) {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->deleteExtraFields();
if ($result < 0) {
$error++;
$errorflag=-4;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}
}
if (!$error)
{
$this->db->commit();
return 1;
@ -377,6 +422,10 @@ class Entrepot extends CommonObject
$this->town = $obj->town;
$this->country_id = $obj->country_id;
// Retreive all extrafield
// fetch optionals attributes and labels
$this->fetch_optionals();
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$tmp=getCountry($this->country_id, 'all');
$this->country=$tmp['label'];
@ -386,6 +435,7 @@ class Entrepot extends CommonObject
}
else
{
$this->error="Record Not Found";
return 0;
}
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('stockindex'));
// Load translation files required by the page
$langs->loadLangs(array('stocks', 'productbatch'));
@ -184,6 +190,9 @@ if ($resql)
//print '</td></tr></table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardWarehouse', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -49,6 +49,16 @@ $offset = $limit * $page;
$year = strftime("%Y", time());
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Entrepot($db);
$hookmanager->initHooks(array('stocklist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('entrepot');
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'e.ref'=>"Ref",
@ -60,6 +70,16 @@ $fieldstosearchall = array(
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}
/*
* Actions
*/
@ -85,14 +105,19 @@ $warehouse=new Entrepot($db);
$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,";
$sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot_extrafields as ef on (e.rowid = ef.fk_object)";
$sql.= " WHERE e.entity IN (".getEntity('stock').")";
if ($search_ref) $sql.= natural_search("e.ref", $search_ref); // ref
if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label
if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status;
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
$sql.= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent";
$totalnboflines=0;
$result=$db->query($sql);
@ -131,6 +156,9 @@ if ($result)
if ($search_status) $param.="&search_status=".urlencode($search_status);
if ($sall) $param.="&sall=".urlencode($sall);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$newcardbutton='';
if ($user->rights->stock->creer)
{
@ -173,6 +201,9 @@ if ($result)
print '<td class="liste_titre" colspan="3">';
print '</td>';
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
print '<td class="liste_titre right">';
print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1);
print '</td>';
@ -190,7 +221,9 @@ if ($result)
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right ');
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
@ -198,40 +231,55 @@ if ($result)
{
$warehouse=new Entrepot($db);
$var=false;
$totalarray=array();
while ($i < min($num, $limit))
{
$objp = $db->fetch_object($result);
$obj = $db->fetch_object($result);
$warehouse->id = $objp->rowid;
$warehouse->ref = $objp->ref;
$warehouse->label = $objp->ref;
$warehouse->lieu = $objp->lieu;
$warehouse->fk_parent = $objp->fk_parent;
$warehouse->id = $obj->rowid;
$warehouse->ref = $obj->ref;
$warehouse->label = $obj->ref;
$warehouse->lieu = $obj->lieu;
$warehouse->fk_parent = $obj->fk_parent;
print '<tr class="oddeven">';
print '<td>' . $warehouse->getNomUrl(1) . '</td>';
if (! $i) $totalarray['nbfield']++;
// Location
print '<td>'.$objp->lieu.'</td>';
print '<td>'.$obj->lieu.'</td>';
if (! $i) $totalarray['nbfield']++;
// Stock qty
print '<td class="right">'.price2num($objp->stockqty, 5).'</td>';
print '<td class="right">'.price2num($obj->stockqty, 5).'</td>';
if (! $i) $totalarray['nbfield']++;
// PMP value
print '<td class="right">';
if (price2num($objp->estimatedvalue, 'MT')) print price(price2num($objp->estimatedvalue, 'MT'), 1);
if (price2num($obj->estimatedvalue, 'MT')) print price(price2num($obj->estimatedvalue, 'MT'), 1);
else print '';
print '</td>';
if (! $i) $totalarray['nbfield']++;
// Selling value
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($objp->sellvalue, 'MT'), 1);
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($obj->sellvalue, 'MT'), 1);
else
{
$htmltext=$langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Status
print '<td class="right">'.$warehouse->LibStatut($objp->statut, 5).'</td>';
print '<td class="right">'.$warehouse->LibStatut($obj->statut, 5).'</td>';
if (! $i) $totalarray['nbfield']++;
print '<td></td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
@ -255,6 +303,7 @@ if ($result)
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print "</tr>\n";
}
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -39,6 +40,11 @@ if ($user->societe_id > 0) $socid=$user->societe_id;
//$result = restrictedArea($user, 'projet', $projectid);
if (!$user->rights->projet->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('activityindex'));
// Load translation files required by the page
$langs->load("projects");
@ -573,6 +579,9 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardActivities', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -30,6 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('projectsindex'));
// Load translation files required by the page
$langs->loadLangs(array('projects', 'companies'));
@ -320,6 +326,9 @@ if (! empty($conf->global->PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA))
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardProjects', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -28,6 +29,11 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('receptionindex'));
$langs->load("orders");
$langs->load("receptions");
@ -292,6 +298,8 @@ else dol_print_error($db);
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardWarehouseReceptions', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter();
$db->close();

View File

@ -2,9 +2,10 @@
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -29,6 +30,11 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('thirdpartiesindex'));
$langs->load("companies");
$socid = GETPOST('socid', 'int');
@ -366,6 +372,9 @@ else
//print '</td></tr></table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardThirdparties', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -27,6 +28,11 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('suppliersproposalsindex'));
// Load translation files required by the page
$langs->loadLangs(array('supplier_proposal', 'companies'));
@ -375,6 +381,9 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardSupplierProposal', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -73,6 +73,7 @@ if (GETPOST('action', 'alpha') == 'set')
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PHONE_BASIC_LAYOUT", GETPOST('TAKEPOS_PHONE_BASIC_LAYOUT', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
@ -199,6 +200,15 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){
print '</td></tr>';
}
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
{
print '<tr class="oddeven value"><td>';
print $langs->trans("BasicPhoneLayout");
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
print '</td></tr>';
}
print '<tr class="oddeven"><td>';
print $langs->trans('TicketVatGrouped');
print '<td colspan="2">';

View File

@ -44,6 +44,31 @@ $action = GETPOST('action', 'alpha');
$idproduct = GETPOST('idproduct', 'int');
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
if ($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT==1 && $conf->browser->layout == 'phone')
{
// DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED
if ($_SESSION["takeposterminal"]=="")
{
if ($conf->global->TAKEPOS_NUM_TERMINALS=="1") $_SESSION["takeposterminal"]=1;
else
{
header("Location: takepos.php");
exit;
}
}
$mobilepage = GETPOST('mobilepage', 'alpha');
$title='TakePOS - Dolibarr '.DOL_VERSION;
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title='TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head='<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="css/pos.css">
<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>';
}
/**
* Abort invoice creationg with a given error message
*
@ -497,13 +522,88 @@ print $langs->trans('TotalTTC');
print ' : <b>'.price($invoice->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</b></span>';
print '<br>'.$sectionwithinvoicelink;
print '</td>';
print '<td class="linecolqty right">' . $langs->trans('ReductionShort') . '</td>';
print '<td class="linecolqty right">' . $langs->trans('Qty') . '</td>';
print '<td class="linecolht right nowraponall">' . $langs->trans('TotalHTShort') . '</td>';
if ($_SESSION["basiclayout"]!=1)
{
print '<td class="linecolqty right">' . $langs->trans('ReductionShort') . '</td>';
print '<td class="linecolqty right">' . $langs->trans('Qty') . '</td>';
print '<td class="linecolht right nowraponall">' . $langs->trans('TotalHTShort') . '</td>';
}
print "</tr>\n";
if ($_SESSION["basiclayout"]==1)
{
if ($mobilepage=="cats")
{
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categorie = new Categorie($db);
$categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
foreach ($categories as $row){
$htmlforlines.= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines.= '" onclick="location.href=\'invoice.php?mobilepage=products&place=' . $place . '&catid=' . $row['id'] . '\'">';
$htmlforlines.= '<td class="left">';
$htmlforlines.= $row['label'];
$htmlforlines.= '</td>';
$htmlforlines.= '</tr>'."\n";
}
$htmlforlines.= '</table>';
$htmlforlines.= '<div class="tabsAction">';
$htmlforlines.= '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=places&place=' . $place. '">'.$langs->trans("Floors").'</a>';
$htmlforlines.= '</div>';
print $htmlforlines;
}
if ($mobilepage=="products")
{
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$object = new Categorie($db);
$catid = GETPOST('catid', 'int');
$result=$object->fetch($catid);
$prods = $object->getObjectsInCateg("product");
$htmlforlines = '';
foreach ($prods as $row) {
$htmlforlines.= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines.= '" onclick="location.href=\'invoice.php?mobilepage=invoice&action=addline&place=' . $place . '&idproduct=' . $row->id . '\'">';
$htmlforlines.= '<td class="left">';
$htmlforlines.= $row->label;
$htmlforlines.= '</td>';
$htmlforlines.= '</tr>'."\n";
}
$htmlforlines.= '</table>';
$htmlforlines.= '<div class="tabsAction">';
$htmlforlines.= '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=cats&place=' . $place. '">'.$langs->trans("Categories").'</a>';
$htmlforlines.= '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=places&place=' . $place. '">'.$langs->trans("Floors").'</a>';
$htmlforlines.= '</div>';
print $htmlforlines;
}
if ($mobilepage=="places")
{
$sql="SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables";
$resql = $db->query($sql);
$rows = array();
$htmlforlines = '';
while($row = $db->fetch_array($resql)){
$rows[] = $row;
$htmlforlines.= '<tr class="drag drop oddeven posinvoiceline';
$htmlforlines.= '" onclick="location.href=\'invoice.php?mobilepage=invoice&place=' . $row['label'] . '\'">';
$htmlforlines.= '<td class="left">';
$htmlforlines.= $row['label'];
$htmlforlines.= '</td>';
$htmlforlines.= '</tr>'."\n";
}
$htmlforlines.= '</table>';
$htmlforlines.= '<div class="tabsAction">';
$htmlforlines.= '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=cats&place=' . $place. '">'.$langs->trans("Categories").'</a>';
$htmlforlines.= '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=places&place=' . $place. '">'.$langs->trans("Floors").'</a>';
$htmlforlines.= '</div>';
print $htmlforlines;
}
}
if ($placeid > 0)
{
if ($_SESSION["basiclayout"]==1 && $mobilepage!="invoice") return;
if (is_array($invoice->lines) && count($invoice->lines))
{
$tmplines = array_reverse($invoice->lines);
@ -538,11 +638,14 @@ if ($placeid > 0)
}
}
if (!empty($line->array_options['options_order_notes'])) $htmlforlines.= "<br>(".$line->array_options['options_order_notes'].")";
$htmlforlines.= '</td>';
$htmlforlines.= '<td class="right">' . vatrate($line->remise_percent, true) . '</td>';
$htmlforlines.= '<td class="right">' . $line->qty . '</td>';
$htmlforlines.= '<td class="right">' . price($line->total_ttc) . '</td>';
$htmlforlines.= '</tr>'."\n";
if ($_SESSION["basiclayout"]!=1)
{
$htmlforlines.= '</td>';
$htmlforlines.= '<td class="right">' . vatrate($line->remise_percent, true) . '</td>';
$htmlforlines.= '<td class="right">' . $line->qty . '</td>';
$htmlforlines.= '<td class="right">' . price($line->total_ttc) . '</td>';
}
$htmlforlines.= '</tr>'."\n";
print $htmlforlines;
}
@ -558,6 +661,14 @@ else { // No invoice generated yet
print '</table>';
if ($_SESSION["basiclayout"]==1 && $mobilepage=="invoice")
{
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=cats&place=' . $place. '">'.$langs->trans("Categories").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?mobilepage=places&place=' . $place. '">'.$langs->trans("Floors").'</a>';
print '</div>';
}
if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]})
{
$soc = new Societe($db);

View File

@ -57,6 +57,13 @@ if ($conf->browser->layout == 'phone')
{
$maxcategbydefaultforthisdevice=8;
$maxproductbydefaultforthisdevice=16;
//REDIRECT TO BASIC LAYOUT IF TERMINAL SELECTED AND BASIC MOBILE LAYOUT ENABLED
if ($_SESSION["takeposterminal"]!="" && $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT==1)
{
$_SESSION["basiclayout"]=1;
header("Location: invoice.php?mobilepage=invoice");
exit;
}
}
$MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG)?$maxcategbydefaultforthisdevice:$conf->global->TAKEPOS_NB_MAXCATEG);
$MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT)?$maxproductbydefaultforthisdevice:$conf->global->TAKEPOS_NB_MAXPRODUCT);

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) - 2013-2016 Jean-François FERRY <hello@librethic.io>
/* Copyright (C) - 2013-2016 Jean-François FERRY <hello@librethic.io>
* Copyright (C) - 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -26,6 +27,11 @@ require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticketstats.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('ticketsindex'));
// Load translation files required by the page
$langs->loadLangs(array('companies', 'other', 'ticket'));
@ -372,6 +378,9 @@ if ($result) {
print '</div></div></div>';
print '<div style="clear:both"></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardTickets', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter('');
$db->close();

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2005-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@ -286,6 +287,10 @@ if ($canreadperms)
//print '</td></tr></table>';
print '</div></div></div>';
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardUsersGroups', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();