Merge branch 'develop' into patch-25
This commit is contained in:
commit
6b3826cbb8
31
ChangeLog
31
ChangeLog
@ -26,6 +26,34 @@ Following changes may create regressions for some external modules, but were nec
|
||||
by a "_" automatically when a reference (with a custom numbering mask that use it) is generated.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 11.0.3 compared to 11.0.2 *****
|
||||
FIX: unit price for selected supplier products not set. NaN was used.
|
||||
FIX: use bad var to check if total is positive for each VAT rate when validating an invoice
|
||||
FIX: status missing from last customer invoices box when using MAIN_STATUS_USES_CSS
|
||||
FIX: translations for "orders" not loaded in the homepage box
|
||||
FIX: #13194
|
||||
FIX: #13274 cannot add or update 0 value for an int or double extrafield
|
||||
FIX: #13285 SQL error during migration with pgsql
|
||||
FIX: #13294
|
||||
FIX: #13313
|
||||
FIX: Clone Fourn Command, add line's extrafields
|
||||
FIX: cols parameter not propagated to tpl
|
||||
FIX: CSRF error when creating an intervention
|
||||
FIX: date order was -1D and desc with label repetition
|
||||
FIX: empty of series in graph of product distribution
|
||||
FIX: fk_type subscription list via api REST
|
||||
FIX: link when using anchor on "/" in website module
|
||||
FIX: menu export document was not visible when using "simple accounting"
|
||||
FIX: missing class declaration
|
||||
FIX: missing global $conf
|
||||
FIX: Missing token in some forms (avoid unset POST errors)
|
||||
FIX: params of setEventMessage($langs->trans('ErrorProductClone')...
|
||||
FIX: Remove unexisting link
|
||||
FIX: substitute lines dates values on doc generator (ODT, ...)
|
||||
FIX: Ticket - Load Cache Messages Ticket, wrong message's status
|
||||
FIX: Ticket Public - Private messages are displayed
|
||||
|
||||
***** ChangeLog for 11.0.2 compared to 11.0.1 *****
|
||||
FIX: #10309
|
||||
FIX: #13110
|
||||
@ -33,7 +61,8 @@ FIX: #13118
|
||||
FIX: #13124
|
||||
FIX: #13131
|
||||
FIX: #13135
|
||||
FIX: #13146 #13198
|
||||
FIX: #13146
|
||||
FIX: #13198
|
||||
FIX: #13175
|
||||
FIX: #13182
|
||||
FIX: #13183
|
||||
|
||||
@ -54,5 +54,5 @@ fi
|
||||
|
||||
echo Think to launch also:
|
||||
echo "> dev/tools/fixaltlanguages.sh fix all"
|
||||
echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with ''"
|
||||
echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with '' on *.lang files"
|
||||
|
||||
|
||||
@ -10,7 +10,11 @@
|
||||
https://github.com/Dolibarr/foundation
|
||||
|
||||
|
||||
* Few icons are from http://led24.de/iconset/. This is original README file for this source:
|
||||
* Few icons are / were from website led24.de
|
||||
|
||||
* Attention: This website is no longer available!
|
||||
|
||||
This is original README file for this source:
|
||||
-------------------------------------------------------
|
||||
You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to
|
||||
http://led24.de/iconset/ or http://led24.de/ would be appreciated.
|
||||
|
||||
@ -70,11 +70,11 @@ $arrayfields = array(
|
||||
'aa.labelshort'=>array('label'=>$langs->trans("LabelToShow"), 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.reconciliable'=>array('label'=>$langs->trans("Reconciliable"), 'checked'=>1),
|
||||
'aa.reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1),
|
||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||
);
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['aa.reconciliable']);
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['aa.reconcilable']);
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
@ -197,7 +197,7 @@ if ($action == 'delete') {
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent , aa.label, aa.labelshort, aa.reconciliable, aa.active, ";
|
||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent , aa.label, aa.labelshort, aa.reconcilable, aa.active, ";
|
||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".$conf->entity;
|
||||
@ -357,7 +357,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconciliable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
||||
@ -371,7 +371,7 @@ if ($resql)
|
||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
|
||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help']);
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconciliable']['checked'])) print_liste_field_titre($arrayfields['aa.reconciliable']['label'], $_SERVER["PHP_SELF"], 'aa.reconciliable', '', $param, '', $sortfield, $sortorder); }
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconcilable']['checked'])) print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder); }
|
||||
if (!empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
@ -450,9 +450,9 @@ if ($resql)
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
// Activated or not reconciliation on accounting account
|
||||
if (!empty($arrayfields['aa.reconciliable']['checked'])) {
|
||||
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (empty($obj->reconciliable)) {
|
||||
if (empty($obj->reconcilable)) {
|
||||
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable&mode=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
|
||||
@ -1088,9 +1088,23 @@ class AccountancyExport
|
||||
{
|
||||
$soc = $this->db->fetch_object($resql);
|
||||
|
||||
$address = str_replace(array("\t", "\n", "\r"), " ", $soc->address);
|
||||
$address=array('','','');
|
||||
if (strpos($soc->address, "\n")!==false) {
|
||||
$address = explode("\n", $soc->address);
|
||||
if (is_array($address) && count($address)>0) {
|
||||
foreach($address as $key=>$data) {
|
||||
$address[$key]=str_replace(array("\t", "\n", "\r"), "", $data);
|
||||
$address[$key]=dol_trunc($address[$key], 40, 'right', 'UTF-8', 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$address[0] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 0, 40);
|
||||
$address[1] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 41, 40);
|
||||
$address[2] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 82, 40);
|
||||
}
|
||||
|
||||
$type_enregistrement = 'C';
|
||||
//TYPE
|
||||
print $type_enregistrement.$separator;
|
||||
//NOCL
|
||||
print $soc->code_client.$separator;
|
||||
@ -1099,15 +1113,15 @@ class AccountancyExport
|
||||
//LIBI
|
||||
print $separator;
|
||||
//TITR
|
||||
print getFormeJuridiqueLabel($soc->fk_forme_juridique).$separator;
|
||||
print $separator;
|
||||
//RSSO
|
||||
print $soc->nom.$separator;
|
||||
//CAD1
|
||||
print substr($address, 0, 40).$separator;
|
||||
print $address[0].$separator;
|
||||
//CAD2
|
||||
print substr($address, 41, 40).$separator;
|
||||
print $address[1].$separator;
|
||||
//CAD3
|
||||
print substr($address, 82, 40).$separator;
|
||||
print $address[2].$separator;
|
||||
//COPO
|
||||
print $soc->zip.$separator;
|
||||
//BUDI
|
||||
@ -1129,7 +1143,7 @@ class AccountancyExport
|
||||
//COMM
|
||||
print $separator;
|
||||
//SIRE
|
||||
print $soc->siret.$separator;
|
||||
print str_replace(" ", "", $soc->siret).$separator;
|
||||
//RIBP
|
||||
print $separator;
|
||||
//DOBQ
|
||||
@ -1267,8 +1281,6 @@ class AccountancyExport
|
||||
} else {
|
||||
print $separator;
|
||||
}
|
||||
// SECT
|
||||
print $separator;
|
||||
// CTRE
|
||||
print $separator;
|
||||
// NORL
|
||||
@ -1286,13 +1298,13 @@ class AccountancyExport
|
||||
// CDES
|
||||
print $separator;
|
||||
// QTUE
|
||||
print '0'.$separator;
|
||||
print $separator;
|
||||
// MTDV
|
||||
print $separator;
|
||||
// CODV
|
||||
print '0'.$separator;
|
||||
// TXDV
|
||||
// CODV
|
||||
print $separator;
|
||||
// TXDV
|
||||
print '0'.$separator;
|
||||
// MOPM
|
||||
print $separator;
|
||||
// BONP
|
||||
|
||||
@ -136,9 +136,9 @@ class AccountingAccount extends CommonObject
|
||||
public $active;
|
||||
|
||||
/**
|
||||
* @var int reconciliable
|
||||
* @var int reconcilable
|
||||
*/
|
||||
public $reconciliable;
|
||||
public $reconcilable;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -167,7 +167,7 @@ class AccountingAccount extends CommonObject
|
||||
global $conf;
|
||||
|
||||
if ($rowid || $account_number) {
|
||||
$sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconciliable";
|
||||
$sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconcilable";
|
||||
$sql .= ", ca.label as category_label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as ca ON a.fk_accounting_category = ca.rowid";
|
||||
@ -208,7 +208,7 @@ class AccountingAccount extends CommonObject
|
||||
$this->fk_user_modif = $obj->fk_user_modif;
|
||||
$this->active = $obj->active;
|
||||
$this->status = $obj->active;
|
||||
$this->reconciliable = $obj->reconciliable;
|
||||
$this->reconcilable = $obj->reconcilable;
|
||||
|
||||
return $this->id;
|
||||
} else {
|
||||
@ -267,7 +267,7 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= ", fk_accounting_category";
|
||||
$sql .= ", fk_user_author";
|
||||
$sql .= ", active";
|
||||
$sql .= ", reconciliable";
|
||||
$sql .= ", reconcilable";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= " '" . $this->db->idate($now) . "'";
|
||||
$sql .= ", " . $conf->entity;
|
||||
@ -280,7 +280,7 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||
$sql .= ", " . $user->id;
|
||||
$sql .= ", " . (int) $this->active;
|
||||
$sql .= ", " . (int) $this->reconciliable;
|
||||
$sql .= ", " . (int) $this->reconcilable;
|
||||
$sql .= ")";
|
||||
|
||||
$this->db->begin();
|
||||
@ -348,7 +348,7 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||
$sql .= " , fk_user_modif = " . $user->id;
|
||||
$sql .= " , active = " . (int) $this->active;
|
||||
$sql .= " , reconciliable = " . (int) $this->reconciliable;
|
||||
$sql .= " , reconcilable = " . (int) $this->reconcilable;
|
||||
$sql .= " WHERE rowid = " . $this->id;
|
||||
|
||||
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
||||
@ -588,7 +588,7 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
$fieldtouse = 'reconciliable';
|
||||
$fieldtouse = 'reconcilable';
|
||||
}
|
||||
|
||||
if ($result > 0) {
|
||||
@ -619,7 +619,7 @@ class AccountingAccount extends CommonObject
|
||||
* Account activated
|
||||
*
|
||||
* @param int $id Id
|
||||
* @param int $mode 0=field active, 1=field reconciliable, 2=field active_customer_list, 3=field_active_supplier_list
|
||||
* @param int $mode 0=field active, 1=field reconcilable
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function account_activate($id, $mode = 0)
|
||||
@ -633,7 +633,7 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
$fieldtouse = 'reconciliable';
|
||||
$fieldtouse = 'reconcilable';
|
||||
}
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
|
||||
@ -145,6 +145,8 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
/*print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Member").'</td><td>';
|
||||
|
||||
@ -23,9 +23,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/expedition.php
|
||||
* \ingroup expedition
|
||||
* \brief Page d'administration/configuration du module Expedition
|
||||
* \file htdocs/admin/export.php
|
||||
* \ingroup export
|
||||
* \brief config Page module Export
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -38,13 +38,15 @@ if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
if ($action == 'save') {
|
||||
dolibarr_set_const($db, 'EXPORT_CSV_SEPARATOR_TO_USE', GETPOST('EXPORT_CSV_SEPARATOR_TO_USE', 'alphanohtml'));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -69,32 +71,38 @@ $head[$h][1] = $langs->trans("Setup");
|
||||
$head[$h][2] = 'setup';
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "exports");
|
||||
dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic");
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
print '<td class="center" width="20"> </td>';
|
||||
print '<td class="center" width="100"></td>'."\n";
|
||||
|
||||
print '</tr>';
|
||||
|
||||
// Example with a yes / no select
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("EXPORTS_SHARE_MODELS").'</td>';
|
||||
print '<td class="center" width="20"> </td>';
|
||||
print '<td class="center" width="100">';
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_EXPORTS_SHARE_MODELS">';
|
||||
echo ajax_constantonoff('EXPORTS_SHARE_MODELS');
|
||||
print '</form>';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';
|
||||
print '<td width="60" align="center">'."<input size=\"3\" class=\"flat\" type=\"text\" name=\"EXPORT_CSV_SEPARATOR_TO_USE\" value=\"".(empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE)."\"></td>";
|
||||
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
// End of page
|
||||
|
||||
100
htdocs/admin/import.php
Normal file
100
htdocs/admin/import.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2020 Floriazn Henry <florian.henry@atm-consulting.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
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/import.php
|
||||
* \ingroup import
|
||||
* \brief config page module import
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'exports', 'other'));
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$page_name = "ImportSetup";
|
||||
llxHeader('', $langs->trans($page_name));
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
||||
|
||||
//$head = export_admin_prepare_head();
|
||||
$h = 0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/import.php';
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$head[$h][2] = 'setup';
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, 'setup', $langs->trans("ImportArea"), -1, "technic");
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setModuleOptions">';
|
||||
print '<input type="hidden" name="param" value="IMPORT_CSV_SEPARATOR_TO_USE">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
print '<td class="center" width="20"> </td>';
|
||||
print '<td class="center" width="100"></td>'."\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ImportCsvSeparator").' ('.$langs->trans("ByDefault").')</td>';
|
||||
print '<td width="60" align="center">'."<input size=\"3\" class=\"flat\" type=\"text\" name=\"value\" value=\"".(empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->IMPORT_CSV_SEPARATOR_TO_USE)."\"></td>";
|
||||
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -86,31 +86,31 @@ print '</li>';
|
||||
if (preg_match('/^fr_/i', $langs->getDefaultLang()))
|
||||
{
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.fr/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("France")).'</a>';
|
||||
print '<a target="_blank" href="https://www.dolibarr.fr/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("France")).'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
if (preg_match('/^el_/i', $langs->getDefaultLang()))
|
||||
{
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.gr/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Greece")).'</a>';
|
||||
print '<a target="_blank" href="https://www.dolibarr.gr/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Greece")).'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
if (preg_match('/^es_/i', $langs->getDefaultLang()))
|
||||
{
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.es/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Spain")).'</a>';
|
||||
print '<a target="_blank" href="https://www.dolibarr.es/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Spain")).'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
if (preg_match('/^it_/i', $langs->getDefaultLang()))
|
||||
{
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.it/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Italy")).'</a>';
|
||||
print '<a target="_blank" href="https://www.dolibarr.it/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Italy")).'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
if (preg_match('/^de_/i', $langs->getDefaultLang()))
|
||||
{
|
||||
print '<li>';
|
||||
print '<a target="_blank" href="http://www.dolibarr.de/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).'</a>';
|
||||
print '<a target="_blank" href="https://www.dolibarr.de/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).'</a>';
|
||||
print '</li>';
|
||||
}
|
||||
print '<li>';
|
||||
|
||||
@ -242,7 +242,9 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
//{
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
@ -255,7 +255,9 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
@ -1157,14 +1157,14 @@ if ($resql)
|
||||
} else {
|
||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1;
|
||||
}
|
||||
$backgroundcolor = 'style="background-color: '.$color.';"';
|
||||
$backgroundcolor = 'style="background: '.$color.';"';
|
||||
} else {
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) {
|
||||
$color = '#7fdb86';
|
||||
} else {
|
||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2;
|
||||
}
|
||||
$backgroundcolor = 'style="background-color: '.$color.';"';
|
||||
$backgroundcolor = 'style="background: '.$color.';"';
|
||||
}
|
||||
}
|
||||
print '<tr class="oddeven" '.$backgroundcolor.'>';
|
||||
|
||||
@ -227,7 +227,9 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
@ -1713,7 +1713,17 @@ if (empty($reshook))
|
||||
$object->fk_facture_source = $_POST['situations'];
|
||||
$object->type = Facture::TYPE_SITUATION;
|
||||
|
||||
if (!empty($origin) && !empty($originid))
|
||||
|
||||
$object->retained_warranty = GETPOST('retained_warranty', 'int');
|
||||
$object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||
|
||||
$retained_warranty_date_limit = GETPOST('retained_warranty_date_limit');
|
||||
if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) {
|
||||
$object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit);
|
||||
}
|
||||
$object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement);
|
||||
|
||||
if (!empty($origin) && !empty($originid))
|
||||
{
|
||||
$object->origin = $origin;
|
||||
$object->origin_id = $originid;
|
||||
@ -3035,7 +3045,7 @@ if ($action == 'create')
|
||||
// First situation invoice
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp = '<input id="radio_situation" type="radio" name="type" value="5"'.(GETPOST('type') == 5 ? ' checked' : '').'> ';
|
||||
$tmp = $tmp.'<label for="radio_situation invoice" >'.$langs->trans("InvoiceFirstSituationAsk").'</label>';
|
||||
$tmp = $tmp.'<label for="radio_situation" >'.$langs->trans("InvoiceFirstSituationAsk").'</label>';
|
||||
$desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
@ -3322,14 +3332,28 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
$retained_warranty = GETPOST('retained_warranty', 'int');
|
||||
$retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
|
||||
if(empty($retained_warranty)){
|
||||
if(!empty($objectsrc->retained_warranty)){ // use previous situation value
|
||||
$retained_warranty = $objectsrc->retained_warranty;
|
||||
}else{
|
||||
$retained_warranty = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('RetainedWarranty').'</td><td colspan="2">';
|
||||
print '<input id="new-situation-invoice-retained-warranty" name="retained_warranty" type="number" value="'.$retained_warranty.'" step="0.01" min="0" max="100" />%';
|
||||
|
||||
// Retained warranty payment term
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('PaymentConditionsShortRetainedWarranty').'</td><td colspan="2">';
|
||||
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||
$retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
if(empty($retained_warranty_fk_cond_reglement)){
|
||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value
|
||||
$retained_warranty_fk_cond_reglement = $objectsrc->retained_warranty_fk_cond_reglement;
|
||||
}else{
|
||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
}
|
||||
}
|
||||
$form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1067,6 +1067,11 @@ class Facture extends CommonInvoice
|
||||
$facture->situation_cycle_ref = $this->situation_cycle_ref;
|
||||
$facture->situation_final = $this->situation_final;
|
||||
|
||||
$facture->retained_warranty = $this->retained_warranty;
|
||||
$facture->retained_warranty_fk_cond_reglement = $this->retained_warranty_fk_cond_reglement;
|
||||
$facture->retained_warranty_date_limit = $this->retained_warranty_date_limit;
|
||||
|
||||
|
||||
// Loop on each line of new invoice
|
||||
foreach ($facture->lines as $i => $tmpline)
|
||||
{
|
||||
|
||||
@ -235,7 +235,9 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
@ -267,33 +267,34 @@ abstract class CommonDocGenerator
|
||||
$object->state = getState($object->state_code, 0);
|
||||
}
|
||||
|
||||
$array_contact = array(
|
||||
$array_key.'_fullname' => $object->getFullName($outputlangs, 1),
|
||||
$array_key.'_lastname' => $object->lastname,
|
||||
$array_key.'_firstname' => $object->firstname,
|
||||
$array_key.'_address' => $object->address,
|
||||
$array_key.'_zip' => $object->zip,
|
||||
$array_key.'_town' => $object->town,
|
||||
$array_key.'_state_id' => $object->state_id,
|
||||
$array_key.'_state_code' => $object->state_code,
|
||||
$array_key.'_state' => $object->state,
|
||||
$array_key.'_country_id' => $object->country_id,
|
||||
$array_key.'_country_code' => $object->country_code,
|
||||
$array_key.'_country' => $object->country,
|
||||
$array_key.'_poste' => $object->poste,
|
||||
$array_key.'_socid' => $object->socid,
|
||||
$array_key.'_statut' => $object->statut,
|
||||
$array_key.'_code' => $object->code,
|
||||
$array_key.'_email' => $object->email,
|
||||
$array_key.'_jabberid' => $object->jabberid,
|
||||
$array_key.'_phone_pro' => $object->phone_pro,
|
||||
$array_key.'_phone_perso' => $object->phone_perso,
|
||||
$array_key.'_phone_mobile' => $object->phone_mobile,
|
||||
$array_key.'_fax' => $object->fax,
|
||||
$array_key.'_birthday' => $object->birthday,
|
||||
$array_key.'_default_lang' => $object->default_lang,
|
||||
$array_key.'_note_public' => $object->note_public,
|
||||
$array_key.'_note_private' => $object->note_private
|
||||
$array_contact = array (
|
||||
$array_key . '_fullname' => $object->getFullName($outputlangs, 1),
|
||||
$array_key . '_lastname' => $object->lastname,
|
||||
$array_key . '_firstname' => $object->firstname,
|
||||
$array_key . '_address' => $object->address,
|
||||
$array_key . '_zip' => $object->zip,
|
||||
$array_key . '_town' => $object->town,
|
||||
$array_key . '_state_id' => $object->state_id,
|
||||
$array_key . '_state_code' => $object->state_code,
|
||||
$array_key . '_state' => $object->state,
|
||||
$array_key . '_country_id' => $object->country_id,
|
||||
$array_key . '_country_code' => $object->country_code,
|
||||
$array_key . '_country' => $object->country,
|
||||
$array_key . '_poste' => $object->poste,
|
||||
$array_key . '_socid' => $object->socid,
|
||||
$array_key . '_statut' => $object->statut,
|
||||
$array_key . '_code' => $object->code,
|
||||
$array_key . '_email' => $object->email,
|
||||
$array_key . '_jabberid' => $object->jabberid, // deprecated
|
||||
$array_key . '_phone_pro' => $object->phone_pro,
|
||||
$array_key . '_phone_perso' => $object->phone_perso,
|
||||
$array_key . '_phone_mobile' => $object->phone_mobile,
|
||||
$array_key . '_fax' => $object->fax,
|
||||
$array_key . '_birthday' => $object->birthday,
|
||||
$array_key . '_default_lang' => $object->default_lang,
|
||||
$array_key . '_note_public' => $object->note_public,
|
||||
$array_key . '_note_private' => $object->note_private,
|
||||
$array_key . '_civility' => $object->civility,
|
||||
);
|
||||
|
||||
// Retrieve extrafields
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2014-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2020 OScss-Shop <support@oscss-shop.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
|
||||
@ -381,13 +383,19 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $dateend Date end to scan
|
||||
* @return string Number of entries
|
||||
*/
|
||||
public function getAccountancyEntriesByFiscalYear($datestart, $dateend)
|
||||
public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if(empty($datestart) )
|
||||
$datestart = $this->date_start;
|
||||
if(empty($dateend) )
|
||||
$dateend = $this->date_end;
|
||||
|
||||
$sql = "SELECT count(DISTINCT piece_num) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping ";
|
||||
$sql.= " WHERE doc_date >= '".$datestart."' and doc_date <= '".$dateend."'";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql.= " WHERE entity IN (".getEntity('bookkeeping', 0).")";
|
||||
$sql.= " AND doc_date >= '".$this->db->idate($datestart)."' and doc_date <= '".$this->db->idate($dateend)."'";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -407,13 +415,19 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $dateend Date end to scan
|
||||
* @return string Number of movements
|
||||
*/
|
||||
public function getAccountancyMovementsByFiscalYear($datestart, $dateend)
|
||||
public function getAccountancyMovementsByFiscalYear($datestart = '', $dateend = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if(empty($datestart) )
|
||||
$datestart = $this->date_start;
|
||||
if(empty($dateend) )
|
||||
$dateend = $this->date_end;
|
||||
|
||||
$sql = "SELECT count(rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping ";
|
||||
$sql.= " WHERE doc_date >= '".$datestart."' AND doc_date <= '".$dateend."'";
|
||||
$sql.= " WHERE entity IN (".getEntity('bookkeeping', 0).")";
|
||||
$sql.= " AND doc_date >= '".$this->db->idate($datestart)."' and doc_date <= '".$this->db->idate($dateend)."'";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -1618,7 +1618,7 @@ class Form
|
||||
public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user, $langs;
|
||||
global $conf, $user, $langs, $hookmanager;
|
||||
|
||||
// If no preselected user defined, we take current user
|
||||
if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected = $user->id;
|
||||
@ -1679,6 +1679,10 @@ class Form
|
||||
if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql .= " AND u.statut <> 0";
|
||||
if (!empty($morefilter)) $sql .= " ".$morefilter;
|
||||
|
||||
//Add hook to filter on user (for exemple on usergroup define in custom modules)
|
||||
$reshook = $hookmanager->executeHooks('addSQLWhereFilterOnSelectUsers', array(), $this, $action);
|
||||
if (!empty($reshook)) $sql .= $hookmanager->resPrint;
|
||||
|
||||
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) // MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname
|
||||
{
|
||||
$sql .= " ORDER BY u.firstname ASC";
|
||||
|
||||
@ -729,6 +729,7 @@ class FormCompany extends Form
|
||||
if (is_object($object) && method_exists($object, 'liste_type_contact'))
|
||||
{
|
||||
$lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1);
|
||||
|
||||
print '<select class="flat valignmiddle'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
if ($showempty) print '<option value="0"></option>';
|
||||
foreach ($lesTypes as $key=>$value)
|
||||
|
||||
@ -424,7 +424,7 @@ class FormOther
|
||||
public function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '', $norepresentative = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
$langs->load('users');
|
||||
|
||||
@ -440,6 +440,9 @@ class FormOther
|
||||
$out .= $comboenhancement;
|
||||
}
|
||||
}
|
||||
|
||||
$reshook = $hookmanager->executeHooks('addSQLWhereFilterOnSelectSalesRep', array(), $this, $action);
|
||||
|
||||
// Select each sales and print them in a select input
|
||||
$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($showempty) $out .= '<option value="0"> </option>';
|
||||
@ -464,6 +467,10 @@ class FormOther
|
||||
|
||||
if (empty($user->rights->user->user->lire)) $sql_usr .= " AND u.rowid = ".$user->id;
|
||||
if (!empty($user->socid)) $sql_usr .= " AND u.fk_soc = ".$user->socid;
|
||||
|
||||
//Add hook to filter on user (for exemple on usergroup define in custom modules)
|
||||
if (!empty($reshook)) $sql_usr .= $hookmanager->resArray[0];
|
||||
|
||||
// Add existing sales representatives of thirdparty of external user
|
||||
if (empty($user->rights->user->user->lire) && $user->socid)
|
||||
{
|
||||
@ -485,6 +492,9 @@ class FormOther
|
||||
}
|
||||
|
||||
$sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->socid;
|
||||
|
||||
//Add hook to filter on user (for exemple on usergroup define in custom modules)
|
||||
if (!empty($reshook)) $sql_usr .= $hookmanager->resArray[1];
|
||||
}
|
||||
$sql_usr .= " ORDER BY statut DESC, lastname ASC"; // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
|
||||
//print $sql_usr;exit;
|
||||
|
||||
@ -591,7 +591,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$pdf->SetXY($Xoff, $Yoff);
|
||||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
$pdf->MultiCell(0, 3, $outputlangs->transnoentities("RefSending").': '.$outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $Xoff, 3, $outputlangs->transnoentities("RefSending").': '.$outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
//$this->Code39($Xoff+43, $Yoff+1, $object->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
||||
|
||||
$origin = $object->origin;
|
||||
@ -627,9 +627,9 @@ class pdf_merou extends ModelePdfExpedition
|
||||
{
|
||||
$Yoff += 3;
|
||||
$posy = $Yoff;
|
||||
$pdf->SetXY(100, $posy);
|
||||
$pdf->SetXY($Xoff, $posy);
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $Xoff, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
||||
}
|
||||
|
||||
// Date delivery
|
||||
|
||||
@ -193,14 +193,20 @@ class modContrat extends DolibarrModules
|
||||
'p.rowid'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text');
|
||||
|
||||
|
||||
$keyforselect='contrat'; $keyforelement='contract'; $keyforaliasextra='coextra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
$keyforselect='contratdet'; $keyforelement='contract_line'; $keyforaliasextra='codextra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contrat as co,';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contratdet as cod';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cod.fk_product = p.rowid)';
|
||||
$this->export_sql_end[$r] .=' WHERE co.fk_soc = s.rowid and co.rowid = cod.fk_contrat';
|
||||
$this->export_sql_end[$r] .=' AND co.entity IN ('.getEntity('contract').')';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid';
|
||||
$this->export_sql_end[$r] .=' INNER JOIN '.MAIN_DB_PREFIX.'contrat as co ON co.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .=' INNER JOIN '.MAIN_DB_PREFIX.'contratdet as cod ON co.rowid = cod.fk_contrat';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (cod.fk_product = p.rowid)';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'contrat_extrafields as coextra on (co.rowid = coextra.fk_object)';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'contratdet_extrafields as codextra on (cod.rowid = codextra.fk_object)';
|
||||
$this->export_sql_end[$r] .=' WHERE co.entity IN ('.getEntity('contract').')';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ class modFacture extends DolibarrModules
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
|
||||
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription",
|
||||
@ -303,7 +303,7 @@ class modFacture extends DolibarrModules
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
|
||||
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef',
|
||||
|
||||
@ -57,7 +57,7 @@ class modImport extends DolibarrModules
|
||||
$this->dirs = array("/import/temp");
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array();
|
||||
$this->config_page_url = array("import.php");
|
||||
|
||||
// Dependencies
|
||||
$this->hidden = false; // A condition to hide module
|
||||
|
||||
@ -330,11 +330,20 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
$contactobject = null;
|
||||
if (!empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
|
||||
else $socobject = $object->thirdparty;
|
||||
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))
|
||||
{
|
||||
$socobject = $object->contact;
|
||||
}
|
||||
else
|
||||
{
|
||||
$socobject = $object->thirdparty;
|
||||
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
|
||||
$contactobject = $object->contact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -405,7 +414,10 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
$array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
|
||||
$array_other = $this->get_substitutionarray_other($outputlangs);
|
||||
|
||||
$tmparray = array_merge($substitutionarray, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other);
|
||||
$array_thirdparty_contact = array();
|
||||
if ($usecontact && is_object($contactobject)) $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
|
||||
|
||||
$tmparray = array_merge($substitutionarray, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||
|
||||
// Call the ODTSubstitution hook
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
* This template needs:
|
||||
* $object
|
||||
* $withproject (if we are on task contact)
|
||||
*
|
||||
* $preselectedtypeofcontact may be defined or not
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
@ -28,6 +30,10 @@ if (empty($object) || !is_object($object))
|
||||
exit;
|
||||
}
|
||||
|
||||
if (empty($preselectedtypeofcontact)) {
|
||||
$preselectedtypeofcontact = 0;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
@ -60,14 +66,14 @@ $userstatic = new User($db);
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE CONTACTS -->
|
||||
<div class="underbanner clearboth"></div>
|
||||
<div class="div-table-responsive">
|
||||
<div class="tagtable tableforcontact centpercent noborder nobordertop allwidth">
|
||||
|
||||
<?php
|
||||
if ($permission)
|
||||
{
|
||||
?>
|
||||
print '<div class="underbanner clearboth"></div>'."\n";
|
||||
print '<div class="div-table-responsive">'."\n";
|
||||
print '<div class="tagtable tableforcontact centpercent noborder nobordertop allwidth">'."\n";
|
||||
|
||||
?>
|
||||
<form class="tagtr liste_titre">
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("NatureOfContact"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
|
||||
@ -140,9 +146,10 @@ if ($permission)
|
||||
</div>
|
||||
<div class="tagtd maxwidthonsmartphone noborderbottom">
|
||||
<?php
|
||||
$tmpobject = $object;
|
||||
$tmpobject=$object;
|
||||
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc;
|
||||
$formcompany->selectTypeContact($tmpobject, '', 'type', 'external', 'position', 0, 'minwidth100imp'); ?>
|
||||
$formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'type', 'external', 'position', 0, 'minwidth100imp');
|
||||
?>
|
||||
</div>
|
||||
<div class="tagtd noborderbottom"> </div>
|
||||
<div class="tagtd center noborderbottom">
|
||||
@ -152,9 +159,11 @@ if ($permission)
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
||||
/**
|
||||
* Prepare list
|
||||
|
||||
@ -260,6 +260,7 @@ if ($id > 0 || !empty($ref))
|
||||
|
||||
// Contacts lines (modules that overwrite templates must declare this into descriptor)
|
||||
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
|
||||
$preselectedtypeofcontact = dol_getIdFromCode($db, 'SHIPPING', 'c_type_contact', 'code', 'rowid');
|
||||
foreach ($dirtpls as $reldir)
|
||||
{
|
||||
$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
|
||||
|
||||
@ -211,7 +211,9 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
@ -225,7 +225,9 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
//{
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
7
htdocs/includes/adodbtime/README.txt
Normal file
7
htdocs/includes/adodbtime/README.txt
Normal file
@ -0,0 +1,7 @@
|
||||
README
|
||||
======
|
||||
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
|
||||
See Wiki: https://adodb.org/dokuwiki/doku.php?id=v5:datetime:datetime_index
|
||||
Download: https://github.com/ADOdb/ADOdb/blob/master/adodb-time.inc.php
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
Download: http://phplens.com/phpeverywhere/
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
See Wiki: https://adodb.org/dokuwiki/doku.php?id=v5:datetime:datetime_index
|
||||
Download: https://github.com/ADOdb/ADOdb/blob/master/adodb-time.inc.php
|
||||
|
||||
PHP native date functions use integer timestamps for computations.
|
||||
Because of this, dates are restricted to the years 1901-2038 on Unix
|
||||
|
||||
5
htdocs/includes/geoip2/README.txt
Normal file
5
htdocs/includes/geoip2/README.txt
Normal file
@ -0,0 +1,5 @@
|
||||
README
|
||||
|
||||
https://dev.maxmind.com/geoip/geoip2/geolite2/
|
||||
|
||||
License: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
5
htdocs/includes/jquery/README.txt
Normal file
5
htdocs/includes/jquery/README.txt
Normal file
@ -0,0 +1,5 @@
|
||||
README:
|
||||
jQuery is a JavaScript library
|
||||
|
||||
https://jquery.com/
|
||||
https://jquery.com/download/
|
||||
@ -9,7 +9,7 @@
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@ -193,7 +193,8 @@ ALTER TABLE llx_accounting_account DROP COLUMN pcg_subtype;
|
||||
ALTER TABLE llx_product ADD COLUMN accountancy_code_buy_intra varchar(32) AFTER accountancy_code_buy;
|
||||
ALTER TABLE llx_product ADD COLUMN accountancy_code_buy_export varchar(32) AFTER accountancy_code_buy_intra;
|
||||
|
||||
ALTER TABLE llx_accounting_account ADD COLUMN reconciliable tinyint DEFAULT 0 NOT NULL after active;
|
||||
|
||||
ALTER TABLE llx_entrepot ADD COLUMN fax varchar(20) DEFAULT NULL AFTER fk_pays;
|
||||
ALTER TABLE llx_entrepot ADD COLUMN phone varchar(20) DEFAULT NULL AFTER fk_pays;
|
||||
|
||||
ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active;
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ create table llx_accounting_account
|
||||
fk_user_author integer DEFAULT NULL,
|
||||
fk_user_modif integer DEFAULT NULL,
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
reconciliable tinyint DEFAULT 0 NOT NULL,
|
||||
reconcilable tinyint DEFAULT 0 NOT NULL,
|
||||
import_key varchar(14),
|
||||
extraparams varchar(255) -- for other parameters with json format
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -239,7 +239,7 @@ HideOpeningBalance=Hide opening balance
|
||||
Pcgtype=Group of account
|
||||
PcgtypeDesc=Group of account are used as predefined 'filter' and 'grouping' criteria for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as groups for accounting accounts of products to build the expense/income report.
|
||||
|
||||
Reconciliable=Reconcilable
|
||||
Reconcilable=Reconcilable
|
||||
|
||||
TotalVente=Total turnover before tax
|
||||
TotalMarge=Total sales margin
|
||||
|
||||
@ -1959,6 +1959,7 @@ WarningValueHigherSlowsDramaticalyOutput=Warning, higher values slows dramatical
|
||||
ModuleActivated=Module %s is activated and slows the interface
|
||||
EXPORTS_SHARE_MODELS=Export models are share with everybody
|
||||
ExportSetup=Setup of module Export
|
||||
ImportSetup=Setup of module Import
|
||||
InstanceUniqueID=Unique ID of the instance
|
||||
SmallerThan=Smaller than
|
||||
LargerThan=Larger than
|
||||
|
||||
@ -26,6 +26,8 @@ FieldTitle=Field title
|
||||
NowClickToGenerateToBuildExportFile=Now, select the file format in the combo box and click on "Generate" to build the export file...
|
||||
AvailableFormats=Available Formats
|
||||
LibraryShort=Library
|
||||
ExportCsvSeparator=Csv caracter separator
|
||||
ImportCsvSeparator=Csv caracter separator
|
||||
Step=Step
|
||||
FormatedImport=Import Assistant
|
||||
FormatedImportDesc1=This module allows you to update existing data or add new objects into the database from a file without technical knowledge, using an assistant.
|
||||
|
||||
@ -274,6 +274,7 @@ dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, '');
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
|
||||
@ -139,6 +139,7 @@ dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, '');
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
|
||||
@ -193,6 +193,8 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// User
|
||||
|
||||
@ -119,7 +119,7 @@ button.calcbutton2 {
|
||||
width: calc(25% - 2px);
|
||||
height: calc(25% - 2px);
|
||||
font-weight: bold;
|
||||
font-size: 8pt;
|
||||
font-size: 10pt;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
@ -159,6 +159,19 @@ button.actionbutton {
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
button.item_value {
|
||||
background: #bbbbbb;
|
||||
border: #000000 1px solid;
|
||||
border-radius: 4px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
button.item_value.selected {
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div[aria-describedby="dialog-info"] button:before {
|
||||
content: "\f788";
|
||||
font-family: "Font Awesome 5 Free";
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/floors.php
|
||||
* \file htdocs/takepos/freezone.php
|
||||
* \ingroup takepos
|
||||
* \brief Popup to enter a free line
|
||||
*/
|
||||
@ -32,6 +32,11 @@ if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
|
||||
require '../main.inc.php'; // Load $user and permissions
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
global $mysoc;
|
||||
|
||||
$langs->loadLangs(array("bills", "cashdesk"));
|
||||
|
||||
@ -44,6 +49,20 @@ if (empty($user->rights->takepos->run)) {
|
||||
access_forbidden();
|
||||
}
|
||||
|
||||
// get invoice
|
||||
$invoice = new Facture($db);
|
||||
if ($place > 0) {
|
||||
$invoice->fetch($place);
|
||||
} else {
|
||||
$invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$place.')');
|
||||
}
|
||||
|
||||
// get default vat rate
|
||||
$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION['takeposterminal'];
|
||||
$soc = new Societe($db);
|
||||
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
|
||||
else $soc->fetch($conf->global->$constforcompanyid);
|
||||
$vatRateDefault = get_default_tva($mysoc, $soc);
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -52,18 +71,34 @@ if (empty($user->rights->takepos->run)) {
|
||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||
$arrayofjs = array();
|
||||
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
|
||||
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
||||
?>
|
||||
<script>
|
||||
function Save(){
|
||||
$.get( "invoice.php", { action: "<?php echo $action; ?>", place: "<?php echo $place; ?>", desc:$('#desc').val(), number:$('#number').val()} );
|
||||
parent.$.colorbox.close();
|
||||
}
|
||||
var vatRate = '<?php echo dol_escape_js($vatRateDefault); ?>';
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('#desc').focus()
|
||||
});
|
||||
/**
|
||||
* Apply new VAT rate
|
||||
*
|
||||
* @param {string} id VAT id
|
||||
* @param {string} rate VAT rate
|
||||
*/
|
||||
function ApplyVATRate(id, rate) {
|
||||
vatRate = rate;
|
||||
jQuery('button.vat_rate').removeClass('selected');
|
||||
jQuery('#vat_rate_' + id).addClass('selected');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save (validate)
|
||||
*/
|
||||
function Save() {
|
||||
$.get( "invoice.php", { action: "<?php echo $action; ?>", place: "<?php echo $place; ?>", desc:$('#desc').val(), number:$('#number').val(), tva_tx: vatRate} );
|
||||
parent.$.colorbox.close();
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('#desc').focus()
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@ -76,6 +111,21 @@ if ($action == "addnote") echo '<input type="hidden" id="number" name="number" v
|
||||
?>
|
||||
<input type="hidden" name="place" class="takepospay" value="<?php echo $place; ?>">
|
||||
<input type="button" class="button takepospay clearboth" value="OK" onclick="Save();">
|
||||
<?php
|
||||
if ($action == 'freezone') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
|
||||
|
||||
$form = new Form($db);
|
||||
$num = $form->load_cache_vatrates("'" . $mysoc->country_code . "'");
|
||||
if ($num > 0) {
|
||||
print '<br><br>';
|
||||
print $langs->trans('VAT') . ' : ';
|
||||
foreach ($form->cache_vatrates as $rate) {
|
||||
print '<button type="button" class="button item_value vat_rate' . ($rate['txtva'] == $vatRateDefault ? ' selected' : '') . '" id="vat_rate_' . $rate['rowid'] . '" onclick="ApplyVATRate(\'' . $rate['rowid'] . '\', \'' . $rate['txtva'] .'\');">' . $rate['txtva'] . ' %</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
|
||||
global $mysoc;
|
||||
|
||||
$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks"));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
@ -333,7 +335,12 @@ if ($action == "freezone") {
|
||||
$customer = new Societe($db);
|
||||
$customer->fetch($invoice->socid);
|
||||
|
||||
$tva_tx = get_default_tva($mysoc, $customer);
|
||||
$tva_tx = GETPOST('tva_tx', 'alpha');
|
||||
if ($tva_tx != '') {
|
||||
$tva_tx = price2num($tva_tx);
|
||||
} else {
|
||||
$tva_tx = get_default_tva($mysoc, $customer);
|
||||
}
|
||||
|
||||
// Local Taxes
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr);
|
||||
|
||||
@ -77,6 +77,14 @@ $arrayofjs = array();
|
||||
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
$langs->loadLangs(array('main', 'bills', 'cashdesk'));
|
||||
|
||||
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$htmlReductionPercent = '<span class="fa fa-2x fa-percent"></span>';
|
||||
$htmlReductionAmount = '<span class="fa fa-2x fa-money"></span>';
|
||||
} else {
|
||||
$htmlReductionPercent = $langs->trans('ReductionShort') . '<br>%';
|
||||
$htmlReductionAmount = $langs->trans('ReductionShort') . '<br>' . $langs->trans('Amount');
|
||||
}
|
||||
?>
|
||||
<link rel="stylesheet" href="css/pos.css.php">
|
||||
</head>
|
||||
@ -87,6 +95,9 @@ $langs->loadLangs(array('main', 'bills', 'cashdesk'));
|
||||
var reductionTotal = '';
|
||||
var editAction = '';
|
||||
var editNumber = '';
|
||||
var htmlBtnOK = '<span style="font-size: 14pt;">OK</span>';
|
||||
var htmlReductionPercent = '<?php echo dol_escape_js($htmlReductionPercent); ?>';
|
||||
var htmlReductionAmount = '<?php echo dol_escape_js($htmlReductionAmount); ?>';
|
||||
|
||||
/**
|
||||
* Reset values
|
||||
@ -98,8 +109,8 @@ $langs->loadLangs(array('main', 'bills', 'cashdesk'));
|
||||
editAction = '';
|
||||
editNumber = '';
|
||||
jQuery('#reduction_total').val(reductionTotal);
|
||||
jQuery("#reduction_type_percent").html('<span class="fa fa-2x fa-percent"></span>');
|
||||
jQuery('#reduction_type_amount').html('<span class="fa fa-2x fa-money-bill-alt"></span>');
|
||||
jQuery("#reduction_type_percent").html(htmlReductionPercent);
|
||||
jQuery('#reduction_type_amount').html(htmlReductionAmount);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,14 +139,14 @@ $langs->loadLangs(array('main', 'bills', 'cashdesk'));
|
||||
}
|
||||
|
||||
if (editAction === 'p'){
|
||||
jQuery('#reduction_type_percent').html('<span style="font-size: 14pt;">OK</span>');
|
||||
jQuery('#reduction_type_amount').html('<span class="fa fa-2x fa-money-bill-alt"></span>');
|
||||
jQuery('#reduction_type_percent').html(htmlBtnOK);
|
||||
jQuery('#reduction_type_amount').html(htmlReductionAmount);
|
||||
} else if (editAction === 'a'){
|
||||
jQuery('#reduction_type_amount').html('<span style="font-size: 14pt;">OK</span>');
|
||||
jQuery("#reduction_type_percent").html('<span class="fa fa-2x fa-percent"></span>');
|
||||
jQuery('#reduction_type_amount').html(htmlBtnOK);
|
||||
jQuery("#reduction_type_percent").html(htmlReductionPercent);
|
||||
} else {
|
||||
jQuery('#reduction_type_percent').html('<span class="fa fa-2x fa-percent"></span>');
|
||||
jQuery('#reduction_type_amount').html('<span class="fa fa-2x fa-money-bill-alt"></span>');
|
||||
jQuery('#reduction_type_percent').html(htmlReductionPercent);
|
||||
jQuery('#reduction_type_amount').html(htmlReductionAmount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,11 +213,11 @@ $langs->loadLangs(array('main', 'bills', 'cashdesk'));
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(7);">7</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(8);">8</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(9);">9</button>';
|
||||
print '<button type="button" class="calcbutton2" id="reduction_type_percent" onclick="Edit(\'p\');"><span class="fa fa-2x fa-percent"></span></button>';
|
||||
print '<button type="button" class="calcbutton2" id="reduction_type_percent" onclick="Edit(\'p\');">' . $htmlReductionPercent . '</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(4);">4</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(5);">5</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(6);">6</button>';
|
||||
print '<button type="button" class="calcbutton2" id="reduction_type_amount" onclick="Edit(\'a\');"><span class="fa fa-2x fa-money-bill-alt"></span></button>';
|
||||
print '<button type="button" class="calcbutton2" id="reduction_type_amount" onclick="Edit(\'a\');">' . $htmlReductionAmount . '</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(1);">1</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(2);">2</button>';
|
||||
print '<button type="button" class="calcbutton" onclick="AddReduction(3);">3</button>';
|
||||
|
||||
@ -1552,7 +1552,7 @@ div.nopadding {
|
||||
|
||||
td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto {
|
||||
color: var(--colortexttitlenotab);
|
||||
opacity: 0.65;
|
||||
opacity: 0.45;
|
||||
}
|
||||
.pictotitle {
|
||||
margin-<?php echo $right; ?>: 8px;
|
||||
|
||||
@ -229,7 +229,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
|
||||
@ -60,7 +60,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Users");
|
||||
|
||||
$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios';
|
||||
$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer';
|
||||
llxHeader('', $langs->trans("UsersSetup"), $help_url);
|
||||
|
||||
|
||||
@ -88,8 +88,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@ -102,7 +102,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Editing an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user