update subscription and type
This commit is contained in:
parent
82509e2102
commit
e290884552
48
ChangeLog
48
ChangeLog
@ -25,6 +25,54 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* If your database is MySql or MariaDB, you need at least version 5.1
|
* If your database is MySql or MariaDB, you need at least version 5.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 13.0.2 compared to 13.0.1 *****
|
||||||
|
|
||||||
|
FIX: 11.0 - $this->socid injected in query without checking for empty value
|
||||||
|
FIX: #16096 #16085 Any call of ajax pages must provide the token
|
||||||
|
FIX: #16296
|
||||||
|
FIX: #16325
|
||||||
|
FIX: #16341 : Fetch the Product ExtraFields in Shippment lines
|
||||||
|
FIX: #16366
|
||||||
|
FIX: #16393 Do not sanitize <!DOCTYPE html>
|
||||||
|
FIX: #16420 #16423 #16488 #16477
|
||||||
|
FIX: #16431
|
||||||
|
FIX: #16465
|
||||||
|
FIX: #16480
|
||||||
|
FIX: #16485
|
||||||
|
FIX: #16487
|
||||||
|
FIX: #16503
|
||||||
|
FIX: #16530
|
||||||
|
FIX: #16533
|
||||||
|
FIX: #16629
|
||||||
|
FIX: #16671 Can not generate zip file of documents in backup tool
|
||||||
|
FIX: Add "Now" link on social charges creation card
|
||||||
|
FIX: avoid undefined url and missing token
|
||||||
|
FIX: Bad project filter in ticket list
|
||||||
|
FIX: Buttons to disable bindings not working
|
||||||
|
FIX: class not found when creating recuring invoice from invoice+discount
|
||||||
|
FIX: File attachment on lots
|
||||||
|
FIX: handling $heightforinfotot when he's superior to a page height on Supplier Invoice
|
||||||
|
FIX: hourglass and hide button to pay
|
||||||
|
FIX: massaction validate invoice do not regenerate pdf
|
||||||
|
FIX: missing mp4 video mime
|
||||||
|
FIX: picto on shipment to reset qty to 0. Some quantities were not reset.
|
||||||
|
FIX: Protection to avoid #16504
|
||||||
|
FIX: rounding amount on card updating
|
||||||
|
FIX: Rounding amount on social charges card updating
|
||||||
|
FIX: select list dependencies now work for ModuleBuilder sellist field
|
||||||
|
FIX: Status in popup of member in widget
|
||||||
|
FIX: status on tooltip on widgets
|
||||||
|
FIX: Timezone management for datetime on list of events
|
||||||
|
FIX: Timezone management for datetime with modulebuilder and extrafields
|
||||||
|
FIX: Total_ht not show in contract link element
|
||||||
|
FIX: use post instead get
|
||||||
|
FIX: use var "saved_url" instead global var "$url"
|
||||||
|
FIX: Various payment - Missing fields for check transmitter & bank name
|
||||||
|
FIX: warning if setup of chart of account is not yet done.
|
||||||
|
FIX: wrong extension
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 13.0.1 compared to 13.0.0 *****
|
***** ChangeLog for 13.0.1 compared to 13.0.0 *****
|
||||||
|
|
||||||
FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already.
|
FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already.
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
|||||||
Recommends: apache2 | lighttpd | httpd,
|
Recommends: apache2 | lighttpd | httpd,
|
||||||
mariadb-server | virtual-mysql-server,
|
mariadb-server | virtual-mysql-server,
|
||||||
# Required PHP extensions for debian 9 but we can't add them into a Depends, it does not exists on debian 7 and 8
|
# Required PHP extensions for debian 9 but we can't add them into a Depends, it does not exists on debian 7 and 8
|
||||||
php-xml, php-mbstring
|
php-xml, php-mbstring, php-intl
|
||||||
Suggests: www-browser, php5-geoip
|
Suggests: www-browser, php5-geoip
|
||||||
Description: Web based software to manage a company or foundation
|
Description: Web based software to manage a company or foundation
|
||||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||||
|
|||||||
@ -212,8 +212,10 @@ $accountsystem = new AccountancySystem($db);
|
|||||||
$accountsystem->fetch($conf->global->CHARTOFACCOUNTS);
|
$accountsystem->fetch($conf->global->CHARTOFACCOUNTS);
|
||||||
|
|
||||||
$title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card');
|
$title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card');
|
||||||
$helpurl = '';
|
|
||||||
llxheader('', $title, $helpurl);
|
$help_url = 'EN:Category:Accounting';
|
||||||
|
|
||||||
|
llxheader('', $title, $help_url);
|
||||||
|
|
||||||
|
|
||||||
// Create mode
|
// Create mode
|
||||||
|
|||||||
@ -298,10 +298,10 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Action bar
|
||||||
|
*/
|
||||||
if (!empty($user->rights->accounting->fiscalyear->write)) {
|
if (!empty($user->rights->accounting->fiscalyear->write)) {
|
||||||
/*
|
|
||||||
* Barre d'actions
|
|
||||||
*/
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
|
||||||
|
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -383,11 +384,11 @@ foreach ($list_binding as $key) {
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
|
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
|
||||||
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
|
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disablebindingonsales&value=0">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=0">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disablebindingonsales&value=1">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=1">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
@ -396,11 +397,11 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
|
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
|
||||||
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
|
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disablebindingonpurchases&value=0">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=0">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disablebindingonpurchases&value=1">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=1">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
@ -409,11 +410,11 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
|
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
|
||||||
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
|
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disablebindingonexpensereports&value=0">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=0">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disablebindingonexpensereports&value=1">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=1">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,6 +135,18 @@ if (!empty($search_accountancy_code_end)) {
|
|||||||
$param .= '&search_accountancy_code_end='.$search_accountancy_code_end;
|
$param .= '&search_accountancy_code_end='.$search_accountancy_code_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -44,13 +44,6 @@ $id = GETPOST('id', 'int'); // id of record
|
|||||||
$mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
|
$mode = GETPOST('mode', 'aZ09'); // '' or '_tmp'
|
||||||
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
|
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$mesg = '';
|
|
||||||
|
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
$accountingjournal = new AccountingJournal($db);
|
$accountingjournal = new AccountingJournal($db);
|
||||||
|
|
||||||
@ -83,6 +76,17 @@ if (!empty($update)) {
|
|||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -171,6 +171,16 @@ if (empty($listofformat[$formatexportset])) {
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -471,7 +481,7 @@ if (count($filter) > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')';
|
$sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')';
|
||||||
if ($conf->global->ACCOUNTING_REEXPORT == 0) {
|
if (empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||||
$sql .= " AND t.date_export IS NULL";
|
$sql .= " AND t.date_export IS NULL";
|
||||||
}
|
}
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
@ -487,7 +497,7 @@ if (!empty($sortfield)) {
|
|||||||
// Must be after definition of $sql
|
// Must be after definition of $sql
|
||||||
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
||||||
// TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
|
// TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
|
||||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
|
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
|||||||
@ -163,6 +163,16 @@ if ($search_date_end && empty($search_date_endyear)) {
|
|||||||
$search_date_endday = $tmparray['mday'];
|
$search_date_endday = $tmparray['mday'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
|
|||||||
@ -163,10 +163,21 @@ if ($search_date_end && empty($search_date_endyear)) {
|
|||||||
$search_date_endday = $tmparray['mday'];
|
$search_date_endday = $tmparray['mday'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) {
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
$action = 'list'; $massaction = '';
|
$action = 'list'; $massaction = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,6 +94,16 @@ if ($result < 0) {
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
@ -128,7 +138,7 @@ $form = new Form($db);
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
$title = $object->name." - ".$langs->trans('TabLetteringCustomer');
|
$title = $object->name." - ".$langs->trans('TabLetteringCustomer');
|
||||||
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Geschäftspartner';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
|
|||||||
@ -94,10 +94,21 @@ if ($result < 0) {
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'lettering') {
|
if ($action == 'lettering') {
|
||||||
$result = $lettering->updateLettering($toselect);
|
$result = $lettering->updateLettering($toselect);
|
||||||
|
|
||||||
@ -127,7 +138,7 @@ $form = new Form($db);
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
$title = $object->name." - ".$langs->trans('TabLetteringSupplier');
|
$title = $object->name." - ".$langs->trans('TabLetteringSupplier');
|
||||||
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Geschäftspartner';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
|
|||||||
@ -35,17 +35,6 @@ $socid = GETPOST('socid', 'int');
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
|
||||||
if (empty($conf->accounting->enabled)) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if (!$user->rights->accounting->fiscalyear->write) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||||
@ -67,10 +56,23 @@ $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
|
|||||||
$search_date_end = dol_get_last_day($year_end, $month_end);
|
$search_date_end = dol_get_last_day($year_end, $month_end);
|
||||||
$year_current = $year_start;
|
$year_current = $year_start;
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->accounting->fiscalyear->write) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
if ($action == 'validate_movements_confirm' && $user->rights->accounting->fiscalyear->write) {
|
|
||||||
|
if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting->fiscalyear->write)) {
|
||||||
$result = $object->fetchAll();
|
$result = $object->fetchAll();
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
|
|||||||
@ -38,9 +38,16 @@ $codeventil = GETPOST('codeventil', 'int');
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -80,13 +80,17 @@ if (!$sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->accounting->bind->write) {
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
|
|
||||||
@ -112,7 +116,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_tvaintra = '';
|
$search_tvaintra = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!(GETPOST('account_parent', 'int') >= 0)) {
|
if (!(GETPOST('account_parent', 'int') >= 0)) {
|
||||||
|
|||||||
@ -88,10 +88,13 @@ if (!$sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->accounting->bind->write) {
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +151,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||||
$msg = '';
|
$msg = '';
|
||||||
|
|
||||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||||
|
|||||||
@ -42,9 +42,15 @@ $codeventil = GETPOST('codeventil', 'int');
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -32,17 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||||
|
|
||||||
// Security check
|
|
||||||
if (empty($conf->accounting->enabled)) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if (!$user->rights->accounting->bind->write) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||||
if (GETPOST("year", 'int')) {
|
if (GETPOST("year", 'int')) {
|
||||||
$year_start = GETPOST("year", 'int');
|
$year_start = GETPOST("year", 'int');
|
||||||
@ -65,13 +54,23 @@ $year_current = $year_start;
|
|||||||
// Validate History
|
// Validate History
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'clean' || $action == 'validatehistory') {
|
if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
|
||||||
// Clean database
|
// Clean database
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
|
||||||
|
|||||||
@ -74,13 +74,17 @@ if (!$sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->accounting->bind->write) {
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
|
|
||||||
@ -102,7 +106,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_year = '';
|
$search_year = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!(GETPOST('account_parent', 'int') >= 0)) {
|
if (!(GETPOST('account_parent', 'int') >= 0)) {
|
||||||
|
|||||||
@ -83,19 +83,22 @@ if (!$sortorder) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if (!$user->rights->accounting->bind->write) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
|
|
||||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
@ -130,7 +133,7 @@ $permissiontodelete = $user->rights->expensereport->delete;
|
|||||||
$uploaddir = $conf->expensereport->dir_output;
|
$uploaddir = $conf->expensereport->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||||
$msg = '';
|
$msg = '';
|
||||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||||
if (!empty($mesCasesCochees)) {
|
if (!empty($mesCasesCochees)) {
|
||||||
|
|||||||
@ -31,13 +31,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "loans", "banks", "admin", "dict"));
|
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "loans", "banks", "admin", "dict"));
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
||||||
|
$hookmanager->initHooks(array('accountancyindex'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
|
||||||
$hookmanager->initHooks(array('accountancyindex'));
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
@ -83,7 +83,13 @@ $now = dol_now();
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0 && empty($id_journal)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -954,13 +960,18 @@ if (empty($action) || $action == 'view') {
|
|||||||
$nom = $langs->trans("FinanceJournal").' | '.$accountingjournalstatic->getNomUrl(0, 1, 1, '', 1);
|
$nom = $langs->trans("FinanceJournal").' | '.$accountingjournalstatic->getNomUrl(0, 1, 1, '', 1);
|
||||||
$builddate = dol_now();
|
$builddate = dol_now();
|
||||||
//$description = $langs->trans("DescFinanceJournal") . '<br>';
|
//$description = $langs->trans("DescFinanceJournal") . '<br>';
|
||||||
$description .= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||||
|
|
||||||
$listofchoices = array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
$listofchoices = array(
|
||||||
|
'notyet'=>$langs->trans("NotYetInGeneralLedger"),
|
||||||
|
'already'=>$langs->trans("AlreadyInGeneralLedger")
|
||||||
|
);
|
||||||
$period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0);
|
$period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||||
$period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
$period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||||
|
|
||||||
$varlink = 'id_journal='.$id_journal;
|
$varlink = 'id_journal='.$id_journal;
|
||||||
|
$periodlink = '';
|
||||||
|
$exportlink = '';
|
||||||
|
|
||||||
journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||||
|
|
||||||
|
|||||||
@ -58,13 +58,21 @@ if ($in_bookkeeping == '') {
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
|
||||||
// Get informations of journal
|
// Get informations of journal
|
||||||
|
|||||||
@ -57,17 +57,25 @@ if ($in_bookkeeping == '') {
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('purchasesjournal'));
|
||||||
|
$parameters = array();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$hookmanager->initHooks(array('purchasesjournal'));
|
|
||||||
$parameters = array();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
|||||||
@ -59,13 +59,20 @@ if ($in_bookkeeping == '') {
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('sellsjournal'));
|
||||||
|
$parameters = array();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$hookmanager->initHooks(array('sellsjournal'));
|
|
||||||
$parameters = array();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -42,9 +42,15 @@ $codeventil = GETPOST('codeventil', 'int');
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -69,12 +69,23 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'clean' || $action == 'validatehistory') {
|
if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
|
||||||
// Clean database
|
// Clean database
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as fd";
|
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as fd";
|
||||||
|
|||||||
@ -80,16 +80,19 @@ if (!$sortorder) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->accounting->bind->write) {
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -88,14 +88,6 @@ if (!$sortorder) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if (!$user->rights->accounting->bind->write) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('accountancysupplierlist'));
|
$hookmanager->initHooks(array('accountancysupplierlist'));
|
||||||
|
|
||||||
@ -107,6 +99,17 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN
|
|||||||
|
|
||||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2020-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -178,7 +178,7 @@ if ($action == 'unset') {
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||||
|
|
||||||
llxHeader('', $langs->trans("MembersSetup"), $help_url);
|
llxHeader('', $langs->trans("MembersSetup"), $help_url);
|
||||||
|
|
||||||
@ -254,7 +254,8 @@ if ($conf->facture->enabled) {
|
|||||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
|
$selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||||
|
$form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -769,7 +769,7 @@ $formfile = new FormFile($db);
|
|||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
$title = $langs->trans("Member")." - ".$langs->trans("Card");
|
$title = $langs->trans("Member")." - ".$langs->trans("Card");
|
||||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||||
@ -1691,6 +1691,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
$isinspip = 0;
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
@ -1818,7 +1819,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
// Documents generes
|
// Generated documents
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
//$filename = 'tmp_cards.php';
|
//$filename = 'tmp_cards.php';
|
||||||
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
||||||
@ -1827,7 +1828,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
$genallowed = $user->rights->adherent->lire;
|
$genallowed = $user->rights->adherent->lire;
|
||||||
$delallowed = $user->rights->adherent->creer;
|
$delallowed = $user->rights->adherent->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);
|
||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
|
|||||||
@ -131,9 +131,8 @@ print '</div>';
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != 'ldap2dolibarr') {
|
if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != 'ldap2dolibarr') {
|
||||||
|
|||||||
@ -59,7 +59,7 @@ $title = $langs->trans("MembersStatisticsByProperties");
|
|||||||
|
|
||||||
print load_fiche_titre($title, '', $memberstatic->picto);
|
print load_fiche_titre($title, '', $memberstatic->picto);
|
||||||
|
|
||||||
dol_mkdir($dir);
|
//dol_mkdir($dir);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$head = member_stats_prepare_head($adh);
|
$head = member_stats_prepare_head($memberstatic);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'statsbyproperties', '', -1, '');
|
print dol_get_fiche_head($head, 'statsbyproperties', '', -1, '');
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ if (!$foundmor) {
|
|||||||
|
|
||||||
foreach ($data as $val) {
|
foreach ($data as $val) {
|
||||||
$nb = $val['nb'];
|
$nb = $val['nb'];
|
||||||
$nbsubscriptions = $val['nbsubscriptions'];
|
$nbsubscriptions = isset($val['nbsubscriptions']) ? $val['nbsubscriptions'] : 0;
|
||||||
$nbactive = $val['nbactive'];
|
$nbactive = $val['nbactive'];
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -78,7 +78,7 @@ llxHeader('', $title, '', '', 0, 0, $arrayjs);
|
|||||||
|
|
||||||
print load_fiche_titre($title, '', $memberstatic->picto);
|
print load_fiche_titre($title, '', $memberstatic->picto);
|
||||||
|
|
||||||
dol_mkdir($dir);
|
//dol_mkdir($dir);
|
||||||
|
|
||||||
if ($mode) {
|
if ($mode) {
|
||||||
// Define sql
|
// Define sql
|
||||||
@ -87,7 +87,7 @@ if ($mode) {
|
|||||||
$tab = 'statscountry';
|
$tab = 'statscountry';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label";
|
$sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||||
@ -103,7 +103,7 @@ if ($mode) {
|
|||||||
$tab = 'statsstate';
|
$tab = 'statsstate';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; //
|
$sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; //
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||||
@ -120,7 +120,7 @@ if ($mode) {
|
|||||||
$tab = 'statsregion'; //onglet
|
$tab = 'statsregion'; //onglet
|
||||||
|
|
||||||
$data = array(); //tableau de donnée
|
$data = array(); //tableau de donnée
|
||||||
$sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2";
|
$sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||||
@ -137,7 +137,7 @@ if ($mode) {
|
|||||||
$tab = 'statstown';
|
$tab = 'statstown';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2";
|
$sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||||
@ -207,7 +207,7 @@ if ($mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$head = member_stats_prepare_head($adh);
|
$head = member_stats_prepare_head($memberstatic);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, $tab, '', -1, '');
|
print dol_get_fiche_head($head, $tab, '', -1, '');
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ if ($mode) {
|
|||||||
print '<table class="liste centpercent">';
|
print '<table class="liste centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$label.'</td>';
|
print '<td>'.$label.'</td>';
|
||||||
if ($label2) {
|
if (isset($label2)) {
|
||||||
print '<td class="center">'.$label2.'</td>';
|
print '<td class="center">'.$label2.'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacitymedium">('.$langs->trans("AllTime").')</span></td>';
|
print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacitymedium">('.$langs->trans("AllTime").')</span></td>';
|
||||||
@ -308,10 +308,10 @@ if ($mode) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
foreach ($data as $val) {
|
foreach ($data as $val) {
|
||||||
$year = $val['year'];
|
$year = isset($val['year']) ? $val['year'] : '';;
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$val['label'].'</td>';
|
print '<td>'.$val['label'].'</td>';
|
||||||
if ($label2) {
|
if (isset($label2)) {
|
||||||
print '<td class="center">'.$val['label2'].'</td>';
|
print '<td class="center">'.$val['label2'].'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.$val['nb'].'</td>';
|
print '<td class="right">'.$val['nb'].'</td>';
|
||||||
|
|||||||
@ -137,7 +137,7 @@ if (!$mesg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$head = member_stats_prepare_head($adh);
|
$head = member_stats_prepare_head($memberstatic);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'statssubscription', '', -1, '');
|
print dol_get_fiche_head($head, 'statssubscription', '', -1, '');
|
||||||
|
|
||||||
|
|||||||
@ -639,7 +639,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action buttons
|
* Action bar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2)
|
// Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2)
|
||||||
|
|||||||
@ -349,8 +349,7 @@ if ($rowid && $action != 'edit') {
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
@ -373,7 +372,7 @@ if ($rowid && $action != 'edit') {
|
|||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
// Documents generes
|
// Generated documents
|
||||||
/*
|
/*
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
||||||
|
|||||||
@ -213,7 +213,8 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer) {
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
|
|
||||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||||
|
|
||||||
llxHeader('', $langs->trans("MembersTypeSetup"), $help_url);
|
llxHeader('', $langs->trans("MembersTypeSetup"), $help_url);
|
||||||
|
|
||||||
// List of members type
|
// List of members type
|
||||||
|
|||||||
@ -175,12 +175,9 @@ print dol_get_fiche_end();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/*
|
||||||
/* */
|
* Action bar
|
||||||
/* Barre d'action */
|
*/
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
|
|||||||
@ -330,16 +330,6 @@ if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// AGENDA_DEFAULT_VIEW
|
|
||||||
print '<tr class="oddeven">'."\n";
|
|
||||||
$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
|
|
||||||
print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
|
|
||||||
print '<td class="center"> </td>'."\n";
|
|
||||||
print '<td class="right">'."\n";
|
|
||||||
$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
|
||||||
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||||
print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->';
|
print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->';
|
||||||
print '<tr class="oddeven">'."\n";
|
print '<tr class="oddeven">'."\n";
|
||||||
@ -350,6 +340,16 @@ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
|||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AGENDA_DEFAULT_VIEW
|
||||||
|
print '<tr class="oddeven">'."\n";
|
||||||
|
$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
|
||||||
|
print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
|
||||||
|
print '<td class="center"> </td>'."\n";
|
||||||
|
print '<td class="right">'."\n";
|
||||||
|
$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
||||||
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// AGENDA_EVENT_DEFAULT_STATUS
|
// AGENDA_EVENT_DEFAULT_STATUS
|
||||||
print '<tr class="oddeven">'."\n";
|
print '<tr class="oddeven">'."\n";
|
||||||
print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n";
|
print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n";
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if ($action == 'setcoder') {
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formbarcode = new FormBarCode($db);
|
$formbarcode = new FormBarCode($db);
|
||||||
|
|
||||||
$help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra';
|
$help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra|DE:Modul_Barcode';
|
||||||
llxHeader('', $langs->trans("BarcodeSetup"), $help_url);
|
llxHeader('', $langs->trans("BarcodeSetup"), $help_url);
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
|||||||
@ -58,8 +58,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$help_url = 'EN:Module_DAV';
|
||||||
|
|
||||||
llxHeader('', $langs->trans("DAVSetup"), $wikihelp);
|
llxHeader('', $langs->trans("DAVSetup"), $help_url);
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("DAVSetup"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("DAVSetup"), $linkback, 'title_setup');
|
||||||
|
|||||||
@ -442,7 +442,7 @@ foreach ($configfileparameters as $key => $value) {
|
|||||||
print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
|
print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print ${$newkey};
|
print (empty(${$newkey}) ? '' : ${$newkey});
|
||||||
}
|
}
|
||||||
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
|
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
|
||||||
print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
|
print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
|
||||||
|
|||||||
@ -25,6 +25,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
@ -54,7 +55,12 @@ print load_fiche_titre($langs->trans("PHPSetup"), '', 'folder');
|
|||||||
|
|
||||||
// Get version of PHP
|
// Get version of PHP
|
||||||
$phpversion = version_php();
|
$phpversion = version_php();
|
||||||
print "<strong>PHP</strong> - ".$langs->trans("Version").": ".$phpversion."<br>\n";
|
print "<strong>PHP</strong>: ".$langs->trans("Version").": ".$phpversion;
|
||||||
|
if (function_exists('php_ini_loaded_file')) {
|
||||||
|
$inipath = php_ini_loaded_file();
|
||||||
|
print " - <strong>INI</strong>: ".$inipath;
|
||||||
|
}
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
// Get versionof web server
|
// Get versionof web server
|
||||||
print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
|
print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
|
||||||
@ -62,6 +68,35 @@ print '<br>';
|
|||||||
|
|
||||||
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0))."<br>\n";
|
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0))."<br>\n";
|
||||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."<br>\n";
|
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."<br>\n";
|
||||||
|
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0))."<br>\n";
|
||||||
|
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0))."<br>\n";
|
||||||
|
print "<strong>PHP disable_functions</strong> = ";
|
||||||
|
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
|
||||||
|
$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
|
||||||
|
$arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open,popen');
|
||||||
|
print join(', ', $arrayoffunctionsdisabled);
|
||||||
|
print "<br>\n";
|
||||||
|
$todisabletext = '';
|
||||||
|
foreach ($arrayoffunctionstodisable as $functiontodisable) {
|
||||||
|
if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
|
||||||
|
$todisabletext .= img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.$functiontodisable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($todisabletext) {
|
||||||
|
print $langs->trans("YouShouldDisablePHPFunctions").': '.$todisabletext;
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
$todisabletext = '';
|
||||||
|
foreach ($arrayoffunctionstodisable2 as $functiontodisable) {
|
||||||
|
if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
|
||||||
|
$todisabletext .= img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.$functiontodisable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($todisabletext) {
|
||||||
|
print $langs->trans("IfCLINotRequiredYouShouldDisablePHPFunctions").': '.$todisabletext;
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// XDebug
|
// XDebug
|
||||||
@ -110,6 +145,14 @@ $perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
|
|||||||
if ($perms) {
|
if ($perms) {
|
||||||
if (($perms & 0x0004) || ($perms & 0x0002)) {
|
if (($perms & 0x0004) || ($perms & 0x0002)) {
|
||||||
print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers");
|
print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers");
|
||||||
|
// Web user group by default
|
||||||
|
$labeluser = dol_getwebuser('user');
|
||||||
|
$labelgroup = dol_getwebuser('group');
|
||||||
|
print ' '.$langs->trans("User").': '.$labeluser.':'.$labelgroup;
|
||||||
|
if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
|
||||||
|
$arrayofinfoofuser = posix_getpwuid(posix_geteuid());
|
||||||
|
print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'tick');
|
print img_picto('', 'tick');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,13 +59,20 @@ print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>".DOL_DATA_ROOT."</td
|
|||||||
$labeluser = dol_getwebuser('user');
|
$labeluser = dol_getwebuser('user');
|
||||||
$labelgroup = dol_getwebuser('group');
|
$labelgroup = dol_getwebuser('group');
|
||||||
if ($labeluser && $labelgroup) {
|
if ($labeluser && $labelgroup) {
|
||||||
print '<tr><td>'.$langs->trans("WebUserGroup")." (env vars)</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n";
|
print '<tr><td>'.$langs->trans("WebUserGroup")." (env vars)</td><td>".$labeluser.':'.$labelgroup;
|
||||||
|
if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
|
||||||
|
$arrayofinfoofuser = posix_getpwuid(posix_geteuid());
|
||||||
|
print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span>';
|
||||||
|
}
|
||||||
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
// Web user group real (detected by 'id' external command)
|
// Web user group real (detected by 'id' external command)
|
||||||
$arrayout = array(); $varout = 0;
|
if (function_exists('exec')) {
|
||||||
exec('id', $arrayout, $varout);
|
$arrayout = array(); $varout = 0;
|
||||||
if (empty($varout)) { // Test command is ok. Work only on Linux OS.
|
exec('id', $arrayout, $varout);
|
||||||
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n";
|
if (empty($varout)) { // Test command is ok. Work only on Linux OS.
|
||||||
|
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -122,7 +122,8 @@ $utils = new Utils($db);
|
|||||||
|
|
||||||
if ($compression == 'zip') {
|
if ($compression == 'zip') {
|
||||||
$file .= '.zip';
|
$file .= '.zip';
|
||||||
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.back|\.old|\.log|[\\\/]temp[\\\/]|documents[\\\/]admin[\\\/]documents[\\\/])/i');
|
$excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
|
||||||
|
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles);
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
if ($ret == -2) {
|
if ($ret == -2) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@ -79,7 +79,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
|
|||||||
$permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
$permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||||
$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php
|
||||||
$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1];
|
$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -51,11 +51,6 @@ if (GETPOST('actioncode', 'array')) {
|
|||||||
}
|
}
|
||||||
$search_agenda_label = GETPOST('search_agenda_label');
|
$search_agenda_label = GETPOST('search_agenda_label');
|
||||||
|
|
||||||
// Security check - Protection if external user
|
|
||||||
//if ($user->socid > 0) accessforbidden();
|
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
|
||||||
//$result = restrictedArea($user, 'bom', $id);
|
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
@ -87,6 +82,11 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id;
|
$upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -75,8 +75,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
|||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0);
|
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php
|
||||||
|
|||||||
@ -79,6 +79,12 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object);
|
$upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -539,7 +539,7 @@ print '</tr>'."\n";
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
if ($key == 'status') {
|
if ($key == 'status') {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||||
@ -591,7 +591,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
// Show here line of result
|
// Show here line of result
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif ($key == 'status') {
|
} elseif ($key == 'status') {
|
||||||
|
|||||||
@ -57,9 +57,13 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id;
|
$upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissionnote = 1;
|
$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
|
||||||
//$permissionnote=$user->rights->bom->creer; // Used by the include of actions_setnotes.inc.php
|
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -63,24 +63,29 @@ class BOM extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
* 'label' the translation key.
|
* 'label' the translation key.
|
||||||
* 'enabled' is a condition when the field must be managed.
|
* 'picto' is code of a picto to show before value in forms
|
||||||
|
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||||
|
* 'position' is the sort order of field.
|
||||||
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||||
* 'noteditable' says if field is not editable (1 or 0)
|
* 'noteditable' says if field is not editable (1 or 0)
|
||||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||||
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
|
|
||||||
* 'index' if we want an index in database.
|
* 'index' if we want an index in database.
|
||||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||||
* 'position' is the sort order of field.
|
|
||||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||||
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200'
|
||||||
* 'help' is a string visible as a tooltip on field
|
* 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
|
||||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||||
|
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||||
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||||
|
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||||
|
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||||
|
*
|
||||||
|
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// BEGIN MODULEBUILDER PROPERTIES
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
@ -92,7 +97,7 @@ class BOM extends CommonObject
|
|||||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
|
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
|
||||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
|
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
|
||||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
|
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
|
||||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble')),
|
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150'),
|
||||||
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
|
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
|
||||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'),
|
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'),
|
||||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||||
|
|||||||
@ -97,7 +97,7 @@ $error = 0;
|
|||||||
|
|
||||||
// Add action
|
// Add action
|
||||||
if ($action == 'add' && $user->rights->categorie->creer) {
|
if ($action == 'add' && $user->rights->categorie->creer) {
|
||||||
// Action ajout d'une categorie
|
// Action add a category
|
||||||
if ($cancel) {
|
if ($cancel) {
|
||||||
if ($urlfrom) {
|
if ($urlfrom) {
|
||||||
header("Location: ".$urlfrom);
|
header("Location: ".$urlfrom);
|
||||||
@ -167,7 +167,7 @@ if ($action == 'add' && $user->rights->categorie->creer) {
|
|||||||
|
|
||||||
// Confirm action
|
// Confirm action
|
||||||
if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->creer) {
|
if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->creer) {
|
||||||
// Action confirmation de creation categorie
|
// Action confirmation of creation category
|
||||||
if ($action == 'confirmed') {
|
if ($action == 'confirmed') {
|
||||||
if ($urlfrom) {
|
if ($urlfrom) {
|
||||||
header("Location: ".$urlfrom);
|
header("Location: ".$urlfrom);
|
||||||
@ -208,7 +208,7 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
$helpurl = '';
|
$helpurl = 'EN:Module_Categories|FR:Module_Catégories';
|
||||||
llxHeader("", $langs->trans("Categories"), $helpurl);
|
llxHeader("", $langs->trans("Categories"), $helpurl);
|
||||||
|
|
||||||
if ($user->rights->categorie->creer) {
|
if ($user->rights->categorie->creer) {
|
||||||
|
|||||||
@ -153,12 +153,9 @@ if ($object->id) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/*
|
||||||
/* */
|
* Action bar
|
||||||
/* Barre d'action */
|
*/
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
print '<div class="tabsAction">'."\n";
|
print '<div class="tabsAction">'."\n";
|
||||||
|
|
||||||
if ($action != 'ajout_photo' && $user->rights->categorie->creer) {
|
if ($action != 'ajout_photo' && $user->rights->categorie->creer) {
|
||||||
|
|||||||
@ -224,12 +224,9 @@ print dol_get_fiche_end();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/*
|
||||||
/* */
|
* Action bar
|
||||||
/* Barre d'action */
|
*/
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
|
|||||||
@ -2121,9 +2121,8 @@ if ($id > 0) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
@ -2161,7 +2160,7 @@ if ($id > 0) {
|
|||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents generes
|
* Generated documents
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$filedir = $conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
$filedir = $conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||||
|
|||||||
@ -743,7 +743,7 @@ class ActionComm extends CommonObject
|
|||||||
$sql .= " a.fk_element as elementid, a.elementtype,";
|
$sql .= " a.fk_element as elementid, a.elementtype,";
|
||||||
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
|
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
|
||||||
$sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,";
|
$sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,";
|
||||||
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
|
$sql .= " c.id as type_id, c.type as type_type, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
|
||||||
$sql .= " s.nom as socname,";
|
$sql .= " s.nom as socname,";
|
||||||
$sql .= " u.firstname, u.lastname as lastname,";
|
$sql .= " u.firstname, u.lastname as lastname,";
|
||||||
$sql .= " num_vote, event_paid, a.status";
|
$sql .= " num_vote, event_paid, a.status";
|
||||||
@ -779,8 +779,9 @@ class ActionComm extends CommonObject
|
|||||||
$this->type_code = $obj->type_code;
|
$this->type_code = $obj->type_code;
|
||||||
$this->type_color = $obj->type_color;
|
$this->type_color = $obj->type_color;
|
||||||
$this->type_picto = $obj->type_picto;
|
$this->type_picto = $obj->type_picto;
|
||||||
$transcode = $langs->trans("Action".$obj->type_code);
|
$this->type = $obj->type_type;
|
||||||
$this->type = (($transcode != "Action".$obj->type_code) ? $transcode : $obj->type_label);
|
/*$transcode = $langs->trans("Action".$obj->type_code);
|
||||||
|
$this->type = (($transcode != "Action".$obj->type_code) ? $transcode : $obj->type_label); */
|
||||||
$transcode = $langs->trans("Action".$obj->type_code.'Short');
|
$transcode = $langs->trans("Action".$obj->type_code.'Short');
|
||||||
$this->type_short = (($transcode != "Action".$obj->type_code.'Short') ? $transcode : '');
|
$this->type_short = (($transcode != "Action".$obj->type_code.'Short') ? $transcode : '');
|
||||||
|
|
||||||
|
|||||||
@ -1138,7 +1138,11 @@ if (count($listofextcals)) {
|
|||||||
if (isset($icalevent['DTSTART;VALUE=DATE'])) { // fullday event
|
if (isset($icalevent['DTSTART;VALUE=DATE'])) { // fullday event
|
||||||
// For full day events, date are also GMT but they wont but converted using tz during output
|
// For full day events, date are also GMT but they wont but converted using tz during output
|
||||||
$datestart = dol_stringtotime($icalevent['DTSTART;VALUE=DATE'], 1);
|
$datestart = dol_stringtotime($icalevent['DTSTART;VALUE=DATE'], 1);
|
||||||
$dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1; // We remove one second to get last second of day
|
if (empty($icalevent['DTEND;VALUE=DATE'])) {
|
||||||
|
$dateend = $datestart + 86400 - 1;
|
||||||
|
} else {
|
||||||
|
$dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1; // We remove one second to get last second of day
|
||||||
|
}
|
||||||
//print 'x'.$datestart.'-'.$dateend;exit;
|
//print 'x'.$datestart.'-'.$dateend;exit;
|
||||||
//print dol_print_date($dateend,'dayhour','gmt');
|
//print dol_print_date($dateend,'dayhour','gmt');
|
||||||
$event->fulldayevent = 1;
|
$event->fulldayevent = 1;
|
||||||
@ -1212,7 +1216,7 @@ if (count($listofextcals)) {
|
|||||||
// LOW = 0 to 4
|
// LOW = 0 to 4
|
||||||
// MEDIUM = 5
|
// MEDIUM = 5
|
||||||
// HIGH = 6 to 9
|
// HIGH = 6 to 9
|
||||||
if ($icalevent['PRIORITY']) {
|
if (!empty($icalevent['PRIORITY'])) {
|
||||||
$event->priority = $icalevent['PRIORITY'];
|
$event->priority = $icalevent['PRIORITY'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1233,7 +1237,7 @@ if (count($listofextcals)) {
|
|||||||
// X-MICROSOFT-CDO-BUSYSTATUS:OOF + TRANSP:OPAQUE => Away from the office / off-site
|
// X-MICROSOFT-CDO-BUSYSTATUS:OOF + TRANSP:OPAQUE => Away from the office / off-site
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($icalevent['LOCATION']) {
|
if (!empty($icalevent['LOCATION'])) {
|
||||||
$event->location = $icalevent['LOCATION'];
|
$event->location = $icalevent['LOCATION'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -305,7 +305,9 @@ $title = $langs->trans("CustomerCard");
|
|||||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||||
$title = $object->name;
|
$title = $object->name;
|
||||||
}
|
}
|
||||||
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
|
||||||
|
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Geschäftspartner';
|
||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
|
||||||
@ -1334,9 +1336,8 @@ if ($object->id > 0) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|||||||
@ -441,7 +441,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
|||||||
* Draft purchase orders
|
* Draft purchase orders
|
||||||
*/
|
*/
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||||
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status";
|
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
|
||||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||||
@ -485,7 +485,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
|
|
||||||
$supplierorderstatic->id = $obj->rowid;
|
$supplierorderstatic->id = $obj->rowid;
|
||||||
$supplierorderstatic->ref = $obj->ref;
|
$supplierorderstatic->ref = $obj->ref;
|
||||||
$supplierorderstatic->ref_supplier = $obj->ref_suppliert;
|
$supplierorderstatic->ref_supplier = $obj->ref_supplier;
|
||||||
$supplierorderstatic->total_ht = $obj->total_ht;
|
$supplierorderstatic->total_ht = $obj->total_ht;
|
||||||
$supplierorderstatic->total_tva = $obj->total_tva;
|
$supplierorderstatic->total_tva = $obj->total_tva;
|
||||||
$supplierorderstatic->total_ttc = $obj->total_ttc;
|
$supplierorderstatic->total_ttc = $obj->total_ttc;
|
||||||
@ -882,7 +882,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
|||||||
|
|
||||||
$filename = dol_sanitizeFileName($obj->ref);
|
$filename = dol_sanitizeFileName($obj->ref);
|
||||||
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
|
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
//$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
||||||
$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
|
$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -998,7 +998,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
|||||||
|
|
||||||
$filename = dol_sanitizeFileName($obj->ref);
|
$filename = dol_sanitizeFileName($obj->ref);
|
||||||
$filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
$filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
//$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
||||||
//$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
|
//$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -1013,7 +1013,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||||
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
|
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dv), 'day').'</td>';
|
||||||
print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||||
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
|
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
|
||||||
|
|
||||||
|
|||||||
@ -1425,7 +1425,7 @@ if (!empty($conf->projet->enabled)) {
|
|||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
|
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos|DE:Modul_Angebote';
|
||||||
llxHeader('', $langs->trans('Proposal'), $help_url);
|
llxHeader('', $langs->trans('Proposal'), $help_url);
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@ -2602,7 +2602,7 @@ if ($action == 'create') {
|
|||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
/*
|
/*
|
||||||
* Documents generes
|
* Generated documents
|
||||||
*/
|
*/
|
||||||
$objref = dol_sanitizeFileName($object->ref);
|
$objref = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->propal->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
|
$filedir = $conf->propal->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
|
||||||
|
|||||||
@ -81,7 +81,7 @@ $langs->loadLangs(array('propal', 'other', 'companies'));
|
|||||||
if ($mode == 'customer') {
|
if ($mode == 'customer') {
|
||||||
$picto = 'propal';
|
$picto = 'propal';
|
||||||
$title = $langs->trans("ProposalsStatistics");
|
$title = $langs->trans("ProposalsStatistics");
|
||||||
$dir = $conf->propale->dir_temp;
|
$dir = $conf->propal->dir_temp;
|
||||||
$cat_type = Categorie::TYPE_CUSTOMER;
|
$cat_type = Categorie::TYPE_CUSTOMER;
|
||||||
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
|
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1393,7 +1393,7 @@ if (empty($reshook)) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
|
llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
|||||||
@ -2265,6 +2265,7 @@ class Commande extends CommonOrder
|
|||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||||
$sql .= ', '.MAIN_DB_PREFIX.'element_element as el';
|
$sql .= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||||
$sql .= ' WHERE el.fk_source = '.$this->id;
|
$sql .= ' WHERE el.fk_source = '.$this->id;
|
||||||
|
$sql .= " AND el.sourcetype = 'commande'";
|
||||||
$sql .= " AND el.fk_target = e.rowid";
|
$sql .= " AND el.fk_target = e.rowid";
|
||||||
$sql .= " AND el.targettype = 'shipping'";
|
$sql .= " AND el.targettype = 'shipping'";
|
||||||
|
|
||||||
@ -3686,7 +3687,7 @@ class Commande extends CommonOrder
|
|||||||
$label .= ' '.$this->getLibStatut(5);
|
$label .= ' '.$this->getLibStatut(5);
|
||||||
}
|
}
|
||||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
|
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
|
||||||
if (!empty($this->total_ht)) {
|
if (!empty($this->total_ht)) {
|
||||||
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -644,20 +643,21 @@ if ($search_description) {
|
|||||||
}
|
}
|
||||||
$sql .= natural_search("b.label", $search_description_to_use); // Warning some text are just translation keys, not translated strings
|
$sql .= natural_search("b.label", $search_description_to_use); // Warning some text are just translation keys, not translated strings
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_bid > 0) {
|
if ($search_bid > 0) {
|
||||||
$sql .= " AND b.rowid=l.lineid AND l.fk_categ=".$search_bid;
|
$sql .= " AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
|
||||||
}
|
}
|
||||||
if (!empty($search_type)) {
|
if (!empty($search_type)) {
|
||||||
$sql .= " AND b.fk_type = '".$db->escape($search_type)."' ";
|
$sql .= " AND b.fk_type = '".$db->escape($search_type)."'";
|
||||||
}
|
}
|
||||||
// Search criteria amount
|
// Search criteria amount
|
||||||
$search_debit = price2num(str_replace('-', '', $search_debit));
|
|
||||||
$search_credit = price2num(str_replace('-', '', $search_credit));
|
|
||||||
if ($search_debit) {
|
if ($search_debit) {
|
||||||
$sql .= natural_search('- b.amount', $search_debit, 1);
|
$sql .= natural_search('ABS(b.amount)', $search_debit, 1);
|
||||||
|
$sql .= ' AND b.amount <= 0';
|
||||||
}
|
}
|
||||||
if ($search_credit) {
|
if ($search_credit) {
|
||||||
$sql .= natural_search('b.amount', $search_credit, 1);
|
$sql .= natural_search('b.amount', $search_credit, 1);
|
||||||
|
$sql .= ' AND b.amount >= 0';
|
||||||
}
|
}
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
|
|||||||
@ -54,12 +54,6 @@ $langs->loadLangs(array("banks", "bills", "categories", "companies", "compta"));
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
|
||||||
// Security check
|
|
||||||
$id = GETPOST("id", 'int') ? GETPOST("id", 'int') : GETPOST('ref', 'alpha');
|
|
||||||
$fieldid = GETPOSTISSET("ref") ? 'ref' : 'rowid';
|
|
||||||
|
|
||||||
$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
|
|
||||||
|
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
@ -69,6 +63,12 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('bankcard', 'globalcard'));
|
$hookmanager->initHooks(array('bankcard', 'globalcard'));
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$id = GETPOST("id", 'int') ? GETPOST("id", 'int') : GETPOST('ref', 'alpha');
|
||||||
|
$fieldid = GETPOSTISSET("ref") ? 'ref' : 'rowid';
|
||||||
|
$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -305,7 +305,7 @@ if (!empty($conf->accounting->enabled)) {
|
|||||||
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||||
|
|
||||||
$title = $langs->trans("FinancialAccount")." - ".$langs->trans("Card");
|
$title = $langs->trans("FinancialAccount")." - ".$langs->trans("Card");
|
||||||
$helpurl = "";
|
$helpurl = "EN:Module_Banks_and_Cash";
|
||||||
llxHeader("", $title, $helpurl);
|
llxHeader("", $title, $helpurl);
|
||||||
|
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ if ($action == 'create') {
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
@ -904,7 +904,7 @@ if ($action == 'create') {
|
|||||||
} elseif ($conciliate == -3) {
|
} elseif ($conciliate == -3) {
|
||||||
print $langs->trans("No").' ('.$langs->trans("Closed").')';
|
print $langs->trans("No").' ('.$langs->trans("Closed").')';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="checkbox" class="flat" name="norappro"'.(($conciliate > 0) ? '' : ' checked="checked"').'"> '.$langs->trans("DisableConciliation");
|
print '<input type="checkbox" class="flat" id="norappro" name="norappro"'.(($conciliate > 0) ? '' : ' checked="checked"').'"> <label for="norappro">'.$langs->trans("DisableConciliation").'</label>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -71,6 +71,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', '');
|
$result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', '');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,18 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|||||||
$langs->loadLangs(array('banks', 'categories', 'companies'));
|
$langs->loadLangs(array('banks', 'categories', 'companies'));
|
||||||
|
|
||||||
$id = GETPOST("rowid", 'int');
|
$id = GETPOST("rowid", 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||||
|
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $fieldtype);
|
||||||
|
if (!$user->rights->banque->lire && !$user->rights->banque->consolidate) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -62,6 +62,7 @@ if (!empty($conf->categorie->enabled)) {
|
|||||||
$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array");
|
$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$socid = 0;
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -33,7 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("banks", "categories", "multicurrency"));
|
$langs->loadLangs(array("banks", "categories", "multicurrency"));
|
||||||
|
$socid = 0;
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
if (!$user->rights->banque->transfer) {
|
if (!$user->rights->banque->transfer) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
@ -230,6 +233,7 @@ $account_from = '';
|
|||||||
$account_to = '';
|
$account_to = '';
|
||||||
$label = '';
|
$label = '';
|
||||||
$amount = '';
|
$amount = '';
|
||||||
|
$amountto = '';
|
||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$account_from = GETPOST('account_from', 'int');
|
$account_from = GETPOST('account_from', 'int');
|
||||||
|
|||||||
@ -37,22 +37,23 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|||||||
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies'));
|
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (isset($_GET["account"]) || isset($_GET["ref"])) {
|
if (GETPOSTISSET("account") || GETPOSTISSET("ref")) {
|
||||||
$id = isset($_GET["account"]) ? $_GET["account"] : (isset($_GET["ref"]) ? $_GET["ref"] : '');
|
$id = GETPOSTISSET("account") ? GETPOST("account") : (GETPOSTISSET("ref") ? GETPOST("ref") : '');
|
||||||
}
|
}
|
||||||
$fieldid = isset($_GET["ref"]) ? 'ref' : 'rowid';
|
$fieldid = GETPOSTISSET("ref") ? 'ref' : 'rowid';
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
|
$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
|
||||||
|
|
||||||
|
|
||||||
$vline = isset($_GET["vline"]) ? $_GET["vline"] : $_POST["vline"];
|
$vline = GETPOST('vline');
|
||||||
$page = isset($_GET["page"]) ? $_GET["page"] : 0;
|
$page = GETPOSTISSET("page") ? GETPOST("page") : 0;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('banktreso', 'globalcard'));
|
$hookmanager->initHooks(array('banktreso', 'globalcard'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -68,7 +69,7 @@ $socialcontribstatic = new ChargeSociales($db);
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if ($_REQUEST["account"] || $_REQUEST["ref"]) {
|
if (GETPOST("account") || GETPOST("ref")) {
|
||||||
if ($vline) {
|
if ($vline) {
|
||||||
$viewline = $vline;
|
$viewline = $vline;
|
||||||
} else {
|
} else {
|
||||||
@ -76,11 +77,11 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
if ($_GET["account"]) {
|
if (GETPOST("account", 'int')) {
|
||||||
$result = $object->fetch($_GET["account"]);
|
$result = $object->fetch(GETPOST("account", 'int'));
|
||||||
}
|
}
|
||||||
if ($_GET["ref"]) {
|
if (GETPOST("ref")) {
|
||||||
$result = $object->fetch(0, $_GET["ref"]);
|
$result = $object->fetch(0, GETPOST("ref"));
|
||||||
$_GET["account"] = $object->id;
|
$_GET["account"] = $object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +92,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) {
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|||||||
@ -665,7 +665,7 @@ if ($id) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action buttons
|
* Action bar
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">'."\n";
|
print '<div class="tabsAction">'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -67,11 +67,6 @@ if ($contextpage == 'takepos') {
|
|||||||
$_GET['optioncss'] = 'print';
|
$_GET['optioncss'] = 'print';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
|
||||||
if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$arrayofpaymentmode = array('cash'=>'Cash', 'cheque'=>'Cheque', 'card'=>'CreditCard');
|
$arrayofpaymentmode = array('cash'=>'Cash', 'cheque'=>'Cheque', 'card'=>'CreditCard');
|
||||||
|
|
||||||
$arrayofposavailable = array();
|
$arrayofposavailable = array();
|
||||||
@ -95,6 +90,15 @@ $hookmanager->initHooks(array('cashcontrolcard', 'globalcard'));
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
//$socid = $user->socid;
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -94,14 +94,6 @@ if (!$sortorder) {
|
|||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = 0;
|
|
||||||
if ($user->socid > 0) { // Protection if external user
|
|
||||||
//$socid = $user->socid;
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
//$result = restrictedArea($user, 'monmodule', $id, '');
|
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = GETPOST("search_all", 'alpha');
|
$search_all = GETPOST("search_all", 'alpha');
|
||||||
$search = array();
|
$search = array();
|
||||||
@ -133,6 +125,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|||||||
$object->fields = dol_sort_array($object->fields, 'position');
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
//$socid = $user->socid;
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -72,6 +72,15 @@ $sday = $cashcontrol->day_close;
|
|||||||
$posmodule = $cashcontrol->posmodule;
|
$posmodule = $cashcontrol->posmodule;
|
||||||
$terminalid = $cashcontrol->posnumber;
|
$terminalid = $cashcontrol->posnumber;
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
//$socid = $user->socid;
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -463,9 +463,8 @@ if ($action == 'create') {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded
|
if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded
|
||||||
|
|||||||
@ -65,7 +65,6 @@ $objecttype = 'facture_rec';
|
|||||||
if ($action == "create" || $action == "add") {
|
if ($action == "create" || $action == "add") {
|
||||||
$objecttype = '';
|
$objecttype = '';
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'facture', $id, $objecttype);
|
|
||||||
$projectid = GETPOST('projectid', 'int');
|
$projectid = GETPOST('projectid', 'int');
|
||||||
|
|
||||||
$year_date_when = GETPOST('year_date_when');
|
$year_date_when = GETPOST('year_date_when');
|
||||||
@ -127,6 +126,8 @@ $now = dol_now();
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$result = restrictedArea($user, 'facture', $object->id, $objecttype);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -1634,8 +1635,8 @@ if ($action == 'create') {
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Barre d'actions
|
* Action bar
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
|||||||
@ -138,19 +138,19 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.i
|
|||||||
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdonw.inc.php
|
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdonw.inc.php
|
||||||
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php
|
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
// retained warranty invoice available type
|
||||||
|
$retainedWarrantyInvoiceAvailableType = array();
|
||||||
|
if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
|
||||||
|
$retainedWarrantyInvoiceAvailableType = explode('+', $conf->global->INVOICE_USE_RETAINED_WARRANTY);
|
||||||
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
|
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||||
|
|
||||||
// retained warranty invoice available type
|
|
||||||
$retainedWarrantyInvoiceAvailableType = array();
|
|
||||||
if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
|
|
||||||
$retainedWarrantyInvoiceAvailableType = explode('+', $conf->global->INVOICE_USE_RETAINED_WARRANTY);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5459,7 +5459,7 @@ if ($action == 'create') {
|
|||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
// Documents generes
|
// Generated documents
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->facture->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
$filedir = $conf->facture->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?facid='.$object->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?facid='.$object->id;
|
||||||
|
|||||||
@ -1543,6 +1543,13 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global $action, $hookmanager;
|
||||||
|
$hookmanager->initHooks(array('invoicedao'));
|
||||||
|
$parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target);
|
||||||
|
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook > 0) $result = $hookmanager->resPrint;
|
||||||
|
else $result .= $hookmanager->resPrint;
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1553,7 +1560,7 @@ class Facture extends CommonInvoice
|
|||||||
* @param string $ref Reference of invoice
|
* @param string $ref Reference of invoice
|
||||||
* @param string $ref_ext External reference of invoice
|
* @param string $ref_ext External reference of invoice
|
||||||
* @param int $notused Not used
|
* @param int $notused Not used
|
||||||
* @param bool $fetch_situation Fetch the previous and next situation in $tab_previous_situation_invoice and $tab_next_situation_invoice
|
* @param bool $fetch_situation Load also the previous and next situation invoice into $tab_previous_situation_invoice and $tab_next_situation_invoice
|
||||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||||
*/
|
*/
|
||||||
public function fetch($rowid, $ref = '', $ref_ext = '', $notused = '', $fetch_situation = false)
|
public function fetch($rowid, $ref = '', $ref_ext = '', $notused = '', $fetch_situation = false)
|
||||||
|
|||||||
@ -48,9 +48,14 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'facture', $id);
|
|
||||||
|
|
||||||
$object = new Facture($db);
|
$object = new Facture($db);
|
||||||
|
// Load object
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = restrictedArea($user, 'facture', $object->id);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -58,8 +63,6 @@ $object = new Facture($db);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'addcontact' && $user->rights->facture->creer) {
|
if ($action == 'addcontact' && $user->rights->facture->creer) {
|
||||||
$result = $object->fetch($id);
|
|
||||||
|
|
||||||
if ($result > 0 && $id > 0) {
|
if ($result > 0 && $id > 0) {
|
||||||
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||||
@ -79,14 +82,9 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
|
|||||||
}
|
}
|
||||||
} elseif ($action == 'swapstatut' && $user->rights->facture->creer) {
|
} elseif ($action == 'swapstatut' && $user->rights->facture->creer) {
|
||||||
// Toggle the status of a contact
|
// Toggle the status of a contact
|
||||||
if ($object->fetch($id)) {
|
$result = $object->swapContactStatus(GETPOST('ligne'));
|
||||||
$result = $object->swapContactStatus(GETPOST('ligne'));
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
} elseif ($action == 'deletecontact' && $user->rights->facture->creer) {
|
} elseif ($action == 'deletecontact' && $user->rights->facture->creer) {
|
||||||
// Deletes a contact
|
// Deletes a contact
|
||||||
$object->fetch($id);
|
|
||||||
$result = $object->delete_contact($lineid);
|
$result = $object->delete_contact($lineid);
|
||||||
|
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
|
|||||||
@ -48,12 +48,6 @@ $socid = GETPOST('socid', 'int');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'facture', $id, '');
|
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -73,11 +67,17 @@ if (!$sortfield) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$object = new Facture($db);
|
$object = new Facture($db);
|
||||||
if ($object->fetch($id)) {
|
if ($object->fetch($id, $ref)) {
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'facture', $object->id, '');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -38,6 +38,25 @@ $langs->loadLangs(array('companies', 'bills'));
|
|||||||
$id = GETPOST("facid", "int");
|
$id = GETPOST("facid", "int");
|
||||||
$ref = GETPOST("ref", 'alpha');
|
$ref = GETPOST("ref", 'alpha');
|
||||||
|
|
||||||
|
$object = new Facture($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -46,11 +65,10 @@ $ref = GETPOST("ref", 'alpha');
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
|
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
|
||||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||||
llxHeader('', $title, $helpurl);
|
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$object = new Facture($db);
|
|
||||||
$object->fetch($id, $ref);
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$object->info($object->id);
|
$object->info($object->id);
|
||||||
|
|||||||
@ -165,6 +165,11 @@ if ($socid > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$objecttype = 'facture_rec';
|
||||||
|
|
||||||
|
$result = restrictedArea($user, 'facture', $object->id, $objecttype);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -187,7 +187,7 @@ if (empty($user->socid)) {
|
|||||||
$checkedtypetiers = 0;
|
$checkedtypetiers = 0;
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
||||||
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1, 'position'=>10),
|
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1, 'position'=>10),
|
||||||
'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15),
|
'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15),
|
||||||
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20),
|
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20),
|
||||||
'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22),
|
'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22),
|
||||||
@ -204,8 +204,8 @@ $arrayfields = array(
|
|||||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
|
||||||
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
|
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
|
||||||
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
|
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
|
||||||
'f.module_source'=>array('label'=>"Module", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>($conf->cashdesk->enabled || $conf->takepos->enabled || $conf->global->INVOICE_SHOW_POS), 'position'=>90),
|
'f.module_source'=>array('label'=>"Module", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>90),
|
||||||
'f.pos_source'=>array('label'=>"Terminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>($conf->cashdesk->enabled || $conf->takepos->enabled || $conf->global->INVOICE_SHOW_POS), 'position'=>91),
|
'f.pos_source'=>array('label'=>"Terminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>91),
|
||||||
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
|
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
|
||||||
'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
||||||
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110),
|
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110),
|
||||||
@ -493,6 +493,10 @@ if ($search_user > 0) {
|
|||||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||||
}
|
}
|
||||||
|
// Add table from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= ' WHERE f.fk_soc = s.rowid';
|
$sql .= ' WHERE f.fk_soc = s.rowid';
|
||||||
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
|
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||||
@ -689,10 +693,19 @@ if (!$sall) {
|
|||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Add GroupBy from hooks
|
||||||
|
$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= $hookmanager->resPrint;
|
||||||
} else {
|
} else {
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add HAVING from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : '';
|
||||||
|
|
||||||
$sql .= ' ORDER BY ';
|
$sql .= ' ORDER BY ';
|
||||||
$listfield = explode(',', $sortfield);
|
$listfield = explode(',', $sortfield);
|
||||||
$listorder = explode(',', $sortorder);
|
$listorder = explode(',', $sortorder);
|
||||||
@ -865,6 +878,10 @@ if ($resql) {
|
|||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'validate'=>$langs->trans("Validate"),
|
'validate'=>$langs->trans("Validate"),
|
||||||
|
|||||||
@ -41,6 +41,14 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
|
$object = new Facture($db);
|
||||||
|
// Load object
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
@ -48,11 +56,6 @@ if ($user->socid) {
|
|||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'facture', $id, '');
|
$result = restrictedArea($user, 'facture', $id, '');
|
||||||
|
|
||||||
$object = new Facture($db);
|
|
||||||
$object->fetch($id);
|
|
||||||
|
|
||||||
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -272,6 +272,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier, f.fk_statut as status, f.paye";
|
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier, f.fk_statut as status, f.paye";
|
||||||
$sql .= ", s.nom as name";
|
$sql .= ", s.nom as name";
|
||||||
$sql .= ", s.rowid as socid, s.email";
|
$sql .= ", s.rowid as socid, s.email";
|
||||||
|
$sql .= ", s.code_client, s.code_compta";
|
||||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur";
|
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur";
|
||||||
$sql .= ", cc.rowid as country_id, cc.code as country_code";
|
$sql .= ", cc.rowid as country_id, cc.code as country_code";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays";
|
||||||
|
|||||||
@ -266,7 +266,7 @@ if ($id) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action buttons
|
* Action bar
|
||||||
*/
|
*/
|
||||||
print "<div class=\"tabsAction\">\n";
|
print "<div class=\"tabsAction\">\n";
|
||||||
if ($object->rappro == 0) {
|
if ($object->rappro == 0) {
|
||||||
|
|||||||
@ -227,7 +227,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
|
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
|
||||||
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
|
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'">'.GETPOST('note', 'alphanohtml').'</textarea></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -279,7 +279,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
$remaintopay = $objp->amount - $sumpaid;
|
$remaintopay = $objp->amount - $sumpaid;
|
||||||
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">';
|
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'" value="'.GETPOST('amount_'.$objp->id, 'alpha').'">';
|
||||||
} else {
|
} else {
|
||||||
print '-';
|
print '-';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -225,12 +225,9 @@ if ($id) {
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/*
|
||||||
/* */
|
* Action bar
|
||||||
/* Barre d'action */
|
*/
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
print "<div class=\"tabsAction\">";
|
print "<div class=\"tabsAction\">";
|
||||||
|
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
|
|||||||
@ -49,18 +49,6 @@ $date_endday = GETPOST('date_endday', 'int');
|
|||||||
$date_endyear = GETPOST('date_endyear', 'int');
|
$date_endyear = GETPOST('date_endyear', 'int');
|
||||||
$showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ?GETPOST('showaccountdetail', 'aZ09') : 'no';
|
$showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ?GETPOST('showaccountdetail', 'aZ09') : 'no';
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = GETPOST('socid', 'int');
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
if (!empty($conf->comptabilite->enabled)) {
|
|
||||||
$result = restrictedArea($user, 'compta', '', '', 'resultat');
|
|
||||||
}
|
|
||||||
if (!empty($conf->accounting->enabled)) {
|
|
||||||
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
|
||||||
}
|
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
@ -151,6 +139,17 @@ if (GETPOST("modecompta", 'alpha')) {
|
|||||||
|
|
||||||
$AccCat = new AccountancyCategory($db);
|
$AccCat = new AccountancyCategory($db);
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
if (!empty($conf->comptabilite->enabled)) {
|
||||||
|
$result = restrictedArea($user, 'compta', '', '', 'resultat');
|
||||||
|
}
|
||||||
|
if (!empty($conf->accounting->enabled)) {
|
||||||
|
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -108,6 +108,14 @@ $year_end = $tmpe['year'];
|
|||||||
$nbofyear = ($year_end - $year_start) + 1;
|
$nbofyear = ($year_end - $year_start) + 1;
|
||||||
//var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour'));
|
//var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour'));
|
||||||
|
|
||||||
|
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
|
||||||
|
$modecompta = $conf->global->ACCOUNTING_MODE;
|
||||||
|
if (!empty($conf->accounting->enabled)) {
|
||||||
|
$modecompta = 'BOOKKEEPING';
|
||||||
|
}
|
||||||
|
if (GETPOST("modecompta", 'alpha')) {
|
||||||
|
$modecompta = GETPOST("modecompta", 'alpha');
|
||||||
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
@ -121,15 +129,6 @@ if (!empty($conf->accounting->enabled)) {
|
|||||||
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
|
|
||||||
$modecompta = $conf->global->ACCOUNTING_MODE;
|
|
||||||
if (!empty($conf->accounting->enabled)) {
|
|
||||||
$modecompta = 'BOOKKEEPING';
|
|
||||||
}
|
|
||||||
if (GETPOST("modecompta", 'alpha')) {
|
|
||||||
$modecompta = GETPOST("modecompta", 'alpha');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -144,16 +144,20 @@ if (GETPOST("modecompta")) {
|
|||||||
$modecompta = GETPOST("modecompta", 'alpha');
|
$modecompta = GETPOST("modecompta", 'alpha');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
if (!$user->rights->accounting->comptarapport->lire) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$AccCat = new AccountancyCategory($db);
|
$AccCat = new AccountancyCategory($db);
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
if (!empty($conf->comptabilite->enabled)) {
|
||||||
|
$result = restrictedArea($user, 'compta', '', '', 'resultat');
|
||||||
|
}
|
||||||
|
if (!empty($conf->accounting->enabled)) {
|
||||||
|
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $langs->loadLangs(array('compta', 'bills', 'banks', 'hrm'));
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
|
||||||
|
|
||||||
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
|
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
|
||||||
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
|
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
|
||||||
@ -93,7 +93,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) {
|
|||||||
// Link to a project
|
// Link to a project
|
||||||
if ($action == 'classin' && $user->rights->tax->charges->creer) {
|
if ($action == 'classin' && $user->rights->tax->charges->creer) {
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->setProject(GETPOST('projectid'));
|
$object->setProject(GETPOST('fk_project'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setfk_user' && $user->rights->tax->charges->creer) {
|
if ($action == 'setfk_user' && $user->rights->tax->charges->creer) {
|
||||||
@ -360,20 +360,20 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||||
|
|
||||||
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1);
|
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payment Mode
|
// Payment Mode
|
||||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
||||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
$form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
||||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 2, '', 0, '', 1);
|
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ if ($id > 0) {
|
|||||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref .= '</form>';
|
$morehtmlref .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -44,16 +44,16 @@ $modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') :
|
|||||||
$year = GETPOST("year", 'int');
|
$year = GETPOST("year", 'int');
|
||||||
$month = GETPOST("month", 'int');
|
$month = GETPOST("month", 'int');
|
||||||
if (empty($year)) {
|
if (empty($year)) {
|
||||||
$year_current = strftime("%Y", dol_now());
|
$year_current = dol_print_date(dol_now(), '%Y');
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
} else {
|
} else {
|
||||||
$year_current = $year;
|
$year_current = $year;
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year;
|
$year_start = $year;
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"));
|
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel');
|
||||||
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"));
|
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel');
|
||||||
// Quarter
|
// Quarter
|
||||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
$q = GETPOST("q", "int");
|
$q = GETPOST("q", "int");
|
||||||
|
|||||||
@ -52,8 +52,8 @@ if (GETPOST("modecompta")) {
|
|||||||
$modecompta = GETPOST("modecompta");
|
$modecompta = GETPOST("modecompta");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"];
|
$sortorder = GETPOST("sortorder", 'aZ09');
|
||||||
$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"];
|
$sortfield = GETPOST("sortfield", 'aZ09');
|
||||||
if (!$sortorder) {
|
if (!$sortorder) {
|
||||||
$sortorder = "asc";
|
$sortorder = "asc";
|
||||||
}
|
}
|
||||||
@ -89,16 +89,16 @@ $date_endyear = GETPOST("date_endyear");
|
|||||||
$date_endmonth = GETPOST("date_endmonth");
|
$date_endmonth = GETPOST("date_endmonth");
|
||||||
$date_endday = GETPOST("date_endday");
|
$date_endday = GETPOST("date_endday");
|
||||||
if (empty($year)) {
|
if (empty($year)) {
|
||||||
$year_current = strftime("%Y", dol_now());
|
$year_current = dol_print_date(dol_now(), '%Y');
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
} else {
|
} else {
|
||||||
$year_current = $year;
|
$year_current = $year;
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year;
|
$year_start = $year;
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"));
|
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel');
|
||||||
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"));
|
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel');
|
||||||
// Quarter
|
// Quarter
|
||||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
$q = GETPOST("q", "int");
|
$q = GETPOST("q", "int");
|
||||||
|
|||||||
@ -51,8 +51,8 @@ if (GETPOST("modecompta")) {
|
|||||||
$modecompta = GETPOST("modecompta");
|
$modecompta = GETPOST("modecompta");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"];
|
$sortorder = GETPOST("sortorder", 'aZ09');
|
||||||
$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"];
|
$sortfield = GETPOST("sortfield", 'aZ09');
|
||||||
if (!$sortorder) {
|
if (!$sortorder) {
|
||||||
$sortorder = "asc";
|
$sortorder = "asc";
|
||||||
}
|
}
|
||||||
@ -61,25 +61,25 @@ if (!$sortfield) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Date range
|
// Date range
|
||||||
$year = GETPOST("year");
|
$year = GETPOST("year", 'int');
|
||||||
$month = GETPOST("month");
|
$month = GETPOST("month", 'int');
|
||||||
$date_startyear = GETPOST("date_startyear");
|
$date_startyear = GETPOST("date_startyear", 'int');
|
||||||
$date_startmonth = GETPOST("date_startmonth");
|
$date_startmonth = GETPOST("date_startmonth", 'int');
|
||||||
$date_startday = GETPOST("date_startday");
|
$date_startday = GETPOST("date_startday", 'int');
|
||||||
$date_endyear = GETPOST("date_endyear");
|
$date_endyear = GETPOST("date_endyear", 'int');
|
||||||
$date_endmonth = GETPOST("date_endmonth");
|
$date_endmonth = GETPOST("date_endmonth", 'int');
|
||||||
$date_endday = GETPOST("date_endday");
|
$date_endday = GETPOST("date_endday", 'int');
|
||||||
if (empty($year)) {
|
if (empty($year)) {
|
||||||
$year_current = strftime("%Y", dol_now());
|
$year_current = dol_print_date(dol_now(), '%Y');
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
} else {
|
} else {
|
||||||
$year_current = $year;
|
$year_current = $year;
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year;
|
$year_start = $year;
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, $_REQUEST["date_startmonth"], $_REQUEST["date_startday"], $_REQUEST["date_startyear"]);
|
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel');
|
||||||
$date_end = dol_mktime(23, 59, 59, $_REQUEST["date_endmonth"], $_REQUEST["date_endday"], $_REQUEST["date_endyear"]);
|
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel');
|
||||||
// Quarter
|
// Quarter
|
||||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
$q = GETPOST("q") ?GETPOST("q") : 0;
|
$q = GETPOST("q") ?GETPOST("q") : 0;
|
||||||
|
|||||||
@ -44,8 +44,8 @@ if (GETPOST("modecompta")) {
|
|||||||
$modecompta = GETPOST("modecompta");
|
$modecompta = GETPOST("modecompta");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"];
|
$sortorder = GETPOST("sortorder", 'aZ09');
|
||||||
$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"];
|
$sortfield = GETPOST("sortfield", 'aZ09');
|
||||||
if (!$sortorder) {
|
if (!$sortorder) {
|
||||||
$sortorder = "asc";
|
$sortorder = "asc";
|
||||||
}
|
}
|
||||||
@ -83,23 +83,23 @@ $search_societe = GETPOST("search_societe", 'alpha');
|
|||||||
$search_zip = GETPOST("search_zip", 'alpha');
|
$search_zip = GETPOST("search_zip", 'alpha');
|
||||||
$search_town = GETPOST("search_town", 'alpha');
|
$search_town = GETPOST("search_town", 'alpha');
|
||||||
$search_country = GETPOST("search_country", 'alpha');
|
$search_country = GETPOST("search_country", 'alpha');
|
||||||
$date_startyear = GETPOST("date_startyear", 'alpha');
|
$date_startyear = GETPOST("date_startyear", 'int');
|
||||||
$date_startmonth = GETPOST("date_startmonth", 'alpha');
|
$date_startmonth = GETPOST("date_startmonth", 'int');
|
||||||
$date_startday = GETPOST("date_startday", 'alpha');
|
$date_startday = GETPOST("date_startday", 'int');
|
||||||
$date_endyear = GETPOST("date_endyear", 'alpha');
|
$date_endyear = GETPOST("date_endyear", 'int');
|
||||||
$date_endmonth = GETPOST("date_endmonth", 'alpha');
|
$date_endmonth = GETPOST("date_endmonth", 'int');
|
||||||
$date_endday = GETPOST("date_endday", 'alpha');
|
$date_endday = GETPOST("date_endday", 'int');
|
||||||
if (empty($year)) {
|
if (empty($year)) {
|
||||||
$year_current = strftime("%Y", dol_now());
|
$year_current = dol_print_date(dol_now(), '%Y');
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
} else {
|
} else {
|
||||||
$year_current = $year;
|
$year_current = $year;
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), '%m');
|
||||||
$year_start = $year;
|
$year_start = $year;
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"));
|
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel');
|
||||||
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"));
|
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel');
|
||||||
// Quarter
|
// Quarter
|
||||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
$q = GETPOST("q", "int") ?GETPOST("q", "int") : 0;
|
$q = GETPOST("q", "int") ?GETPOST("q", "int") : 0;
|
||||||
|
|||||||
@ -51,8 +51,8 @@ if (empty($year)) {
|
|||||||
$month_current = dol_print_date(dol_now(), "%m");
|
$month_current = dol_print_date(dol_now(), "%m");
|
||||||
$year_start = $year - ($nbofyear - 1);
|
$year_start = $year - ($nbofyear - 1);
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzuserrel');
|
||||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzuserrel');
|
||||||
|
|
||||||
// We define date_start and date_end
|
// We define date_start and date_end
|
||||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
|
|||||||
@ -47,8 +47,8 @@ if (empty($year)) {
|
|||||||
$month_current = strftime("%m", dol_now());
|
$month_current = strftime("%m", dol_now());
|
||||||
$year_start = $year - ($nbofyear - 1);
|
$year_start = $year - ($nbofyear - 1);
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzuserrel');
|
||||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzuserrel');
|
||||||
|
|
||||||
// We define date_start and date_end
|
// We define date_start and date_end
|
||||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
@ -120,8 +120,6 @@ if (!empty($conf->accounting->enabled)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user