Merge branch 'Dolibarr:develop' into SELECT_PRODUITS_LIST
This commit is contained in:
commit
2a55c1f2ad
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="7.0">
|
<project version="7.1">
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.0" />
|
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ NuSoap 0.9.5 LGPL 2.1+ Yes
|
|||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
ParseDown 1.6 MIT License Yes Markdown parser
|
ParseDown 1.6 MIT License Yes Markdown parser
|
||||||
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
|
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
|
||||||
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
|
PHPDebugBar 1.18.2 MIT License Yes Used only by the module "debugbar" for developers
|
||||||
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
|
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
|
||||||
PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||||
php-iban 4.1.1 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
php-iban 4.1.1 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||||
|
|||||||
13
ChangeLog
13
ChangeLog
@ -5,12 +5,13 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
||||||
|
|
||||||
NEW: PHP 8.2 compatibility:
|
NEW: PHP 8.2 compatibility.
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* Minimal PHP version is now PHP 7.1 instead of PHP 7.0
|
||||||
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
|
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
|
||||||
* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
|
* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
|
||||||
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
|
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
|
||||||
@ -18,6 +19,12 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* The type 'text' in ->fields property dos not accept html content anymore. Use the type 'html' for that.
|
* The type 'text' in ->fields property dos not accept html content anymore. Use the type 'html' for that.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 17.0.1 compared to 17.0.0 *****
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 17.0.0 compared to 16.0.0 *****
|
***** ChangeLog for 17.0.0 compared to 16.0.0 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
@ -223,6 +230,10 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all)
|
* Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all)
|
||||||
* The property $url_last_version must be public if defined into module descriptor files;
|
* The property $url_last_version must be public if defined into module descriptor files;
|
||||||
|
|
||||||
|
***** ChangeLog for 16.0.5 compared to 16.0.4 *****
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 16.0.4 compared to 16.0.3 *****
|
***** ChangeLog for 16.0.4 compared to 16.0.3 *****
|
||||||
|
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
README
|
|
||||||
------
|
|
||||||
|
|
||||||
Scripts in this directory can be used to reload or save a demo database.
|
|
||||||
Install of package "dialog" is required.
|
|
||||||
|
|
||||||
|
|
||||||
*** Init demo
|
|
||||||
|
|
||||||
The script initdemo.sh will erase current database with data into mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
|
||||||
|
|
||||||
Do a chmod 700 initdemo.sh
|
|
||||||
then run ./initdemo.sh to launch Graphic User Interface.
|
|
||||||
|
|
||||||
After loading the demo files, admin login may be:
|
|
||||||
- admin / admin
|
|
||||||
or
|
|
||||||
- admin / adminadmin
|
|
||||||
|
|
||||||
|
|
||||||
*** Save demo
|
|
||||||
|
|
||||||
The script savedemo.sh will save current database into a database dump file.
|
|
||||||
|
|
||||||
|
|
||||||
*** Update demo
|
|
||||||
|
|
||||||
The goal of script updatedemo.php is to update dates into the demo data so samples are up to date.
|
|
||||||
32
dev/initdemo/README.md
Normal file
32
dev/initdemo/README.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
README
|
||||||
|
======
|
||||||
|
|
||||||
|
Scripts in this directory can be used to reload or save a demo database.
|
||||||
|
Install of package "dialog" is required.
|
||||||
|
|
||||||
|
|
||||||
|
Init demo
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The script initdemo.sh will erase current database with data intodev/initdemo/mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
||||||
|
|
||||||
|
Do a chmod 700 initdemo.sh
|
||||||
|
then run ./initdemo.sh to launch Graphic User Interface.
|
||||||
|
|
||||||
|
After loading the demo files, admin login may be:
|
||||||
|
- admin / admin
|
||||||
|
or
|
||||||
|
- admin / adminadmin
|
||||||
|
|
||||||
|
|
||||||
|
Update demo
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The goal of script dev/initdemo/updatedemo.php is to update dates into the demo data so samples are up to date.
|
||||||
|
|
||||||
|
|
||||||
|
Save demo
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The script dev/initdemo.savedemo.sh will save current database into a database dump file.
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
@ -290,6 +290,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_monmodule_abcdef
|
--ignore-table=$base.llx_monmodule_abcdef
|
||||||
--ignore-table=$base.llx_notes
|
--ignore-table=$base.llx_notes
|
||||||
--ignore-table=$base.llx_packages
|
--ignore-table=$base.llx_packages
|
||||||
|
--ignore-table=$base.llx_packages_extrafields
|
||||||
--ignore-table=$base.llx_pos_cash
|
--ignore-table=$base.llx_pos_cash
|
||||||
--ignore-table=$base.llx_pos_control_cash
|
--ignore-table=$base.llx_pos_control_cash
|
||||||
--ignore-table=$base.llx_pos_facture
|
--ignore-table=$base.llx_pos_facture
|
||||||
@ -305,6 +306,19 @@ export list="
|
|||||||
--ignore-table=$base.llx_residence
|
--ignore-table=$base.llx_residence
|
||||||
--ignore-table=$base.llx_residence_building
|
--ignore-table=$base.llx_residence_building
|
||||||
--ignore-table=$base.llx_residence_building_links
|
--ignore-table=$base.llx_residence_building_links
|
||||||
|
--ignore-table=$base.llx_scaninvoices_filestoimport
|
||||||
|
--ignore-table=$base.llx_scaninvoices_filestoimport_extrafields
|
||||||
|
--ignore-table=$base.llx_scaninvoices_settings
|
||||||
|
--ignore-table=$base.llx_scaninvoices_settings_extrafields
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistcontent
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistdir
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistfrom
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistip
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistmail
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistto
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_deploymentserver
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_stats
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_whitelistip
|
||||||
--ignore-table=$base.llx_societe_rib2
|
--ignore-table=$base.llx_societe_rib2
|
||||||
--ignore-table=$base.llx_sellyoursaas_cancellation
|
--ignore-table=$base.llx_sellyoursaas_cancellation
|
||||||
--ignore-table=$base.llx_ticketsup
|
--ignore-table=$base.llx_ticketsup
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2022 Waël Almoman <info@almoman.com>
|
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -45,7 +44,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
|||||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
|
||||||
$id = GETPOST('id', 'int'); // id of record
|
$id = GETPOST('id', 'int'); // id of record
|
||||||
$mode = $mode = $action == 'create' ? "_tmp" : 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)
|
||||||
|
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
@ -55,15 +54,10 @@ $accountingaccount_number = GETPOST('accountingaccount_number', 'alphanohtml');
|
|||||||
$accountingaccount->fetch(null, $accountingaccount_number, true);
|
$accountingaccount->fetch(null, $accountingaccount_number, true);
|
||||||
$accountingaccount_label = $accountingaccount->label;
|
$accountingaccount_label = $accountingaccount->label;
|
||||||
|
|
||||||
$journal_code = GETPOST('code_journal', 'alpha') ? GETPOST('code_journal', 'alpha') : "NULL";
|
$journal_code = GETPOST('code_journal', 'alpha');
|
||||||
$accountingjournal->fetch(null, $journal_code);
|
$accountingjournal->fetch(null, $journal_code);
|
||||||
$journal_label = $accountingjournal->label;
|
$journal_label = $accountingjournal->label;
|
||||||
|
|
||||||
$next_num_mvt = (int) GETPOST('next_num_mvt', 'alpha');
|
|
||||||
$doc_ref = (string) GETPOST('doc_ref', 'alpha');
|
|
||||||
$doc_date = (string) GETPOST('doc_date', 'alpha');
|
|
||||||
$doc_date = $doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
|
||||||
|
|
||||||
$subledger_account = GETPOST('subledger_account', 'alphanohtml');
|
$subledger_account = GETPOST('subledger_account', 'alphanohtml');
|
||||||
if ($subledger_account == -1) {
|
if ($subledger_account == -1) {
|
||||||
$subledger_account = null;
|
$subledger_account = null;
|
||||||
@ -78,10 +72,6 @@ $save = GETPOST('save', 'alpha');
|
|||||||
if (!empty($save)) {
|
if (!empty($save)) {
|
||||||
$action = 'add';
|
$action = 'add';
|
||||||
}
|
}
|
||||||
$valid = GETPOST('validate', 'alpha');
|
|
||||||
if (!empty($valid)) {
|
|
||||||
$action = 'valid';
|
|
||||||
}
|
|
||||||
$update = GETPOST('update', 'alpha');
|
$update = GETPOST('update', 'alpha');
|
||||||
if (!empty($update)) {
|
if (!empty($update)) {
|
||||||
$action = 'confirm_update';
|
$action = 'confirm_update';
|
||||||
@ -166,79 +156,64 @@ if ($action == "confirm_update") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($action == 'add' || $action == 'valid') {
|
} elseif ($action == "add") {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (array_sum($debit) != array_sum($credit)) {
|
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
|
||||||
$action = 'add';
|
$error++;
|
||||||
|
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
if (empty($accountingaccount_number) || $accountingaccount_number == '-1') {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||||
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($accountingaccount_number as $key => $value) {
|
if (!$error) {
|
||||||
$accountingaccount->fetch(null, $accountingaccount_number[$key], true);
|
$object = new BookKeeping($db);
|
||||||
$accountingaccount_label[$key] = $accountingaccount->label[$key];
|
|
||||||
|
|
||||||
// if one added row is empty remove it before continue
|
$object->numero_compte = $accountingaccount_number;
|
||||||
if ($key < 1 && (empty($accountingaccount_number[$key]) || $accountingaccount_number[$key] == '-1') || (floatval($debit[$key]) == 0.0) && (floatval($credit[$key]) == 0.0)) {
|
$object->subledger_account = $subledger_account;
|
||||||
continue;
|
$object->subledger_label = $subledger_label;
|
||||||
|
$object->label_compte = $accountingaccount_label;
|
||||||
|
$object->label_operation = $label_operation;
|
||||||
|
$object->debit = $debit;
|
||||||
|
$object->credit = $credit;
|
||||||
|
$object->doc_date = (string) GETPOST('doc_date', 'alpha');
|
||||||
|
$object->doc_type = (string) GETPOST('doc_type', 'alpha');
|
||||||
|
$object->piece_num = $piece_num;
|
||||||
|
$object->doc_ref = (string) GETPOST('doc_ref', 'alpha');
|
||||||
|
$object->code_journal = $journal_code;
|
||||||
|
$object->journal_label = $journal_label;
|
||||||
|
$object->fk_doc = GETPOSTINT('fk_doc');
|
||||||
|
$object->fk_docdet = GETPOSTINT('fk_docdet');
|
||||||
|
|
||||||
|
if (floatval($debit) != 0.0) {
|
||||||
|
$object->montant = $debit; // deprecated
|
||||||
|
$object->amount = $debit;
|
||||||
|
$object->sens = 'D';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((floatval($debit[$key]) != 0.0) && (floatval($credit[$key]) != 0.0)) {
|
if (floatval($credit) != 0.0) {
|
||||||
$error++;
|
$object->montant = $credit; // deprecated
|
||||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
$object->amount = $credit;
|
||||||
|
$object->sens = 'C';
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $object->createStd($user, false, $mode);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
} else {
|
||||||
|
if ($mode != '_tmp') {
|
||||||
|
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||||
|
}
|
||||||
|
|
||||||
|
$debit = 0;
|
||||||
|
$credit = 0;
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($accountingaccount_number[$key]) || $accountingaccount_number[$key] == '-1') {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
|
||||||
$action = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$object = new BookKeeping($db);
|
|
||||||
$object->numero_compte = $accountingaccount_number[$key];
|
|
||||||
$object->subledger_account = $subledger_account[$key];
|
|
||||||
$object->subledger_label = $subledger_label[$key];
|
|
||||||
$object->label_compte = $accountingaccount_label[$key];
|
|
||||||
$object->label_operation = $label_operation[$key];
|
|
||||||
$object->debit = price2num($debit[$key]);
|
|
||||||
$object->credit = price2num($credit[$key]);
|
|
||||||
$object->doc_date = $doc_date;
|
|
||||||
$object->doc_type = (string) GETPOST('doc_type', 'alpha');
|
|
||||||
$object->piece_num = $piece_num;
|
|
||||||
$object->doc_ref = $doc_ref;
|
|
||||||
$object->code_journal = $journal_code;
|
|
||||||
$object->journal_label = $journal_label;
|
|
||||||
$object->fk_doc = GETPOSTINT('fk_doc');
|
|
||||||
$object->fk_docdet = GETPOSTINT('fk_docdet');
|
|
||||||
|
|
||||||
if (floatval($debit[$key]) != 0.0) {
|
|
||||||
$object->montant = $object->debit; // deprecated
|
|
||||||
$object->amount = $object->debit;
|
|
||||||
$object->sens = 'D';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (floatval($credit[$key]) != 0.0) {
|
|
||||||
$object->montant = $object->credit; // deprecated
|
|
||||||
$object->amount = $object->credit;
|
|
||||||
$object->sens = 'C';
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $object->createStd($user, false, $mode);
|
|
||||||
if ($result < 0) {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (empty($error)) {
|
|
||||||
if ($mode != '_tmp') {
|
|
||||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
|
||||||
}
|
|
||||||
$debit = 0;
|
|
||||||
$credit = 0;
|
|
||||||
|
|
||||||
$action = $action == 'add' ? '' : $action ; // stay in valid mode when not adding line
|
|
||||||
}
|
}
|
||||||
} elseif ($action == "confirm_delete") {
|
} elseif ($action == "confirm_delete") {
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
@ -255,28 +230,17 @@ if ($action == "confirm_update") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$action = '';
|
$action = '';
|
||||||
} elseif ($action == 'create') {
|
} elseif ($action == "confirm_create") {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
$next_num_mvt = !empty($next_num_mvt) ? $next_num_mvt : $object->getNextNumMvt('_tmp');
|
|
||||||
$doc_ref = !empty($doc_ref) ? $doc_ref : $next_num_mvt;
|
|
||||||
|
|
||||||
if (empty($doc_date)) {
|
|
||||||
$tmp_date = dol_getdate(dol_now());
|
|
||||||
$_POST['doc_dateday'] = $tmp_date['mday'];
|
|
||||||
$_POST['doc_datemonth'] = $tmp_date['mon'];
|
|
||||||
$_POST['doc_dateyear'] = $tmp_date['year'];
|
|
||||||
unset($tmp_date);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$journal_code || $journal_code == '-1') {
|
if (!$journal_code || $journal_code == '-1') {
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($doc_ref)) {
|
if (!GETPOST('doc_ref', 'alpha')) {
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Piece")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Piece")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error++;
|
$error++;
|
||||||
@ -288,8 +252,8 @@ if ($action == "confirm_update") {
|
|||||||
$object->credit = 0;
|
$object->credit = 0;
|
||||||
$object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
$object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||||
$object->doc_type = GETPOST('doc_type', 'alpha');
|
$object->doc_type = GETPOST('doc_type', 'alpha');
|
||||||
$object->piece_num = $next_num_mvt;
|
$object->piece_num = GETPOST('next_num_mvt', 'alpha');
|
||||||
$object->doc_ref = $doc_ref;
|
$object->doc_ref = GETPOST('doc_ref', 'alpha');
|
||||||
$object->code_journal = $journal_code;
|
$object->code_journal = $journal_code;
|
||||||
$object->journal_label = $journal_label;
|
$object->journal_label = $journal_label;
|
||||||
$object->fk_doc = 0;
|
$object->fk_doc = 0;
|
||||||
@ -338,7 +302,7 @@ if ($action == 'setjournal') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setdocref') {
|
if ($action == 'setdocref') {
|
||||||
$refdoc = $doc_ref;
|
$refdoc = GETPOST('doc_ref', 'alpha');
|
||||||
$result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode);
|
$result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -369,7 +333,7 @@ if ($action == 'valid') {
|
|||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
$title = $langs->trans($mode =="_tmp" ? "CreateMvts": "UpdateMvts");
|
$title = $langs->trans("CreateMvts");
|
||||||
|
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
@ -379,37 +343,28 @@ if ($action == 'delete') {
|
|||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'create') {
|
||||||
|
print load_fiche_titre($title);
|
||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
$result = $object->fetchPerMvt($piece_num, $mode);
|
$next_num_mvt = $object->getNextNumMvt('_tmp');
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($object->piece_num)) {
|
if (empty($next_num_mvt)) {
|
||||||
$backlink = '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?restore_lastsearch_values=1">'.$langs->trans('BackToList').'</a>';
|
dol_print_error('', 'Failed to get next piece number');
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans($mode =="_tmp" ? "CreateMvts": "UpdateMvts"), $backlink);
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?piece_num='.$object->piece_num.'" method="post">'; if ($optioncss != '') {
|
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'" />';
|
|
||||||
}
|
}
|
||||||
$head = array();
|
|
||||||
$h = 0;
|
|
||||||
$head[$h][0] = $_SERVER['PHP_SELF'].'?piece_num='.$object->piece_num.($mode ? '&mode='.$mode : '');
|
|
||||||
$head[$h][1] = $langs->trans("Transaction");
|
|
||||||
$head[$h][2] = 'transaction';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'transaction', '', -1);
|
print '<form action="'.$_SERVER["PHP_SELF"].'" name="create_mvt" method="POST">';
|
||||||
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
}
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="confirm_create">'."\n";
|
||||||
|
print '<input type="hidden" name="next_num_mvt" value="'.$next_num_mvt.'">'."\n";
|
||||||
|
print '<input type="hidden" name="mode" value="_tmp">'."\n";
|
||||||
|
|
||||||
//dol_banner_tab($object, '', $backlink);
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<table class="border centpercent">';
|
||||||
print '<div class="fichehalfleft">';
|
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
print '<table class="border tableforfield" width="100%">';
|
|
||||||
|
|
||||||
/*print '<tr>';
|
/*print '<tr>';
|
||||||
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("NumPiece") . '</td>';
|
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("NumPiece") . '</td>';
|
||||||
@ -419,7 +374,7 @@ if (!empty($object->piece_num)) {
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Docdate").'</td>';
|
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Docdate").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $html->selectDate($doc_date, 'doc_date', '', '', '', "create_mvt", 1, 1);
|
print $html->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -430,218 +385,298 @@ if (!empty($object->piece_num)) {
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">'.$langs->trans("Piece").'</td>';
|
print '<td class="fieldrequired">'.$langs->trans("Piece").'</td>';
|
||||||
print '<td><input type="text" class="minwidth200" name="doc_ref" value="'.$doc_ref.'" /></td>';
|
print '<td><input type="text" class="minwidth200" name="doc_ref" value="'.GETPOST('doc_ref', 'alpha').'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("Doctype") . '</td>';
|
print '<td>' . $langs->trans("Doctype") . '</td>';
|
||||||
print '<td><input type="text" class="minwidth200 name="doc_type" value="" /></td>';
|
print '<td><input type="text" class="minwidth200 name="doc_type" value=""/></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<div class="fichehalfright">';
|
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
print '<table class="border tableforfield centpercent">';
|
|
||||||
|
|
||||||
// Doc type
|
|
||||||
if (!empty($object->doc_type)) {
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">'.$langs->trans("Doctype").'</td>';
|
|
||||||
print '<td>'.$object->doc_type.'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Date document creation
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">'.$langs->trans("DateCreation").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' ';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Don't show in tmp mode, inevitably empty
|
|
||||||
if ($mode != "_tmp") {
|
|
||||||
// Date document export
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Date document validation
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Validate
|
|
||||||
/*
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">' . $langs->trans("Status") . '</td>';
|
|
||||||
print '<td>';
|
|
||||||
if (empty($object->validated)) {
|
|
||||||
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->id . '&action=enable&token='.newToken().'">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a>';
|
|
||||||
} else {
|
|
||||||
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->id . '&action=disable&token='.newToken().'">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// check data
|
|
||||||
/*
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">' . $langs->trans("Control") . '</td>';
|
|
||||||
if ($object->doc_type == 'customer_invoice') {
|
|
||||||
$sqlmid = 'SELECT rowid as ref';
|
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."facture as fac";
|
|
||||||
$sqlmid .= " WHERE fac.rowid=" . ((int) $object->fk_doc);
|
|
||||||
dol_syslog("accountancy/bookkeeping/card.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$invoicestatic = new Facture($db);
|
|
||||||
$invoicestatic->fetch($objmid->ref);
|
|
||||||
$ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1);
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '<td>' . $ref .'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="clearboth"></div>';
|
print $form->buttonsSaveCancel("Create");
|
||||||
|
|
||||||
print '<br>';
|
print '</form>';
|
||||||
|
} else {
|
||||||
$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
|
$object = new BookKeeping($db);
|
||||||
|
$result = $object->fetchPerMvt($piece_num, $mode);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
}
|
||||||
// List of movements
|
|
||||||
print load_fiche_titre($langs->trans("ListeMvts"), '', '');
|
|
||||||
|
|
||||||
if ($optioncss != '') {
|
if (!empty($object->piece_num)) {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'" />';
|
$backlink = '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?restore_lastsearch_values=1">'.$langs->trans('BackToList').'</a>';
|
||||||
|
|
||||||
|
if ($mode == '_tmp') {
|
||||||
|
print load_fiche_titre($langs->trans("CreateMvts"), $backlink);
|
||||||
|
} else {
|
||||||
|
print load_fiche_titre($langs->trans("UpdateMvts"), $backlink);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
$head = array();
|
||||||
print '<input type="hidden" name="doc_type" value="'.$object->doc_type.'" />'."\n";
|
$h = 0;
|
||||||
print '<input type="hidden" name="fk_doc" value="'.$object->fk_doc.'" />'."\n";
|
$head[$h][0] = $_SERVER['PHP_SELF'].'?piece_num='.$object->piece_num.($mode ? '&mode='.$mode : '');
|
||||||
print '<input type="hidden" name="fk_docdet" value="'.$object->fk_docdet.'" />'."\n";
|
$head[$h][1] = $langs->trans("Transaction");
|
||||||
print '<input type="hidden" name="mode" value="'.$mode.'" />'."\n";
|
$head[$h][2] = 'transaction';
|
||||||
|
$h++;
|
||||||
|
|
||||||
if (count($object->linesmvt) > 0) {
|
print dol_get_fiche_head($head, 'transaction', '', -1);
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table class="noborder centpercent">';
|
|
||||||
|
|
||||||
$total_debit = 0;
|
//dol_banner_tab($object, '', $backlink);
|
||||||
$total_credit = 0;
|
|
||||||
|
|
||||||
// Don't show in tmp mode, inevitably empty
|
print '<div class="fichecenter">';
|
||||||
if ($mode != "_tmp") {
|
print '<div class="fichehalfleft">';
|
||||||
// Date document export
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Date document validation
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<tr>';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
|
|
||||||
print '<td>';
|
// Account movement
|
||||||
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
print '<tr>';
|
||||||
print '</td>';
|
print '<td class="titlefield">'.$langs->trans("NumMvts").'</td>';
|
||||||
print '</tr>';
|
print '<td>'.($mode == '_tmp' ? '<span class="opacitymedium" title="Id tmp '.$object->piece_num.'">'.$langs->trans("Draft").'</span>' : $object->piece_num).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Date
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
|
print $langs->trans('Docdate');
|
||||||
|
print '</td>';
|
||||||
|
if ($action != 'editdate') {
|
||||||
|
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</td><td colspan="3">';
|
||||||
|
if ($action == 'editdate') {
|
||||||
|
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?piece_num='.$object->piece_num.'" method="post">';
|
||||||
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="setdate">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
|
||||||
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
|
print '</form>';
|
||||||
|
} else {
|
||||||
|
print $object->doc_date ? dol_print_date($object->doc_date, 'day') : ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
// Journal
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
|
print $langs->trans('Codejournal');
|
||||||
|
print '</td>';
|
||||||
|
if ($action != 'editjournal') {
|
||||||
|
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</td><td>';
|
||||||
|
if ($action == 'editjournal') {
|
||||||
|
print '<form name="setjournal" action="'.$_SERVER["PHP_SELF"].'?piece_num='.$object->piece_num.'" method="post">';
|
||||||
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
}
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="setjournal">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1);
|
||||||
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
|
print '</form>';
|
||||||
|
} else {
|
||||||
|
print $object->code_journal;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print_liste_field_titre("AccountAccountingShort");
|
// Ref document
|
||||||
print_liste_field_titre("SubledgerAccount");
|
print '<tr><td>';
|
||||||
print_liste_field_titre("LabelOperation");
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print_liste_field_titre("AccountingDebit", "", "", "", "", 'class="right"');
|
print $langs->trans('Piece');
|
||||||
print_liste_field_titre("AccountingCredit", "", "", "", "", 'class="right"');
|
print '</td>';
|
||||||
if (empty($object->date_validation)) {
|
if ($action != 'editdocref') {
|
||||||
print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center ');
|
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</td><td>';
|
||||||
|
if ($action == 'editdocref') {
|
||||||
|
print '<form name="setdocref" action="'.$_SERVER["PHP_SELF"].'?piece_num='.$object->piece_num.'" method="post">';
|
||||||
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
}
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="setdocref">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
print '<input type="text" size="20" name="doc_ref" value="'.dol_escape_htmltag($object->doc_ref).'">';
|
||||||
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
|
print '</form>';
|
||||||
|
} else {
|
||||||
|
print $object->doc_ref;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="fichehalfright">';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
|
// Doc type
|
||||||
|
if (!empty($object->doc_type)) {
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="titlefield">'.$langs->trans("Doctype").'</td>';
|
||||||
|
print '<td>'.$object->doc_type.'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Date document creation
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="titlefield">'.$langs->trans("DateCreation").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' ';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Don't show in tmp mode, inevitably empty
|
||||||
|
if ($mode != "_tmp") {
|
||||||
|
// Date document export
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Date document validation
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate
|
||||||
|
/*
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="titlefield">' . $langs->trans("Status") . '</td>';
|
||||||
|
print '<td>';
|
||||||
|
if (empty($object->validated)) {
|
||||||
|
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->id . '&action=enable&token='.newToken().'">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
} else {
|
} else {
|
||||||
print_liste_field_titre("");
|
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $line->id . '&action=disable&token='.newToken().'">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
print "</tr>\n";
|
// check data
|
||||||
|
/*
|
||||||
// In _tmp mode the first line is empty so we remove it
|
print '<tr>';
|
||||||
if ($mode == "_tmp") {
|
print '<td class="titlefield">' . $langs->trans("Control") . '</td>';
|
||||||
array_shift($object->linesmvt);
|
if ($object->doc_type == 'customer_invoice')
|
||||||
|
{
|
||||||
|
$sqlmid = 'SELECT rowid as ref';
|
||||||
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."facture as fac";
|
||||||
|
$sqlmid .= " WHERE fac.rowid=" . ((int) $object->fk_doc);
|
||||||
|
dol_syslog("accountancy/bookkeeping/card.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||||
|
$resultmid = $db->query($sqlmid);
|
||||||
|
if ($resultmid) {
|
||||||
|
$objmid = $db->fetch_object($resultmid);
|
||||||
|
$invoicestatic = new Facture($db);
|
||||||
|
$invoicestatic->fetch($objmid->ref);
|
||||||
|
$ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
|
else dol_print_error($db);
|
||||||
|
}
|
||||||
|
print '<td>' . $ref .'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
print "</table>\n";
|
||||||
|
|
||||||
// Add an empty line at the end to be able to add transaction
|
print '</div>';
|
||||||
$line = new BookKeepingLine();
|
|
||||||
$object->linesmvt[] = $line;
|
|
||||||
|
|
||||||
// Add a second line empty line if there is not yet
|
print dol_get_fiche_end();
|
||||||
if (empty($object->linesmvt[1])) {
|
|
||||||
$line = new BookKeepingLine();
|
print '<div class="clearboth"></div>';
|
||||||
$object->linesmvt[] = $line;
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
|
||||||
|
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
} else {
|
||||||
|
// List of movements
|
||||||
|
print load_fiche_titre($langs->trans("ListeMvts"), '', '');
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'?piece_num='.$object->piece_num.'" method="post">';
|
||||||
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="doc_date" value="'.$object->doc_date.'">'."\n";
|
||||||
|
print '<input type="hidden" name="doc_type" value="'.$object->doc_type.'">'."\n";
|
||||||
|
print '<input type="hidden" name="doc_ref" value="'.$object->doc_ref.'">'."\n";
|
||||||
|
print '<input type="hidden" name="code_journal" value="'.$object->code_journal.'">'."\n";
|
||||||
|
print '<input type="hidden" name="fk_doc" value="'.$object->fk_doc.'">'."\n";
|
||||||
|
print '<input type="hidden" name="fk_docdet" value="'.$object->fk_docdet.'">'."\n";
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">'."\n";
|
||||||
|
|
||||||
$count_line = count($object->linesmvt);
|
if (count($object->linesmvt) > 0) {
|
||||||
$num_line = 0;
|
print '<div class="div-table-responsive-no-min">';
|
||||||
foreach ($object->linesmvt as $key => $line) {
|
print '<table class="noborder centpercent">';
|
||||||
$num_line++;
|
|
||||||
print '<tr class="oddeven" data-lineid="'.((int) $line->id).'">';
|
|
||||||
$total_debit += $line->debit;
|
|
||||||
$total_credit += $line->credit;
|
|
||||||
|
|
||||||
if ($action == 'update' && $line->id == $id) {
|
$total_debit = 0;
|
||||||
print '<!-- td columns in edit mode -->';
|
$total_credit = 0;
|
||||||
print '<td>';
|
|
||||||
print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->numero_compte), 'accountingaccount_number', 1, array(), 1, 1, '');
|
print '<tr class="liste_titre">';
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
print_liste_field_titre("AccountAccountingShort");
|
||||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
print_liste_field_titre("SubledgerAccount");
|
||||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
print_liste_field_titre("LabelOperation");
|
||||||
// Also, it is not possible to use a value that is not in the list.
|
print_liste_field_titre("AccountingDebit", "", "", "", "", 'class="right"');
|
||||||
// Also, the label is not automatically filled when a value is selected.
|
print_liste_field_titre("AccountingCredit", "", "", "", "", 'class="right"');
|
||||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
if (empty($object->date_validation)) {
|
||||||
print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
|
print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center ');
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'" />';
|
print_liste_field_titre("");
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Add an empty line if there is not yet
|
||||||
|
if (!empty($object->linesmvt[0])) {
|
||||||
|
$tmpline = $object->linesmvt[0];
|
||||||
|
if (!empty($tmpline->numero_compte)) {
|
||||||
|
$line = new BookKeepingLine();
|
||||||
|
$object->linesmvt[] = $line;
|
||||||
}
|
}
|
||||||
// Add also input for subledger label
|
}
|
||||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'" />';
|
|
||||||
print '</td>';
|
foreach ($object->linesmvt as $line) {
|
||||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.(GETPOSTISSET("label_operation") ? GETPOST("label_operation", "alpha") : $line->label_operation).'" /></td>';
|
print '<tr class="oddeven" data-lineid="'.((int) $line->id).'">';
|
||||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value="'.(GETPOSTISSET("debit") ? GETPOST("debit", "alpha") : price($line->debit)).'" /></td>';
|
$total_debit += $line->debit;
|
||||||
print '<td class="right"><input type="text" size="6" class="right" name="credit" value="'.(GETPOSTISSET("credit") ? GETPOST("credit", "alpha") : price($line->credit)).'" /></td>';
|
$total_credit += $line->credit;
|
||||||
print '<td>';
|
|
||||||
print '<input type="hidden" name="id" value="'.$line->id.'" />'."\n";
|
if ($action == 'update' && $line->id == $id) {
|
||||||
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Update").'" />';
|
print '<!-- td columns in edit mode -->';
|
||||||
print '</td>';
|
|
||||||
} elseif (empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) {
|
|
||||||
if ($action == "" || $action == 'add') {
|
|
||||||
print '<!-- td columns in add mode -->';
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccounting->select_account((is_array($accountingaccount_number) ? $accountingaccount_number[$key] : $accountingaccount_number ), 'accountingaccount_number['.$key.']', 1, array(), 1, 1, '');
|
print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->numero_compte), 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||||
@ -649,102 +684,124 @@ if (!empty($object->piece_num)) {
|
|||||||
// Also, it is not possible to use a value that is not in the list.
|
// Also, it is not possible to use a value that is not in the list.
|
||||||
// Also, the label is not automatically filled when a value is selected.
|
// Also, the label is not automatically filled when a value is selected.
|
||||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||||
print $formaccounting->select_auxaccount((is_array($subledger_account) ? $subledger_account[$key] : $subledger_account ), 'subledger_account['.$key.']', 1, 'maxwidth250', '', 'subledger_label');
|
print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="maxwidth150" name="subledger_account['.$key.']" value="' . (is_array($subledger_account) ? $subledger_account[$key] : $subledger_account ) . '" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '" />';
|
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||||
}
|
}
|
||||||
print '<br><input type="text" class="maxwidth150" name="subledger_label['.$key.']" value="' . (is_array($subledger_label) ? $subledger_label[$key] : $subledger_label ) . '" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '" />';
|
// Add also input for subledger label
|
||||||
|
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" class="minwidth200" name="label_operation['.$key.']" value="' . (is_array($label_operation) ? $label_operation[$key] : $label_operation ) . '"/></td>';
|
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.(GETPOSTISSET("label_operation") ? GETPOST("label_operation", "alpha") : $line->label_operation).'"></td>';
|
||||||
print '<td class="right"><input type="text" size="6" class="right" name="debit['.$key.']" value="' . (is_array($debit) ? $debit[$key] : $debit ) . '" /></td>';
|
print '<td class="right"><input type="text" size="6" class="right" name="debit" value="'.(GETPOSTISSET("debit") ? GETPOST("debit", "alpha") : price($line->debit)).'"></td>';
|
||||||
print '<td class="right"><input type="text" size="6" class="right" name="credit['.$key.']" value="' . (is_array($credit) ? $credit[$key] : $credit ) . '" /></td>';
|
print '<td class="right"><input type="text" size="6" class="right" name="credit" value="'.(GETPOSTISSET("credit") ? GETPOST("credit", "alpha") : price($line->credit)).'"></td>';
|
||||||
// Add button should not appear twice
|
print '<td>';
|
||||||
if ($num_line === $count_line) {
|
print '<input type="hidden" name="id" value="'.$line->id.'">'."\n";
|
||||||
print '<td><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '" /></td>';
|
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Update").'">';
|
||||||
|
print '</td>';
|
||||||
|
} elseif (empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) {
|
||||||
|
if ($action == "" || $action == 'add') {
|
||||||
|
print '<!-- td columns in add mode -->';
|
||||||
|
print '<td>';
|
||||||
|
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500');
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||||
|
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||||
|
// Also, it is not possible to use a value that is not in the list.
|
||||||
|
// Also, the label is not automatically filled when a value is selected.
|
||||||
|
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||||
|
print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
|
||||||
|
} else {
|
||||||
|
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
|
||||||
|
}
|
||||||
|
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>';
|
||||||
|
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||||
|
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
||||||
|
print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<!-- td columns in display mode -->';
|
||||||
|
$resultfetch = $accountingaccount->fetch(null, $line->numero_compte, true);
|
||||||
|
print '<td>';
|
||||||
|
if ($resultfetch > 0) {
|
||||||
|
print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
|
||||||
} else {
|
} else {
|
||||||
print '<td class="right"></td>';
|
print $line->numero_compte.' <span class="warning">('.$langs->trans("AccountRemovedFromCurrentChartOfAccount").')</span>';
|
||||||
}
|
}
|
||||||
}
|
print '</td>';
|
||||||
} else {
|
print '<td>'.length_accounta($line->subledger_account);
|
||||||
print '<!-- td columns in display mode -->';
|
if ($line->subledger_label) {
|
||||||
$resultfetch = $accountingaccount->fetch(null, $line->numero_compte, true);
|
print ' - <span class="opacitymedium">'.$line->subledger_label.'</span>';
|
||||||
print '<td>';
|
}
|
||||||
if ($resultfetch > 0) {
|
print '</td>';
|
||||||
print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
|
print '<td>'.$line->label_operation.'</td>';
|
||||||
} else {
|
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
||||||
print $line->numero_compte.' <span class="warning">('.$langs->trans("AccountRemovedFromCurrentChartOfAccount").')</span>';
|
print '<td class="right nowraponall amount">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>'.length_accounta($line->subledger_account);
|
|
||||||
if ($line->subledger_label) {
|
|
||||||
print ' - <span class="opacitymedium">'.$line->subledger_label.'</span>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>'.$line->label_operation.'</td>';
|
|
||||||
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
|
||||||
print '<td class="right nowraponall amount">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
|
|
||||||
|
|
||||||
print '<td class="center nowraponall">';
|
print '<td class="center nowraponall">';
|
||||||
if (empty($line->date_export) && empty($line->date_validation)) {
|
if (empty($line->date_export) && empty($line->date_validation)) {
|
||||||
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
||||||
print img_edit('', 0, 'class="marginrightonly"');
|
print img_edit('', 0, 'class="marginrightonly"');
|
||||||
print '</a> ';
|
print '</a> ';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="editfielda nohover cursornotallowed reposition disabled" href="#" title="'.dol_escape_htmltag($langs->trans("ForbiddenTransactionAlreadyExported")).'">';
|
print '<a class="editfielda nohover cursornotallowed reposition disabled" href="#" title="'.dol_escape_htmltag($langs->trans("ForbiddenTransactionAlreadyExported")).'">';
|
||||||
print img_edit($langs->trans("ForbiddenTransactionAlreadyExported"), 0, 'class="marginrightonly"');
|
print img_edit($langs->trans("ForbiddenTransactionAlreadyExported"), 0, 'class="marginrightonly"');
|
||||||
print '</a> ';
|
print '</a> ';
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($line->date_validation)) {
|
|
||||||
$actiontodelete = 'delete';
|
|
||||||
if ($mode == '_tmp' || $action != 'delmouv') {
|
|
||||||
$actiontodelete = 'confirm_delete';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
if (empty($line->date_validation)) {
|
||||||
print img_delete();
|
$actiontodelete = 'delete';
|
||||||
print '</a>';
|
if ($mode == '_tmp' || $action != 'delmouv') {
|
||||||
|
$actiontodelete = 'confirm_delete';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
||||||
|
print img_delete();
|
||||||
|
print '</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="editfielda nohover cursornotallowed disabled" href="#" title="'.dol_escape_htmltag($langs->trans("ForbiddenTransactionAlreadyExported")).'">';
|
||||||
|
print img_delete($langs->trans("ForbiddenTransactionAlreadyValidated"));
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$total_debit = price2num($total_debit, 'MT');
|
||||||
|
$total_credit = price2num($total_credit, 'MT');
|
||||||
|
|
||||||
|
if ($total_debit != $total_credit) {
|
||||||
|
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
if ($mode == '_tmp' && $action == '') {
|
||||||
|
print '<br>';
|
||||||
|
print '<div class="center">';
|
||||||
|
if ($total_debit == $total_credit) {
|
||||||
|
print '<a class="button" href="'.$_SERVER["PHP_SELF"].'?piece_num='.$object->piece_num.'&action=valid">'.$langs->trans("ValidTransaction").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="editfielda nohover cursornotallowed disabled" href="#" title="'.dol_escape_htmltag($langs->trans("ForbiddenTransactionAlreadyExported")).'">';
|
print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $debit, $credit)).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'">';
|
||||||
print img_delete($langs->trans("ForbiddenTransactionAlreadyValidated"));
|
|
||||||
print '</a>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print ' ';
|
||||||
|
print '<a class="button button-cancel" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">'.$langs->trans("Cancel").'</a>';
|
||||||
|
|
||||||
|
print "</div>";
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_debit = price2num($total_debit, 'MT');
|
print '</form>';
|
||||||
$total_credit = price2num($total_credit, 'MT');
|
|
||||||
|
|
||||||
if ($total_debit != $total_credit) {
|
|
||||||
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
if ($mode == '_tmp' && $action == '') {
|
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
|
||||||
if ($total_debit == $total_credit) {
|
|
||||||
print '<input type="submit" class="button" name="validate" value="' . $langs->trans("ValidTransaction") . '" />';
|
|
||||||
} else {
|
|
||||||
print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $debit, $credit)).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'" />';
|
|
||||||
}
|
|
||||||
|
|
||||||
print ' ';
|
|
||||||
print '<a class="button button-cancel" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">'.$langs->trans("Cancel").'</a>';
|
|
||||||
|
|
||||||
print "</div>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
print '</form>';
|
print load_fiche_titre($langs->trans("NoRecords"));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print load_fiche_titre($langs->trans("NoRecords"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|||||||
@ -754,30 +754,33 @@ if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements
|
|||||||
} else {
|
} else {
|
||||||
if (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
if (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
||||||
if (is_array($object->lines)) {
|
if (is_array($object->lines)) {
|
||||||
|
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
||||||
|
|
||||||
// Specify as export : update field date_export or date_validated
|
// Specify as export : update field date_export or date_validated
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
// TODO Merge update for each line into one gloacl using rowid IN (list of movement ids)
|
||||||
foreach ($object->lines as $movement) {
|
foreach ($object->lines as $movement) {
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
$setfields = '';
|
||||||
$sql .= " SET";
|
if (!empty($notifiedexportdate) && empty($movement->date_export)) {
|
||||||
if (!empty($notifiedexportdate) && !empty($notifiedvalidationdate)) {
|
$setfields .= ($setfields ? "," : "")." date_export = '".$db->idate($now)."'";
|
||||||
$sql .= " date_export = '".$db->idate($now)."'";
|
}
|
||||||
$sql .= ", date_validated = '".$db->idate($now)."'";
|
if (!empty($notifiedvalidationdate) && empty($movement->date_validation)) {
|
||||||
} elseif (!empty($notifiedexportdate)) {
|
$setfields .= ($setfields ? "," : "")." date_validated = '".$db->idate($now)."'";
|
||||||
$sql .= " date_export = '".$db->idate($now)."'";
|
|
||||||
} elseif (!empty($notifiedvalidationdate)) {
|
|
||||||
$sql .= " date_validated = '".$db->idate($now)."'";
|
|
||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
if ($setfields) {
|
||||||
|
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||||
|
$sql .= " SET ".$setfields;
|
||||||
|
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$error++;
|
$error++;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1014,17 +1017,17 @@ $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
|||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Button re-export
|
// Button re-export
|
||||||
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||||
$newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("ClickToHideAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"');
|
$newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'">'.img_picto($langs->trans("ClickToHideAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"');
|
||||||
$newcardbutton .= '<span class="valignmiddle marginrightonly paddingleft">'.$langs->trans("ClickToHideAlreadyExportedLines").'</span>';
|
$newcardbutton .= '<span class="valignmiddle marginrightonly paddingleft">'.$langs->trans("ClickToHideAlreadyExportedLines").'</span>';
|
||||||
$newcardbutton .= '</a>';
|
$newcardbutton .= '</a>';
|
||||||
} else {
|
} else {
|
||||||
$newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("DocsAlreadyExportedAreExcluded"), 'switch_on', 'class="warning size15x valignmiddle"');
|
$newcardbutton .= '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'">'.img_picto($langs->trans("DocsAlreadyExportedAreExcluded"), 'switch_on', 'class="warning size15x valignmiddle"');
|
||||||
$newcardbutton .= '<span class="valignmiddle marginrightonly paddingleft">'.$langs->trans("DocsAlreadyExportedAreExcluded").'</span>';
|
$newcardbutton .= '<span class="valignmiddle marginrightonly paddingleft">'.$langs->trans("DocsAlreadyExportedAreExcluded").'</span>';
|
||||||
$newcardbutton .= '</a>';
|
$newcardbutton .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->hasRight('accounting', 'mouvements', 'export')) {
|
if ($user->hasRight('accounting', 'mouvements', 'export')) {
|
||||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->hasRight('accounting', 'mouvements', 'export'));
|
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder), $user->hasRight('accounting', 'mouvements', 'export'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
@ -1355,6 +1358,9 @@ while ($i < min($num, $limit)) {
|
|||||||
print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
|
print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Piece number
|
// Piece number
|
||||||
@ -1522,7 +1528,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Creation operation date
|
// Creation operation date
|
||||||
if (!empty($arrayfields['t.date_creation']['checked'])) {
|
if (!empty($arrayfields['t.date_creation']['checked'])) {
|
||||||
print '<td class="center">'.dol_print_date($line->date_creation, 'dayhour').'</td>';
|
print '<td class="center">'.dol_print_date($line->date_creation, 'dayhour', 'tzuserrel').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1530,7 +1536,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Modification operation date
|
// Modification operation date
|
||||||
if (!empty($arrayfields['t.tms']['checked'])) {
|
if (!empty($arrayfields['t.tms']['checked'])) {
|
||||||
print '<td class="center">'.dol_print_date($line->date_modification, 'dayhour').'</td>';
|
print '<td class="center">'.dol_print_date($line->date_modification, 'dayhour', 'tzuserrel').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1538,7 +1544,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Exported operation date
|
// Exported operation date
|
||||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||||
print '<td class="center nowraponall">'.dol_print_date($line->date_export, 'dayhour').'</td>';
|
print '<td class="center nowraponall">'.dol_print_date($line->date_export, 'dayhour', 'tzuserrel').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1546,7 +1552,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Validated operation date
|
// Validated operation date
|
||||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||||
print '<td class="center nowraponall">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
print '<td class="center nowraponall">'.dol_print_date($line->date_validation, 'dayhour', 'tzuserrel').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1570,11 +1576,11 @@ while ($i < min($num, $limit)) {
|
|||||||
print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
|
print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|||||||
@ -951,6 +951,10 @@ while ($i < min($num, $limit)) {
|
|||||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||||
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
||||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||||
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
|
$colspan++;
|
||||||
|
$colspanend--;
|
||||||
|
}
|
||||||
|
|
||||||
// Is it a break ?
|
// Is it a break ?
|
||||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||||
@ -990,7 +994,9 @@ while ($i < min($num, $limit)) {
|
|||||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : count($arrayfields)+1).'" class="tdforbreak">';
|
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : count($arrayfields)+1).'" class="tdforbreak">';
|
||||||
if ($type == 'sub') {
|
if ($type == 'sub') {
|
||||||
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
|
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
|
||||||
print $line->subledger_label . ' : ' . length_accounta($line->subledger_account);
|
print empty($line->subledger_label) ? '<span class="error">'.$langs->trans("Unknown").'</span>' : $line->subledger_label;
|
||||||
|
print ' : ';
|
||||||
|
print length_accounta($line->subledger_account);
|
||||||
} else {
|
} else {
|
||||||
// Should not happen: subledger account must be null or a non empty value
|
// Should not happen: subledger account must be null or a non empty value
|
||||||
print '<span class="error">' . $langs->trans("Unknown");
|
print '<span class="error">' . $langs->trans("Unknown");
|
||||||
@ -1033,6 +1039,9 @@ while ($i < min($num, $limit)) {
|
|||||||
print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
|
print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Piece number
|
// Piece number
|
||||||
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||||
@ -1216,9 +1225,9 @@ while ($i < min($num, $limit)) {
|
|||||||
print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
|
print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
if (!$i) {
|
||||||
if (!$i) {
|
$totalarray['nbfield']++;
|
||||||
$totalarray['nbfield']++;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comptabilise le sous-total
|
// Comptabilise le sous-total
|
||||||
|
|||||||
@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.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/class/hookmanager.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -388,12 +388,6 @@ class AccountingJournal extends CommonObject
|
|||||||
if (empty($type)) $type = 'view';
|
if (empty($type)) $type = 'view';
|
||||||
if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
|
if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
|
||||||
|
|
||||||
// Hook
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
$hookmanager->initHooks(array('accountingjournaldao'));
|
$hookmanager->initHooks(array('accountingjournaldao'));
|
||||||
@ -790,12 +784,6 @@ class AccountingJournal extends CommonObject
|
|||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||||
|
|
||||||
// Hook
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$hookmanager->initHooks(array('accountingjournaldao'));
|
$hookmanager->initHooks(array('accountingjournaldao'));
|
||||||
@ -940,11 +928,6 @@ class AccountingJournal extends CommonObject
|
|||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
// Hook
|
// Hook
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('accountingjournaldao'));
|
$hookmanager->initHooks(array('accountingjournaldao'));
|
||||||
$parameters = array('journal_data' => &$journal_data, 'search_date_end' => &$search_date_end, 'sep' => &$sep, 'out' => &$out);
|
$parameters = array('journal_data' => &$journal_data, 'search_date_end' => &$search_date_end, 'sep' => &$sep, 'out' => &$out);
|
||||||
$reshook = $hookmanager->executeHooks('exportCsv', $parameters, $this); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('exportCsv', $parameters, $this); // Note that $action and $object may have been
|
||||||
|
|||||||
@ -60,6 +60,8 @@ if ($action == 'update') {
|
|||||||
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
||||||
$minamount = GETPOST('MEMBER_MIN_AMOUNT');
|
$minamount = GETPOST('MEMBER_MIN_AMOUNT');
|
||||||
$publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC');
|
$publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC');
|
||||||
|
$showtable = GETPOST('MEMBER_SHOW_TABLE');;
|
||||||
|
$showvoteallowed = GETPOST('MEMBER_SHOW_VOTE_ALLOWED');
|
||||||
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
||||||
$forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09');
|
$forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09');
|
||||||
@ -68,6 +70,8 @@ if ($action == 'update') {
|
|||||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity);
|
||||||
|
$res = dolibarr_set_const($db, "MEMBER_SKIP_TABLE", !$showtable, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "skip -> show"
|
||||||
|
$res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", !$showvoteallowed, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show"
|
||||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
|
||||||
if ($forcetype < 0) {
|
if ($forcetype < 0) {
|
||||||
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
|
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
|
||||||
@ -246,6 +250,22 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
|||||||
print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1);
|
print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
// Show the table of all available membership types. If not, show a form (as the default was for Dolibarr <=16.0)
|
||||||
|
$skiptable = (!empty($conf->global->MEMBER_SKIP_TABLE) ? $conf->global->MEMBER_SKIP_TABLE : 0);
|
||||||
|
print '<tr class="oddeven" id="tredit"><td>';
|
||||||
|
print $langs->trans("MembersShowMembershipTypesTable");
|
||||||
|
print '</td><td>';
|
||||||
|
print $form->selectyesno("MEMBER_SHOW_TABLE", !$skiptable, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
// Show "vote allowed" setting for membership types
|
||||||
|
$hidevoteallowed = (!empty($conf->global->MEMBER_HIDE_VOTE_ALLOWED) ? $conf->global->MEMBER_HIDE_VOTE_ALLOWED : 0);
|
||||||
|
print '<tr class="oddeven" id="tredit"><td>';
|
||||||
|
print $langs->trans("MembersShowVotesAllowed");
|
||||||
|
print '</td><td>';
|
||||||
|
print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", !$hidevoteallowed, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Jump to an online payment page
|
// Jump to an online payment page
|
||||||
print '<tr class="oddeven" id="trpayment"><td>';
|
print '<tr class="oddeven" id="trpayment"><td>';
|
||||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||||
|
|||||||
@ -61,20 +61,15 @@ abstract class ActionsAdherentCardCommon
|
|||||||
*/
|
*/
|
||||||
public function getObject($id)
|
public function getObject($id)
|
||||||
{
|
{
|
||||||
//$ret = $this->getInstanceDao();
|
$object = new Adherent($this->db);
|
||||||
|
|
||||||
/*if (is_object($this->object) && method_exists($this->object,'fetch'))
|
|
||||||
{
|
|
||||||
if (!empty($id)) $this->object->fetch($id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{*/
|
|
||||||
$object = new Adherent($this->db);
|
|
||||||
if (!empty($id)) {
|
if (!empty($id)) {
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
}
|
}
|
||||||
$this->object = $object;
|
|
||||||
//}
|
$this->object = $object;
|
||||||
|
|
||||||
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
@ -83,7 +78,7 @@ abstract class ActionsAdherentCardCommon
|
|||||||
*
|
*
|
||||||
* @param string $action Type of action
|
* @param string $action Type of action
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return string HTML output
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function assign_values(&$action, $id)
|
public function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,7 +84,6 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
public function assign_values(&$action, $id)
|
public function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $limit, $offset, $sortfield, $sortorder;
|
|
||||||
global $conf, $db, $langs, $user;
|
global $conf, $db, $langs, $user;
|
||||||
global $form;
|
global $form;
|
||||||
|
|
||||||
|
|||||||
@ -345,19 +345,19 @@ $sql .= " d.note_private, d.note_public, d.import_key,";
|
|||||||
$sql .= " s.nom,";
|
$sql .= " s.nom,";
|
||||||
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
|
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
|
||||||
$sql .= " t.libelle as type, t.subscription,";
|
$sql .= " t.libelle as type, t.subscription,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name";
|
||||||
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -224,7 +224,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -226,19 +226,17 @@ print "<br>\n";
|
|||||||
// Build and execute select
|
// Build and execute select
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$sql = 'SELECT ';
|
$sql = 'SELECT ';
|
||||||
foreach ($object->fields as $key => $val) {
|
$sql .= $object->getFieldList('t');
|
||||||
$sql .= "t.".$key.", ";
|
|
||||||
}
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -1181,7 +1181,11 @@ if ($mode == 'deploy') {
|
|||||||
} else {
|
} else {
|
||||||
if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
|
if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
|
||||||
// Show clean message
|
// Show clean message
|
||||||
$message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
|
if (!is_numeric('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
|
||||||
|
$message = info_admin($langs->trans(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')));
|
||||||
|
} else {
|
||||||
|
$message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show technical message
|
// Show technical message
|
||||||
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));
|
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));
|
||||||
|
|||||||
@ -356,8 +356,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
print '<table class="noborder centpercent">'."\n";
|
||||||
print "<tr class=\"liste_titre\">\n";
|
print '<tr class="liste_titre">'."\n";
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||||
@ -396,7 +396,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
|
||||||
|
|
||||||
if ($modulequalified) {
|
if ($modulequalified) {
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td>';
|
||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
if (method_exists($module, 'info')) print $module->info($langs);
|
if (method_exists($module, 'info')) print $module->info($langs);
|
||||||
|
|||||||
@ -109,12 +109,18 @@ if (!$base) {
|
|||||||
|
|
||||||
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
|
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
|
||||||
$arrayoffiles = array();
|
$arrayoffiles = array();
|
||||||
|
$arrayoftablesautocreated = array();
|
||||||
foreach ($arrayoffilesrich as $value) {
|
foreach ($arrayoffilesrich as $value) {
|
||||||
//print $shortsqlfilename.' ';
|
//print $shortsqlfilename.' ';
|
||||||
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
|
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
|
||||||
$arrayoffiles[] = $shortsqlfilename;
|
$arrayoffiles[$value['name']] = $shortsqlfilename;
|
||||||
|
if ($value['name'] == $shortsqlfilename && ! preg_match('/\.key\.sql$/', $value['name'])) {
|
||||||
|
// This is a sql file automatically created
|
||||||
|
$arrayoftablesautocreated[$value['name']] = $shortsqlfilename;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now loop on tables really found into database
|
||||||
$sql = "SHOW TABLE STATUS";
|
$sql = "SHOW TABLE STATUS";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -123,6 +129,7 @@ if (!$base) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td>'.($i+1).'</td>';
|
print '<td>'.($i+1).'</td>';
|
||||||
@ -130,11 +137,14 @@ if (!$base) {
|
|||||||
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
|
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
|
||||||
|
|
||||||
if (in_array($tablename.'.sql', $arrayoffiles)) {
|
if (in_array($tablename.'.sql', $arrayoffiles)) {
|
||||||
$img = "info";
|
if (in_array($tablename.'.sql', $arrayoftablesautocreated)) {
|
||||||
//print img_picto($langs->trans("ExternalModule"), $img);
|
$img = "info";
|
||||||
|
} else {
|
||||||
|
$img = "info_black";
|
||||||
|
print img_picto($langs->trans("NotAvailableByDefaultEnabledOnModuleActivation"), $img, 'class="small opacitymedium"');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$img = "info_black";
|
$img = "info_black";
|
||||||
//print DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql';
|
|
||||||
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
|
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -252,6 +252,7 @@ foreach ($phparray as $key => $value) {
|
|||||||
if (!is_array($keyvalue)) {
|
if (!is_array($keyvalue)) {
|
||||||
$keytoshow = $keyparam;
|
$keytoshow = $keyparam;
|
||||||
$valtoshow = $keyvalue;
|
$valtoshow = $keyvalue;
|
||||||
|
|
||||||
// Hide value of session cookies
|
// Hide value of session cookies
|
||||||
if (in_array($keyparam, array('HTTP_COOKIE', 'Cookie', "\$_SERVER['HTTP_COOKIE']", 'Authorization'))) {
|
if (in_array($keyparam, array('HTTP_COOKIE', 'Cookie', "\$_SERVER['HTTP_COOKIE']", 'Authorization'))) {
|
||||||
$valtoshow = '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
$valtoshow = '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
@ -260,6 +261,10 @@ foreach ($phparray as $key => $value) {
|
|||||||
$keytoshow = $keyparam;
|
$keytoshow = $keyparam;
|
||||||
$valtoshow = '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
$valtoshow = '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
}
|
}
|
||||||
|
if (preg_match('/'.preg_quote('$_SERVER[\'PHP_AUTH_PW', '/').'/i', $keyparam)) {
|
||||||
|
$keytoshow = $keyparam;
|
||||||
|
$valtoshow = '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$keytoshow.'</td>';
|
print '<td>'.$keytoshow.'</td>';
|
||||||
|
|||||||
@ -330,7 +330,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Auto fill the contact found from email
|
// Auto fill the contact found from email
|
||||||
// This option is a serious security hole. it allowe to any non looged perso, to get the database of contacts
|
// This option is a serious security hole. it allows to any non logged perso, to get the database of contacts or to check if an email is a customer or not. We must keep it as hidden option only.
|
||||||
/*
|
/*
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
|
|||||||
@ -607,6 +607,7 @@ class Documents extends DolibarrApi
|
|||||||
|
|
||||||
if ($ref) {
|
if ($ref) {
|
||||||
$tmpreldir = '';
|
$tmpreldir = '';
|
||||||
|
$fetchbyid = false;
|
||||||
|
|
||||||
if ($modulepart == 'facture' || $modulepart == 'invoice') {
|
if ($modulepart == 'facture' || $modulepart == 'invoice') {
|
||||||
$modulepart = 'facture';
|
$modulepart = 'facture';
|
||||||
@ -666,13 +667,22 @@ class Documents extends DolibarrApi
|
|||||||
$modulepart = 'propale';
|
$modulepart = 'propale';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
$object = new Propal($this->db);
|
$object = new Propal($this->db);
|
||||||
|
} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
|
||||||
|
$modulepart = 'contact';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
$object = new Contact($this->db);
|
||||||
|
$fetchbyid = true;
|
||||||
} else {
|
} else {
|
||||||
// TODO Implement additional moduleparts
|
// TODO Implement additional moduleparts
|
||||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($object)) {
|
if (is_object($object)) {
|
||||||
$result = $object->fetch('', $ref);
|
if ($fetchbyid) {
|
||||||
|
$result = $object->fetch($ref);
|
||||||
|
} else {
|
||||||
|
$result = $object->fetch('', $ref);
|
||||||
|
}
|
||||||
|
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
throw new RestException(404, "Object with ref '".$ref."' was not found.");
|
throw new RestException(404, "Object with ref '".$ref."' was not found.");
|
||||||
|
|||||||
@ -116,11 +116,6 @@ class AssetAccountancyCodes extends CommonObject
|
|||||||
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
||||||
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
||||||
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('assetaccountancycodesdao'));
|
$hookmanager->initHooks(array('assetaccountancycodesdao'));
|
||||||
$parameters = array('asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
$parameters = array('asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
||||||
$reshook = $hookmanager->executeHooks('fetchAccountancyCodes', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('fetchAccountancyCodes', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||||
@ -188,11 +183,6 @@ class AssetAccountancyCodes extends CommonObject
|
|||||||
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
||||||
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
||||||
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('assetaccountancycodesdao'));
|
$hookmanager->initHooks(array('assetaccountancycodesdao'));
|
||||||
$parameters = array('user' => $user, 'asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
$parameters = array('user' => $user, 'asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
||||||
$reshook = $hookmanager->executeHooks('updateAccountancyCodes', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('updateAccountancyCodes', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -319,11 +319,6 @@ class AssetDepreciationOptions extends CommonObject
|
|||||||
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
||||||
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
||||||
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('assetdepreciationoptionsdao'));
|
$hookmanager->initHooks(array('assetdepreciationoptionsdao'));
|
||||||
$parameters = array('asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
$parameters = array('asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
||||||
$reshook = $hookmanager->executeHooks('fetchDepreciationOptions', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('fetchDepreciationOptions', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||||
@ -392,11 +387,6 @@ class AssetDepreciationOptions extends CommonObject
|
|||||||
// Clean parameters
|
// Clean parameters
|
||||||
$mode = strtolower(trim($mode));
|
$mode = strtolower(trim($mode));
|
||||||
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('assetdepreciationoptionsdao'));
|
$hookmanager->initHooks(array('assetdepreciationoptionsdao'));
|
||||||
$parameters = array('mode' => $mode);
|
$parameters = array('mode' => $mode);
|
||||||
$reshook = $hookmanager->executeHooks('getGeneralDepreciationInfoForMode', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('getGeneralDepreciationInfoForMode', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||||
@ -437,11 +427,6 @@ class AssetDepreciationOptions extends CommonObject
|
|||||||
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
$asset_id = $asset_id > 0 ? $asset_id : 0;
|
||||||
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
$asset_model_id = $asset_model_id > 0 ? $asset_model_id : 0;
|
||||||
|
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('assetdepreciationoptionsdao'));
|
$hookmanager->initHooks(array('assetdepreciationoptionsdao'));
|
||||||
$parameters = array('user' => $user, 'asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
$parameters = array('user' => $user, 'asset_id' => $asset_id, 'asset_model_id' => $asset_model_id);
|
||||||
$reshook = $hookmanager->executeHooks('updateDepreciationOptions', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('updateDepreciationOptions', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -214,7 +214,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -219,7 +219,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -306,7 +306,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -227,7 +227,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
|
|||||||
@ -227,7 +227,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -2400,6 +2400,20 @@ if ($id > 0) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//mail information
|
||||||
|
if (!empty($object->email_msgid)) {
|
||||||
|
print '<tr><td>'.$langs->trans('MailTopic').'</td>';
|
||||||
|
print '<td>'.dol_escape_htmltag($object->email_subject).'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans('MailFrom').'</td>';
|
||||||
|
print '<td>'.dol_escape_htmltag($object->email_from).'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans('MailTo').'</td>';
|
||||||
|
print '<td>'.dol_escape_htmltag($object->email_to).'</td></tr>';
|
||||||
|
if (!empty($object->email_tocc)) {
|
||||||
|
print '<tr><td>'.$langs->trans('MailCC').'</td>';
|
||||||
|
print '<td>'.dol_escape_htmltag($object->email_tocc).'</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td class="wordbreak">';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td class="wordbreak">';
|
||||||
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private));
|
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private));
|
||||||
|
|||||||
@ -24,6 +24,7 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
|||||||
@ -79,6 +79,7 @@ $cancel = GETPOST('cancel', 'alpha');
|
|||||||
$origin = GETPOST('origin', 'alpha');
|
$origin = GETPOST('origin', 'alpha');
|
||||||
$originid = GETPOST('originid', 'int');
|
$originid = GETPOST('originid', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
$contactid = GETPOST('contactid', 'int');
|
$contactid = GETPOST('contactid', 'int');
|
||||||
$projectid = GETPOST('projectid', 'int');
|
$projectid = GETPOST('projectid', 'int');
|
||||||
@ -1774,6 +1775,7 @@ if ($action == 'create') {
|
|||||||
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
if ($origin != 'project' && $originid) {
|
if ($origin != 'project' && $originid) {
|
||||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||||
print '<input type="hidden" name="originid" value="'.$originid.'">';
|
print '<input type="hidden" name="originid" value="'.$originid.'">';
|
||||||
@ -2449,6 +2451,7 @@ if ($action == 'create') {
|
|||||||
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate">';
|
print '<input type="hidden" name="action" value="setdate">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
|
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
|
||||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -2476,6 +2479,7 @@ if ($action == 'create') {
|
|||||||
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setecheance">';
|
print '<input type="hidden" name="action" value="setecheance">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
|
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
|
||||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -2836,6 +2840,7 @@ if ($action == 'create') {
|
|||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="page_y" value="">
|
<input type="hidden" name="page_y" value="">
|
||||||
|
<input type="hidden" name="backtopage" value="'.$backtopage.'">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
';
|
';
|
||||||
|
|
||||||
@ -2845,7 +2850,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
if (!empty($object->lines) || ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines' && $action != 'editline')) {
|
if (!empty($object->lines) || ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines' && $action != 'editline')) {
|
||||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
print '<table id="tablelines" class="noborder noshadow centpercent">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($object->lines)) {
|
if (!empty($object->lines)) {
|
||||||
|
|||||||
@ -3708,6 +3708,7 @@ class Propal extends CommonObject
|
|||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
$nofetch = !empty($params['nofetch']);
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
return ['optimize' => $langs->trans("Proposal")];
|
return ['optimize' => $langs->trans("Proposal")];
|
||||||
@ -3720,9 +3721,25 @@ class Propal extends CommonObject
|
|||||||
if (!empty($this->ref)) {
|
if (!empty($this->ref)) {
|
||||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
}
|
}
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('companies');
|
||||||
|
if (empty($this->thirdparty)) {
|
||||||
|
$this->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
|
||||||
|
}
|
||||||
if (!empty($this->ref_client)) {
|
if (!empty($this->ref_client)) {
|
||||||
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||||
}
|
}
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('project');
|
||||||
|
if (empty($this->project)) {
|
||||||
|
$res = $this->fetch_project();
|
||||||
|
if ($res > 0) {
|
||||||
|
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($this->total_ht)) {
|
if (!empty($this->total_ht)) {
|
||||||
$datas['amountht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$datas['amountht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
}
|
}
|
||||||
@ -3767,6 +3784,7 @@ class Propal extends CommonObject
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
$classfortooltip = 'classfortooltip';
|
$classfortooltip = 'classfortooltip';
|
||||||
$dataparams = '';
|
$dataparams = '';
|
||||||
|
|||||||
@ -24,6 +24,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,8 @@ $socid = GETPOST('socid', 'int');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
$contactid = GETPOST('contactid', 'int');
|
$contactid = GETPOST('contactid', 'int');
|
||||||
$projectid = GETPOST('projectid', 'int');
|
$projectid = GETPOST('projectid', 'int');
|
||||||
@ -1755,6 +1757,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
|
print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
|
||||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||||
print '<input type="hidden" name="originid" value="'.$originid.'">';
|
print '<input type="hidden" name="originid" value="'.$originid.'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
if (!empty($currency_tx)) {
|
if (!empty($currency_tx)) {
|
||||||
print '<input type="hidden" name="originmulticurrency_tx" value="'.$currency_tx.'">';
|
print '<input type="hidden" name="originmulticurrency_tx" value="'.$currency_tx.'">';
|
||||||
}
|
}
|
||||||
@ -2449,6 +2452,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate">';
|
print '<input type="hidden" name="action" value="setdate">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
|
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
|
||||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -2470,6 +2474,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
|
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
|
||||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -2763,7 +2768,9 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="page_y" value="">
|
<input type="hidden" name="page_y" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">';
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
|
<input type="hidden" name="backtopage" value="'.$backtopage.'">
|
||||||
|
';
|
||||||
|
|
||||||
if (!empty($conf->use_javascript_ajax) && $object->statut == Commande::STATUS_DRAFT) {
|
if (!empty($conf->use_javascript_ajax) && $object->statut == Commande::STATUS_DRAFT) {
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
||||||
@ -2991,7 +2998,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
// Presend form
|
// Presend form
|
||||||
$modelmail = 'order_send';
|
$modelmail = 'order_send';
|
||||||
$defaulttopic = 'SendOrderRef';
|
$defaulttopic = 'SendOrderRef';
|
||||||
$diroutput = $conf->commande->multidir_output[$object->entity];
|
$diroutput = getMultidirOutput($object);
|
||||||
$trackid = 'ord'.$object->id;
|
$trackid = 'ord'.$object->id;
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||||
|
|||||||
@ -3728,6 +3728,7 @@ class Commande extends CommonOrder
|
|||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
$nofetch = !empty($params['nofetch']);
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
return ['optimize' => $langs->trans("Order")];
|
return ['optimize' => $langs->trans("Order")];
|
||||||
@ -3739,7 +3740,23 @@ class Commande extends CommonOrder
|
|||||||
$datas[] = ' '.$this->getLibStatut(5);
|
$datas[] = ' '.$this->getLibStatut(5);
|
||||||
}
|
}
|
||||||
$datas['Ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$datas['Ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('companies');
|
||||||
|
if (empty($this->thirdparty)) {
|
||||||
|
$this->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
|
||||||
|
}
|
||||||
$datas['RefCustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
|
$datas['RefCustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('project');
|
||||||
|
if (empty($this->project)) {
|
||||||
|
$res = $this->fetch_project();
|
||||||
|
if ($res > 0) {
|
||||||
|
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($this->total_ht)) {
|
if (!empty($this->total_ht)) {
|
||||||
$datas['AmountHT'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$datas['AmountHT'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
}
|
}
|
||||||
@ -3811,6 +3828,7 @@ class Commande extends CommonOrder
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
$classfortooltip = 'classfortooltip';
|
$classfortooltip = 'classfortooltip';
|
||||||
$dataparams = '';
|
$dataparams = '';
|
||||||
@ -3960,6 +3978,7 @@ class Commande extends CommonOrder
|
|||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
$this->ref = 'SPECIMEN';
|
$this->ref = 'SPECIMEN';
|
||||||
$this->specimen = 1;
|
$this->specimen = 1;
|
||||||
|
$this->entity = $conf->entity;
|
||||||
$this->socid = 1;
|
$this->socid = 1;
|
||||||
$this->date = time();
|
$this->date = time();
|
||||||
$this->date_lim_reglement = $this->date + 3600 * 24 * 30;
|
$this->date_lim_reglement = $this->date + 3600 * 24 * 30;
|
||||||
|
|||||||
@ -243,13 +243,14 @@ class CommandeStats extends Stats
|
|||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||||
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
$sql .= " FROM ".$this->from;
|
||||||
|
$sql .= " INNER JOIN ".$this->from_line." ON c.rowid = tl.fk_commande";
|
||||||
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."product as product ON tl.fk_product = product.rowid";
|
||||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||||
}
|
}
|
||||||
$sql .= $this->join;
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid";
|
|
||||||
$sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
$sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
||||||
$sql .= " GROUP BY product.ref";
|
$sql .= " GROUP BY product.ref";
|
||||||
$sql .= $this->db->order('nb', 'DESC');
|
$sql .= $this->db->order('nb', 'DESC');
|
||||||
|
|||||||
@ -135,14 +135,14 @@ if (empty($entity)) {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$listofchoices = array(
|
$listofchoices = array(
|
||||||
'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)),
|
'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)),
|
||||||
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
|
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'picto'=>'supplier_invoice', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
|
||||||
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)),
|
'selectexpensereports'=>array('label'=>'ExpenseReports', 'picto'=>'expensereport', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)),
|
||||||
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)),
|
'selectdonations'=>array('label'=>'Donations', 'picto'=>'donation', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)),
|
||||||
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)),
|
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)),
|
||||||
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)),
|
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)),
|
||||||
'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => isModEnabled('banque'), 'perms' => !empty($user->rights->banque->lire)),
|
'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => !empty($user->rights->banque->lire)),
|
||||||
'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)),
|
'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -623,7 +623,9 @@ foreach ($listofchoices as $choice => $val) {
|
|||||||
$disabled = ' disabled';
|
$disabled = ' disabled';
|
||||||
}
|
}
|
||||||
$checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : '');
|
$checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : '');
|
||||||
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
|
print '<div class="paddingleft inline-block marginrightonly paddingright"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'><label for="'.$choice.'"> ';
|
||||||
|
print img_picto($langs->trans($val['label']), $val['picto'], 'class=""').' '.$langs->trans($val['label']);
|
||||||
|
print '</label></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="submit" class="button small" name="search" value="'.$langs->trans("Search").'">';
|
print '<input type="submit" class="button small" name="search" value="'.$langs->trans("Search").'">';
|
||||||
|
|||||||
@ -55,6 +55,7 @@ $langs->loadLangs(array("banks", "bills", "categories", "companies", "compta", "
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
@ -380,6 +381,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
print '<input type="hidden" name="clos" value="0">';
|
print '<input type="hidden" name="clos" value="0">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print dol_get_fiche_head('');
|
print dol_get_fiche_head('');
|
||||||
|
|
||||||
@ -527,6 +529,12 @@ if ($action == 'create') {
|
|||||||
print '<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOST('bank') ?GETPOST('bank', 'alpha') : $object->bank).'"></td>';
|
print '<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOST('bank') ?GETPOST('bank', 'alpha') : $object->bank).'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$ibankey = FormBank::getIBANLabel($object);
|
||||||
|
$bickey = "BICNumber";
|
||||||
|
if ($object->getCountryCode() == 'IN') {
|
||||||
|
$bickey = "SWIFT";
|
||||||
|
}
|
||||||
|
|
||||||
// IBAN
|
// IBAN
|
||||||
print '<tr><td>'.$langs->trans($ibankey).'</td>';
|
print '<tr><td>'.$langs->trans($ibankey).'</td>';
|
||||||
print '<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET('iban') ?GETPOST('iban', 'alpha') : $object->iban).'"></td></tr>';
|
print '<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET('iban') ?GETPOST('iban', 'alpha') : $object->iban).'"></td></tr>';
|
||||||
@ -561,11 +569,6 @@ if ($action == 'create') {
|
|||||||
print '<td><input type="text" class="flat '.$sizecss.'" name="'.$name.'" value="'.(GETPOSTISSET($name) ? GETPOST($name, 'alpha') : $content).'"></td>';
|
print '<td><input type="text" class="flat '.$sizecss.'" name="'.$name.'" value="'.(GETPOSTISSET($name) ? GETPOST($name, 'alpha') : $content).'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
$ibankey = FormBank::getIBANLabel($object);
|
|
||||||
$bickey = "BICNumber";
|
|
||||||
if ($object->getCountryCode() == 'IN') {
|
|
||||||
$bickey = "SWIFT";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isModEnabled('paymentbybanktransfer')) {
|
if (isModEnabled('paymentbybanktransfer')) {
|
||||||
print '<tr><td>'.$form->textwithpicto($langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).'</td>';
|
print '<tr><td>'.$form->textwithpicto($langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).'</td>';
|
||||||
@ -903,6 +906,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.GETPOST("id", 'int').'">'."\n\n";
|
print '<input type="hidden" name="id" value="'.GETPOST("id", 'int').'">'."\n\n";
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print dol_get_fiche_head(array(), 0, '', 0);
|
print dol_get_fiche_head(array(), 0, '', 0);
|
||||||
|
|
||||||
|
|||||||
@ -1119,6 +1119,8 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
// @TODO Check there is no child into llx_payment_various, ... to allow deletion ?
|
||||||
|
|
||||||
// Delete link between tag and bank account
|
// Delete link between tag and bank account
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
|
||||||
@ -2018,7 +2020,6 @@ class AccountLine extends CommonObjectLine
|
|||||||
$sql .= " b.fk_user_author, b.fk_user_rappro,";
|
$sql .= " b.fk_user_author, b.fk_user_rappro,";
|
||||||
$sql .= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
|
$sql .= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
|
||||||
$sql .= " b.fk_bordereau, b.banque, b.emetteur,";
|
$sql .= " b.fk_bordereau, b.banque, b.emetteur,";
|
||||||
//$sql.= " b.author"; // Is this used ?
|
|
||||||
$sql .= " ba.ref as bank_account_ref, ba.label as bank_account_label";
|
$sql .= " ba.ref as bank_account_ref, ba.label as bank_account_label";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
|
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||||
|
|||||||
@ -126,6 +126,22 @@ class PaymentVarious extends CommonObject
|
|||||||
public $fk_user_modif;
|
public $fk_user_modif;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Type of bank account if the payment is on a bank account
|
||||||
|
*/
|
||||||
|
public $fk_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int 1 if the payment is on a bank account line that is conciliated
|
||||||
|
*/
|
||||||
|
public $rappro;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string ID of bank receipt
|
||||||
|
*/
|
||||||
|
public $bank_num_releve;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* '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' 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')
|
||||||
* 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)"
|
||||||
@ -251,7 +267,6 @@ class PaymentVarious extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetch($id, $user = null)
|
public function fetch($id, $user = null)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql .= " v.rowid,";
|
$sql .= " v.rowid,";
|
||||||
$sql .= " v.tms,";
|
$sql .= " v.tms,";
|
||||||
@ -262,7 +277,7 @@ class PaymentVarious extends CommonObject
|
|||||||
$sql .= " v.fk_typepayment,";
|
$sql .= " v.fk_typepayment,";
|
||||||
$sql .= " v.num_payment,";
|
$sql .= " v.num_payment,";
|
||||||
$sql .= " v.label,";
|
$sql .= " v.label,";
|
||||||
$sql .= " v.note,";
|
$sql .= " v.note as note_private,";
|
||||||
$sql .= " v.accountancy_code,";
|
$sql .= " v.accountancy_code,";
|
||||||
$sql .= " v.subledger_account,";
|
$sql .= " v.subledger_account,";
|
||||||
$sql .= " v.fk_projet as fk_project,";
|
$sql .= " v.fk_projet as fk_project,";
|
||||||
@ -271,7 +286,8 @@ class PaymentVarious extends CommonObject
|
|||||||
$sql .= " v.fk_user_modif,";
|
$sql .= " v.fk_user_modif,";
|
||||||
$sql .= " b.fk_account,";
|
$sql .= " b.fk_account,";
|
||||||
$sql .= " b.fk_type,";
|
$sql .= " b.fk_type,";
|
||||||
$sql .= " b.rappro";
|
$sql .= " b.rappro,";
|
||||||
|
$sql .= " b.num_releve as bank_num_releve";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
|
||||||
$sql .= " WHERE v.rowid = ".((int) $id);
|
$sql .= " WHERE v.rowid = ".((int) $id);
|
||||||
@ -292,7 +308,8 @@ class PaymentVarious extends CommonObject
|
|||||||
$this->type_payment = $obj->fk_typepayment;
|
$this->type_payment = $obj->fk_typepayment;
|
||||||
$this->num_payment = $obj->num_payment;
|
$this->num_payment = $obj->num_payment;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note_private; // For backward compatibility
|
||||||
|
$this->note_private = $obj->note_private;
|
||||||
$this->subledger_account = $obj->subledger_account;
|
$this->subledger_account = $obj->subledger_account;
|
||||||
$this->accountancy_code = $obj->accountancy_code;
|
$this->accountancy_code = $obj->accountancy_code;
|
||||||
$this->fk_project = $obj->fk_project;
|
$this->fk_project = $obj->fk_project;
|
||||||
@ -302,6 +319,7 @@ class PaymentVarious extends CommonObject
|
|||||||
$this->fk_account = $obj->fk_account;
|
$this->fk_account = $obj->fk_account;
|
||||||
$this->fk_type = $obj->fk_type;
|
$this->fk_type = $obj->fk_type;
|
||||||
$this->rappro = $obj->rappro;
|
$this->rappro = $obj->rappro;
|
||||||
|
$this->bank_num_releve = $obj->bank_num_releve;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
* 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-2021 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
|
||||||
|
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -35,7 +37,6 @@ 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;
|
$socid = 0;
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
@ -45,10 +46,11 @@ if (!$user->rights->banque->transfer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('banktransfer'));
|
$hookmanager->initHooks(array('banktransfer'));
|
||||||
|
|
||||||
|
$MAXLINES = 10;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -60,123 +62,152 @@ if ($reshook < 0) {
|
|||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
}
|
}
|
||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
$langs->load("errors");
|
$langs->load('errors');
|
||||||
|
$i = 1;
|
||||||
|
|
||||||
$dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
while ($i < $MAXLINES) {
|
||||||
$label = GETPOST('label', 'alpha');
|
$dateo[$i] = dol_mktime(12, 0, 0, GETPOST($i.'_month', 'int'), GETPOST($i.'_day', 'int'), GETPOST($i.'_year', 'int'));
|
||||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT', 2);
|
$label[$i] = GETPOST($i.'_label', 'alpha');
|
||||||
$amountto = price2num(GETPOST('amountto', 'alpha'), 'MT', 2);
|
$amount[$i] = intval(price2num(GETPOST($i.'_amount', 'alpha'), 'MT', 2));
|
||||||
|
$amountto[$i] = price2num(GETPOST($i.'_amountto', 'alpha'), 'MT', 2);
|
||||||
|
$accountfrom[$i] = intval(GETPOST($i.'_account_from', 'int'));
|
||||||
|
$accountto[$i] = intval(GETPOST($i.'_account_to', 'int'));
|
||||||
|
$type[$i] = GETPOST($i.'_type', 'int');
|
||||||
|
$errori[$i] = 0;
|
||||||
|
|
||||||
if (!$label) {
|
$tabnum[$i] = 0;
|
||||||
$error++;
|
if (!empty($label[$i]) || !empty($type[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i] < 0)) {
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
|
$tabnum[$i] = 1;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
if (!$amount) {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
|
|
||||||
}
|
|
||||||
if (!GETPOST('account_from', 'int')) {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors');
|
|
||||||
}
|
|
||||||
if (!GETPOST('account_to', 'int')) {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors');
|
|
||||||
}
|
|
||||||
if (!$error) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|
||||||
|
|
||||||
$accountfrom = new Account($db);
|
$n = 1;
|
||||||
$accountfrom->fetch(GETPOST('account_from', 'int'));
|
while ($n < $MAXLINES) {
|
||||||
|
if ($tabnum[$n] === 1) {
|
||||||
|
if ($accountfrom[$n] < 0) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferFrom")), null, 'errors');
|
||||||
|
}
|
||||||
|
if ($accountto[$n] < 0) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferTo")), null, 'errors');
|
||||||
|
}
|
||||||
|
if (!$type[$n]) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Type")), null, 'errors');
|
||||||
|
}
|
||||||
|
if (!$dateo[$n]) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Date")), null, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
$accountto = new Account($db);
|
if (!($label[$n])) {
|
||||||
$accountto->fetch(GETPOST('account_to', 'int'));
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' . $langs->transnoentities("Description")), null, 'errors');
|
||||||
|
}
|
||||||
|
if (!($amount[$n])) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Amount")), null, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if ($accountto->currency_code == $accountfrom->currency_code) {
|
if (!$errori[$n]) {
|
||||||
$amountto = $amount;
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
} else {
|
|
||||||
if (!$amountto) {
|
$accountfrom = new Account($db);
|
||||||
$error++;
|
$accountfrom->fetch(GETPOST($n.'_account_from', 'int'));
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")), null, 'errors');
|
|
||||||
}
|
$accountto = new Account($db);
|
||||||
}
|
$accountto->fetch(GETPOST($n.'_account_to', 'int'));
|
||||||
if ($amountto < 0) {
|
|
||||||
$error++;
|
if ($accountto->currency_code == $accountfrom->currency_code) {
|
||||||
setEventMessages($langs->trans("AmountMustBePositive"), null, 'errors');
|
$amountto[$n] = $amount[$n];
|
||||||
}
|
} else {
|
||||||
|
if (!$amountto[$n]) {
|
||||||
if ($accountto->id == $accountfrom->id) {
|
$error[$n]++;
|
||||||
$error++;
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")).' #'.$n, null, 'errors');
|
||||||
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors');
|
}
|
||||||
}
|
}
|
||||||
|
if ($amountto[$n] < 0) {
|
||||||
if (empty($error)) {
|
$errori[$n]++;
|
||||||
$db->begin();
|
setEventMessages($langs->trans("AmountMustBePositive").' #'.$n, null, 'errors');
|
||||||
|
}
|
||||||
$bank_line_id_from = 0;
|
|
||||||
$bank_line_id_to = 0;
|
if ($accountto->id == $accountfrom->id) {
|
||||||
$result = 0;
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers").' #'.$n, null, 'errors');
|
||||||
// By default, electronic transfert from bank to bank
|
}
|
||||||
$typefrom = 'PRE';
|
}
|
||||||
$typeto = 'VIR';
|
|
||||||
if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) {
|
if ($errori[$n] == 0) {
|
||||||
// This is transfer of change
|
$db->begin();
|
||||||
$typefrom = 'LIQ';
|
|
||||||
$typeto = 'LIQ';
|
$bank_line_id_from = 0;
|
||||||
}
|
$bank_line_id_to = 0;
|
||||||
|
$result = 0;
|
||||||
if (!$error) {
|
|
||||||
$bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, price2num(-1 * $amount), '', '', $user);
|
// By default, electronic transfert from bank to bank
|
||||||
}
|
$typefrom = $type[$n];
|
||||||
if (!($bank_line_id_from > 0)) {
|
$typeto = $type[$n];
|
||||||
$error++;
|
if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) {
|
||||||
}
|
// This is transfer of change
|
||||||
if (!$error) {
|
$typefrom = 'LIQ';
|
||||||
$bank_line_id_to = $accountto->addline($dateo, $typeto, $label, $amountto, '', '', $user);
|
$typeto = 'LIQ';
|
||||||
}
|
}
|
||||||
if (!($bank_line_id_to > 0)) {
|
|
||||||
$error++;
|
if (!$errori[$n]) {
|
||||||
}
|
$bank_line_id_from = $accountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * $amount[$n]), '', '', $user);
|
||||||
|
}
|
||||||
if (!$error) {
|
if (!($bank_line_id_from > 0)) {
|
||||||
$result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
$errori[$n]++;
|
||||||
}
|
}
|
||||||
if (!($result > 0)) {
|
if (!$errori[$n]) {
|
||||||
$error++;
|
$bank_line_id_to = $accountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', '', $user);
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!($bank_line_id_to > 0)) {
|
||||||
$result = $accountto->add_url_line($bank_line_id_to, $bank_line_id_from, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
$errori[$n]++;
|
||||||
}
|
}
|
||||||
if (!($result > 0)) {
|
|
||||||
$error++;
|
if (!$errori[$n]) {
|
||||||
}
|
$result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
||||||
|
}
|
||||||
if (!$error) {
|
if (!($result > 0)) {
|
||||||
$mesgs = $langs->trans("TransferFromToDone", '{s1}', '{s2}', $amount, $langs->transnoentitiesnoconv("Currency".$conf->currency));
|
$errori++;
|
||||||
$mesgs = str_replace('{s1}', '<a href="bankentries_list.php?id='.$accountfrom->id.'&sortfield=b.datev,b.dateo,b.rowid&sortorder=desc">'.$accountfrom->label.'</a>', $mesgs);
|
}
|
||||||
$mesgs = str_replace('{s2}', '<a href="bankentries_list.php?id='.$accountto->id.'">'.$accountto->label.'</a>', $mesgs);
|
if (!$errori[$n]) {
|
||||||
setEventMessages($mesgs, null, 'mesgs');
|
$result = $accountto->add_url_line($bank_line_id_to, $bank_line_id_from, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
||||||
$db->commit();
|
}
|
||||||
} else {
|
if (!($result > 0)) {
|
||||||
setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors');
|
$errori[$n]++;
|
||||||
$db->rollback();
|
}
|
||||||
|
if (!$errori[$n]) {
|
||||||
|
$mesgs = $langs->trans("TransferFromToDone", '{s1}', '{s2}', $amount[$n], $langs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||||
|
$mesgs = str_replace('{s1}', '<a href="bankentries_list.php?id='.$accountfrom->id.'&sortfield=b.datev,b.dateo,b.rowid&sortorder=desc">'.$accountfrom->label.'</a>', $mesgs);
|
||||||
|
$mesgs = str_replace('{s2}', '<a href="bankentries_list.php?id='.$accountto->id.'">'.$accountto->label.'</a>', $mesgs);
|
||||||
|
setEventMessages($mesgs, null, 'mesgs');
|
||||||
|
$db->commit();
|
||||||
|
} else {
|
||||||
|
setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors');
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
|
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
|
||||||
$title = $langs->trans('MenuBankInternalTransfer');
|
$title = $langs->trans('MenuBankInternalTransfer');
|
||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
|
||||||
print ' <script type="text/javascript">
|
print ' <script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".selectbankaccount").change(function() {
|
$(".selectbankaccount").change(function() {
|
||||||
@ -191,6 +222,13 @@ print ' <script type="text/javascript">
|
|||||||
var currencycode1="";
|
var currencycode1="";
|
||||||
var currencycode2="";
|
var currencycode2="";
|
||||||
|
|
||||||
|
$("select").each(function() {
|
||||||
|
if( $(this).attr("view")){
|
||||||
|
$(this).closest("tr").removeClass("hidejs").removeClass("hideobject");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$.get("'.DOL_URL_ROOT.'/core/ajax/getaccountcurrency.php", {id: account1})
|
$.get("'.DOL_URL_ROOT.'/core/ajax/getaccountcurrency.php", {id: account1})
|
||||||
.done(function( data ) {
|
.done(function( data ) {
|
||||||
if (data != null)
|
if (data != null)
|
||||||
@ -238,63 +276,104 @@ print ' <script type="text/javascript">
|
|||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
$account_from = '';
|
|
||||||
$account_to = '';
|
|
||||||
$label = '';
|
|
||||||
$amount = '';
|
|
||||||
$amountto = '';
|
|
||||||
|
|
||||||
if ($error) {
|
|
||||||
$account_from = GETPOST('account_from', 'int');
|
|
||||||
$account_to = GETPOST('account_to', 'int');
|
|
||||||
$label = GETPOST('label', 'alpha');
|
|
||||||
$amount = GETPOST('amount', 'alpha');
|
|
||||||
}
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_account');
|
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_account');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("TransferDesc").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("TransferDesc").'</span>';
|
||||||
print "<br><br>";
|
print '<br><br>';
|
||||||
|
|
||||||
print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
|
print '<div>';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table id="tablemouvbank" class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td>';
|
print '<th>'.$langs->trans("TransferFrom").'</th>';
|
||||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
print '<th>'.$langs->trans("TransferTo").'</th>';
|
||||||
print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
print '<th>'.$langs->trans("Type").'</th>';
|
||||||
|
print '<th>'.$langs->trans("Date").'</th>';
|
||||||
|
print '<th>'.$langs->trans("Description").'</th>';
|
||||||
|
print '<th class="right">'.$langs->trans("Amount").'</th>';
|
||||||
|
//print '<td class="hideobject" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
for ($i = 1 ; $i < $MAXLINES; $i++) {
|
||||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
$label = '';
|
||||||
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', !isModEnabled('multicurrency') ? 0 : 1);
|
$amount = '';
|
||||||
print "</td>";
|
|
||||||
|
|
||||||
print "<td>\n";
|
if ($errori[$i]) {
|
||||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
$label = GETPOST($i.'_label', 'alpha');
|
||||||
$form->select_comptes($account_to, 'account_to', 0, '', 1, '', !isModEnabled('multicurrency') ? 0 : 1);
|
$amount = GETPOST($i.'_amount', 'alpha');
|
||||||
print "</td>\n";
|
}
|
||||||
|
|
||||||
print "<td>";
|
if ($i == 1) {
|
||||||
print $form->selectDate((!empty($dateo) ? $dateo : ''), '', '', '', '', 'add');
|
$classi = 'numvir number'. $i;
|
||||||
print "</td>\n";
|
$classi .= ' active';
|
||||||
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
} else {
|
||||||
print '<td class="right"><input name="amount" class="flat right" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
$classi = 'numvir number'. $i;
|
||||||
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
|
$classi .= ' hidejs hideobject';
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>";
|
print '<tr class="oddeven nowraponall '.$classi.'"><td>';
|
||||||
|
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||||
|
$form->select_comptes(($errori[$i] ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, ($errori[$i] ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="nowraponall">';
|
||||||
|
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||||
|
$form->select_comptes(($errori[$i] ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, ($errori[$i] ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Payment mode
|
||||||
|
print '<td class="nowraponall">';
|
||||||
|
$idpaymentmodetransfer = dol_getIdFromCode($db, 'VIR', 'c_paiement');
|
||||||
|
$form->select_types_paiements(($errori[$i] ? GETPOST($i.'_type', 'aZ09') : $idpaymentmodetransfer), $i.'_type', '', 0, 1, 0, 0, 1, 'minwidth100');
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Date
|
||||||
|
print '<td class="nowraponall">';
|
||||||
|
print $form->selectDate((!empty($dateo[$i]) ? $dateo[$i] : ''), $i.'_', '', '', '', 'add');
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
print '<td><input name="'.$i.'_label" class="flat quatrevingtpercent selectjs" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
||||||
|
|
||||||
|
print '<td class="right"><input name="'.$i.'_amount" class="flat right selectjs" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
||||||
|
|
||||||
|
print '<td class="hideobject" class="multicurrency"><input name="'.$i.'_amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
};
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '</div>';
|
||||||
|
print '<div id="btncont" style="display: flex; align-items: center">';
|
||||||
|
print '<a id="btnincrement" style="margin-left:35%" class="btnTitle btnTitlePlus" onclick="increment()" title="Ajouter écriture">
|
||||||
|
<span class="fa fa-plus-circle valignmiddle btnTitle-icon">
|
||||||
|
</span>
|
||||||
|
</a>';
|
||||||
|
print '<br><div class=""><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></div>';
|
print '</form>';
|
||||||
|
|
||||||
print "</form>";
|
print ' <script type="text/javascript">
|
||||||
|
function increment(){
|
||||||
|
$(".numvir").nextAll(".hidejs:first").removeClass("hidejs").removeClass("hideobject").addClass("active").show();
|
||||||
|
};
|
||||||
|
$(".number1").on("click",(function() {
|
||||||
|
console.log("We click on number1");
|
||||||
|
$(".hidejs").each(function (){$(this).hide()});
|
||||||
|
$("#btncont").show();
|
||||||
|
}))
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -643,18 +643,28 @@ if ($id) {
|
|||||||
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
|
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (isModEnabled("banque")) {
|
$bankaccountnotfound = 0;
|
||||||
if ($object->fk_account > 0) {
|
|
||||||
$bankline = new AccountLine($db);
|
|
||||||
$bankline->fetch($object->fk_bank);
|
|
||||||
|
|
||||||
print '<tr>';
|
if (isModEnabled('banque')) {
|
||||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
print '<tr>';
|
||||||
print '<td colspan="3">';
|
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||||
print $bankline->getNomUrl(1, 0, 'showall');
|
print '<td colspan="3">';
|
||||||
print '</td>';
|
if ($object->fk_bank > 0) {
|
||||||
print '</tr>';
|
$bankline = new AccountLine($db);
|
||||||
|
$result = $bankline->fetch($object->fk_bank);
|
||||||
|
|
||||||
|
if ($result <= 0) {
|
||||||
|
$bankaccountnotfound = 1;
|
||||||
|
} else {
|
||||||
|
print $bankline->getNomUrl(1, 0, 'showall');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$bankaccountnotfound = 1;
|
||||||
|
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("NoRecordfound").'</span>';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
@ -684,7 +694,7 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if (empty($object->rappro)) {
|
if (empty($object->rappro) || $bankaccountnotfound) {
|
||||||
if (!empty($user->rights->banque->modifier)) {
|
if (!empty($user->rights->banque->modifier)) {
|
||||||
if ($alreadyaccounted) {
|
if ($alreadyaccounted) {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("Accounted").'">'.$langs->trans("Delete").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("Accounted").'">'.$langs->trans("Delete").'</a></div>';
|
||||||
|
|||||||
@ -178,8 +178,8 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'CashControl';
|
$objectclass = 'CashControl';
|
||||||
$objectlabel = 'CashControl';
|
$objectlabel = 'CashControl';
|
||||||
//$uploaddir = '';
|
$uploaddir = $conf->bank->dir_output;
|
||||||
//include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
@ -376,15 +376,9 @@ $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters,
|
|||||||
$param .= $hookmanager->resPrint;
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array();
|
||||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
if (!empty($permissiontodelete)) {
|
||||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
);
|
|
||||||
//if ($permissiontodelete) {
|
|
||||||
// $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
|
||||||
//}
|
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
|
||||||
$arrayofmassactions = array();
|
|
||||||
}
|
}
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
@ -585,7 +579,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
$object->cheque = $obj->cheque;
|
$object->cheque = $obj->cheque;
|
||||||
|
|
||||||
|
|
||||||
print $object->getKanbanView('');
|
print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected)));
|
||||||
if ($i == (min($num, $limit) - 1)) {
|
if ($i == (min($num, $limit) - 1)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.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/company.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("facture", "other"));
|
$langs->loadLangs(array("facture", "other"));
|
||||||
|
|||||||
@ -86,6 +86,8 @@ $socid = GETPOST('socid', 'int');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
$userid = GETPOST('userid', 'int');
|
$userid = GETPOST('userid', 'int');
|
||||||
$search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
|
||||||
@ -3153,6 +3155,8 @@ if ($action == 'create') {
|
|||||||
if ($soc->id > 0) {
|
if ($soc->id > 0) {
|
||||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||||
}
|
}
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<input name="ref" type="hidden" value="provisoire">';
|
print '<input name="ref" type="hidden" value="provisoire">';
|
||||||
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
|
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
|
||||||
print '<input name="force_cond_reglement_id" type="hidden" value="0">';
|
print '<input name="force_cond_reglement_id" type="hidden" value="0">';
|
||||||
@ -4688,6 +4692,7 @@ if ($action == 'create') {
|
|||||||
print '<form id="retained-warranty-form" method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
print '<form id="retained-warranty-form" method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||||
print '<input type="hidden" name="action" value="setretainedwarranty">';
|
print '<input type="hidden" name="action" value="setretainedwarranty">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<input name="retained_warranty" type="number" step="0.01" min="0" max="100" value="'.$object->retained_warranty.'" >';
|
print '<input name="retained_warranty" type="number" step="0.01" min="0" max="100" value="'.$object->retained_warranty.'" >';
|
||||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -4717,6 +4722,7 @@ if ($action == 'create') {
|
|||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||||
print '<input type="hidden" name="action" value="setretainedwarrantyconditions">';
|
print '<input type="hidden" name="action" value="setretainedwarrantyconditions">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||||
$retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $object->retained_warranty_fk_cond_reglement;
|
$retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $object->retained_warranty_fk_cond_reglement;
|
||||||
$retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
$retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||||
@ -4752,6 +4758,7 @@ if ($action == 'create') {
|
|||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||||
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
|
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<input name="retained_warranty_date_limit" type="date" step="1" min="'.dol_print_date($object->date, '%Y-%m-%d').'" value="'.dol_print_date($defaultDate, '%Y-%m-%d').'" >';
|
print '<input name="retained_warranty_date_limit" type="date" step="1" min="'.dol_print_date($object->date, '%Y-%m-%d').'" value="'.dol_print_date($defaultDate, '%Y-%m-%d').'" >';
|
||||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -4832,6 +4839,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setrevenuestamp">';
|
print '<input type="hidden" name="action" value="setrevenuestamp">';
|
||||||
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
|
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
|
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
|
||||||
print ' → <span id="revenuestamp_span"></span>';
|
print ' → <span id="revenuestamp_span"></span>';
|
||||||
print ' <input type="submit" class="button buttongen button-save" value="'.$langs->trans('Modify').'">';
|
print ' <input type="submit" class="button buttongen button-save" value="'.$langs->trans('Modify').'">';
|
||||||
@ -5371,6 +5379,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||||
print '<input type="hidden" name="action" value="updatealllines" />';
|
print '<input type="hidden" name="action" value="updatealllines" />';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'" />';
|
print '<input type="hidden" name="id" value="'.$object->id.'" />';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print '<table id="tablelines_all_progress" class="noborder noshadow" width="100%">';
|
print '<table id="tablelines_all_progress" class="noborder noshadow" width="100%">';
|
||||||
|
|
||||||
@ -5409,6 +5418,7 @@ if ($action == 'create') {
|
|||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="page_y" value="">
|
<input type="hidden" name="page_y" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
|
<input type="hidden" name="backtopage" value="'.$backtopage.'">
|
||||||
';
|
';
|
||||||
|
|
||||||
if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
|
if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
|
||||||
|
|||||||
@ -336,10 +336,6 @@ class Facture extends CommonInvoice
|
|||||||
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),
|
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),
|
||||||
'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>115, 'isameasure'=>1),
|
'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>115, 'isameasure'=>1),
|
||||||
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1),
|
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1),
|
||||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
|
|
||||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>166),
|
|
||||||
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>167),
|
|
||||||
'fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>168),
|
|
||||||
'fk_facture_source' =>array('type'=>'integer', 'label'=>'SourceInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
'fk_facture_source' =>array('type'=>'integer', 'label'=>'SourceInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||||
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||||
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||||
@ -370,7 +366,11 @@ class Facture extends CommonInvoice
|
|||||||
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
|
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
|
||||||
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320),
|
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320),
|
||||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502),
|
||||||
|
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>506),
|
||||||
|
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>508),
|
||||||
|
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>510),
|
||||||
|
'fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')),
|
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')),
|
||||||
);
|
);
|
||||||
@ -1733,12 +1733,6 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! is_object($hookmanager)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($origin->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('invoicedao'));
|
$hookmanager->initHooks(array('invoicedao'));
|
||||||
|
|
||||||
$parameters = array('objFrom' => $origin);
|
$parameters = array('objFrom' => $origin);
|
||||||
|
|||||||
@ -300,7 +300,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -233,8 +233,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'=>"POSModule", '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.module_source'=>array('label'=>"POSModule", 'langs'=>'cashdesk', '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'=>"POSTerminal", '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.pos_source'=>array('label'=>"POSTerminal", 'langs'=>'cashdesk', '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_tva'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
'f.total_tva'=>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),
|
||||||
@ -242,8 +242,6 @@ $arrayfields = array(
|
|||||||
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
|
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
|
||||||
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
|
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
|
||||||
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
|
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
|
||||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
|
|
||||||
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166),
|
|
||||||
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280),
|
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280),
|
||||||
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>285),
|
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>285),
|
||||||
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>290),
|
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>290),
|
||||||
@ -256,10 +254,16 @@ $arrayfields = array(
|
|||||||
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
|
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
|
||||||
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
|
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
|
||||||
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502),
|
'f.tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502),
|
||||||
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))),
|
'u.login'=>array('label'=>"UserAuthor", 'checked'=>1, 'position'=>504),
|
||||||
'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))),
|
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>506),
|
||||||
'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>520, 'enabled'=>'1'),
|
//'f.fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>506),
|
||||||
|
//'f.fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>508),
|
||||||
|
//'f.fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>510),
|
||||||
|
//'f.fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||||
|
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>520, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))),
|
||||||
|
'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>521, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))),
|
||||||
|
'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>530, 'enabled'=>'1'),
|
||||||
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -269,10 +273,11 @@ if (getDolGlobalString("INVOICE_USE_SITUATION") && !empty($conf->global->INVOICE
|
|||||||
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
// If $val['visible']==0, then we never show the field
|
// If $val['visible']==0, then we never show the field
|
||||||
|
|
||||||
if (!empty($val['visible'])) {
|
if (!empty($val['visible'])) {
|
||||||
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
|
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
|
||||||
$newkey = '';
|
$newkey = '';
|
||||||
if (array_key_exists($key, $arrayfields)) { $newkey = $key; } elseif (array_key_exists('t.'.$key, $arrayfields)) { $newkey = 't.'.$key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('s.'.$key, $arrayfields)) { $newkey = 's.'.$key; }
|
if (array_key_exists($key, $arrayfields)) { $newkey = $key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('s.'.$key, $arrayfields)) { $newkey = 's.'.$key; }
|
||||||
if ($newkey) {
|
if ($newkey) {
|
||||||
$arrayfields[$newkey] = array(
|
$arrayfields[$newkey] = array(
|
||||||
'label'=>$val['label'],
|
'label'=>$val['label'],
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2019 Markus Welters <markus@welters.de>
|
* Copyright (C) 2019 Markus Welters <markus@welters.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -126,8 +126,8 @@ if (empty($reshook)) {
|
|||||||
$bprev = new BonPrelevement($db);
|
$bprev = new BonPrelevement($db);
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty (we don't use them anymore)
|
// getDolGlobalString('PRELEVEMENT_CODE_BANQUE') and getDolGlobalString('PRELEVEMENT_CODE_GUICHET') should be empty (we don't use them anymore)
|
||||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate, 0, $type);
|
$result = $bprev->create(getDolGlobalString('PRELEVEMENT_CODE_BANQUE'), getDolGlobalString('PRELEVEMENT_CODE_GUICHET'), $mode, $format, $executiondate, 0, $type);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||||
} elseif ($result == 0) {
|
} elseif ($result == 0) {
|
||||||
|
|||||||
@ -597,7 +597,7 @@ class ChargeSociales extends CommonObject
|
|||||||
$this->ref = $this->label;
|
$this->ref = $this->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
$label = img_picto('', 'tax').'<u class="paddingrightonly">'.$langs->trans("SocialContribution").'</u>';
|
$label = img_picto('', $this->picto, 'class="pictofixedwidth"').'<u class="paddingrightonly">'.$langs->trans("SocialContribution").'</u>';
|
||||||
if (isset($this->paye)) {
|
if (isset($this->paye)) {
|
||||||
$label .= ' '.$this->getLibStatut(5);
|
$label .= ' '.$this->getLibStatut(5);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,7 @@ $langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects'));
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
|
||||||
$mode = GETPOST('mode', 'alpha');
|
$mode = GETPOST('mode', 'alpha');
|
||||||
@ -126,6 +127,7 @@ if ($user->socid) {
|
|||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges');
|
$result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges');
|
||||||
|
$permissiontodelete = $user->rights->tax->charges->supprimer;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -170,7 +172,14 @@ if (empty($reshook)) {
|
|||||||
$search_type = '';
|
$search_type = '';
|
||||||
$search_account = '';
|
$search_account = '';
|
||||||
$search_array_options = array();
|
$search_array_options = array();
|
||||||
|
$toselect = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
|
$objectclass = 'ChargeSociales';
|
||||||
|
$objectlabel = 'ChargeSociales';
|
||||||
|
$uploaddir = $conf->tax->dir_output;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -188,6 +197,8 @@ if (isModEnabled('project')) {
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("SocialContributions"));
|
llxHeader('', $langs->trans("SocialContributions"));
|
||||||
|
|
||||||
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
|
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
|
||||||
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
|
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
|
||||||
if (isModEnabled('project')) {
|
if (isModEnabled('project')) {
|
||||||
@ -378,6 +389,15 @@ if ($user->rights->tax->charges->creer) {
|
|||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewSocialContribution'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/sociales/card.php?action=create');
|
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewSocialContribution'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/sociales/card.php?action=create');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// List of mass actions available
|
||||||
|
$arrayofmassactions = array();
|
||||||
|
if (!empty($permissiontodelete)) {
|
||||||
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
|
}
|
||||||
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
$moreforfilter = '';
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -394,7 +414,7 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
|
|||||||
|
|
||||||
$center = '';
|
$center = '';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
||||||
print '<div class="error">';
|
print '<div class="error">';
|
||||||
@ -408,8 +428,6 @@ if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
|||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
$moreforfilter = '';
|
|
||||||
$massactionbutton = '';
|
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||||
@ -417,6 +435,10 @@ if ($massactionbutton) {
|
|||||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$objecttmp = new ChargeSociales($db);
|
||||||
|
$trackid = 'sc'.$object->id;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">'."\n";
|
||||||
|
|
||||||
@ -619,7 +641,7 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
// Output Kanban
|
// Output Kanban
|
||||||
$chargesociale_static->fk_project = $projectstatic->getNomUrl();
|
$chargesociale_static->fk_project = $projectstatic->getNomUrl();
|
||||||
print $chargesociale_static->getKanbanView('');
|
print $chargesociale_static->getKanbanView('', array('selected' => in_array($chargesociale_static->id, $arrayofselected)));
|
||||||
if ($i == ($imaxinloop - 1)) {
|
if ($i == ($imaxinloop - 1)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -630,7 +652,15 @@ while ($i < $imaxinloop) {
|
|||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td></td>';
|
print '<td class="center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($chargesociale_static->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$chargesociale_static->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line number
|
// Line number
|
||||||
@ -774,7 +804,15 @@ while ($i < $imaxinloop) {
|
|||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td></td>';
|
print '<td class="center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($chargesociale_static->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$chargesociale_static->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$chargesociale_static->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
|
|||||||
@ -39,12 +39,17 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('compta', 'bills'));
|
$langs->loadLangs(array('compta', 'bills'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
|
||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||||
|
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||||
|
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
|
||||||
$mode = GETPOST('mode', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||||
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
|
||||||
|
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_label = GETPOST('search_label', 'alpha');
|
$search_label = GETPOST('search_label', 'alpha');
|
||||||
@ -62,9 +67,9 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int');
|
||||||
|
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
if (empty($page) || $page == -1) {
|
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||||
$page = 0; // If $page is not defined, or '' or -1
|
$page = 0;
|
||||||
}
|
}
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -96,6 +101,9 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
$hookmanager->initHooks(array('salestaxeslist'));
|
$hookmanager->initHooks(array('salestaxeslist'));
|
||||||
$object = new Tva($db);
|
$object = new Tva($db);
|
||||||
|
|
||||||
|
$permissiontoadd = $user->hasRight('tax', 'charges', 'creer');
|
||||||
|
$permissiontodelete = $user->hasRight('tax', 'charges', 'supprimer');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
@ -116,6 +124,7 @@ if ($reshook < 0) {
|
|||||||
|
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
|
// Selection of new fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
||||||
@ -129,7 +138,15 @@ if (empty($reshook)) {
|
|||||||
$search_account = '';
|
$search_account = '';
|
||||||
$search_amount = '';
|
$search_amount = '';
|
||||||
$search_status = '';
|
$search_status = '';
|
||||||
|
$toselect = array();
|
||||||
|
$search_array_options = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
|
$objectclass = 'Tva';
|
||||||
|
$objectlabel = 'Tva';
|
||||||
|
$uploaddir = $conf->tax->dir_output;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,9 +162,16 @@ $bankstatic = new Account($db);
|
|||||||
$accountingjournal = new AccountingJournal($db);
|
$accountingjournal = new AccountingJournal($db);
|
||||||
$bankline = new AccountLine($db);
|
$bankline = new AccountLine($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("VATDeclarations"));
|
$now = dol_now();
|
||||||
|
|
||||||
$sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_typepayment as type, t.fk_account,';
|
$title = $langs->trans("VATDeclarations");
|
||||||
|
//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
|
||||||
|
$help_url = '';
|
||||||
|
|
||||||
|
|
||||||
|
// Build and execute select
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
$sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye as status, t.fk_typepayment as type, t.fk_account,';
|
||||||
$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,';
|
$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,';
|
||||||
$sql.= ' t.num_payment, pst.code as payment_code,';
|
$sql.= ' t.num_payment, pst.code as payment_code,';
|
||||||
$sql .= ' SUM(ptva.amount) as alreadypayed';
|
$sql .= ' SUM(ptva.amount) as alreadypayed';
|
||||||
@ -207,7 +231,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -223,22 +247,28 @@ if ($limit) {
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
llxFooter();
|
|
||||||
$db->close();
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
|
||||||
|
// Output page
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($mode)) {
|
if (!empty($mode)) {
|
||||||
$param .= '&mode='.urlencode($mode);
|
$param .= '&mode='.urlencode($mode);
|
||||||
}
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.$contextpage;
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
$param .= '&limit='.$limit;
|
$param .= '&limit='.((int) $limit);
|
||||||
}
|
}
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
$param .= '&optioncss='.urlencode($optioncss);
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
@ -298,24 +328,33 @@ if (!empty($search_amount)) {
|
|||||||
if ($search_status != '' && $search_status != '-1') {
|
if ($search_status != '' && $search_status != '-1') {
|
||||||
$param .= '&search_status='.urlencode($search_status);
|
$param .= '&search_status='.urlencode($search_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
|
if (!empty($permissiontodelete)) {
|
||||||
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
|
}
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/compta/tva/card.php?action=create';
|
$url = DOL_URL_ROOT.'/compta/tva/card.php?action=create';
|
||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
@ -324,8 +363,17 @@ if (!empty($socid)) {
|
|||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
|
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||||
print_barre_liste($langs->trans("VATDeclarations"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
||||||
|
|
||||||
|
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
|
$topicmail = "SendVAT";
|
||||||
|
$modelmail = "vat";
|
||||||
|
$objecttmp = new Tva($db);
|
||||||
|
$trackid = 'vat'.$object->id;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||||
@ -333,15 +381,40 @@ if ($massactionbutton) {
|
|||||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
$moreforfilter = '';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">';
|
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$moreforfilter = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($moreforfilter)) {
|
||||||
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
|
print $moreforfilter;
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
||||||
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
// Fields title search
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
// Action column
|
||||||
// Filter: Buttons
|
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
print $form->showFilterAndCheckAddButtons(0);
|
$searchpicto = $form->showFilterButtons('left');
|
||||||
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,92 +491,137 @@ if (!empty($arrayfields['t.status']['checked'])) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$parameters = array('arrayfields'=>$arrayfields);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
// Filter: Buttons
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
print $form->showFilterAndCheckAddButtons(0);
|
$searchpicto = $form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
|
||||||
|
// Fields title label
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||||
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.rowid']['checked'])) {
|
if (!empty($arrayfields['t.rowid']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.rowid']['label'], $_SERVER['PHP_SELF'], 't.rowid', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.rowid']['label'], $_SERVER['PHP_SELF'], 't.rowid', '', $param, '', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.label']['checked'])) {
|
if (!empty($arrayfields['t.label']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.label']['label'], $_SERVER['PHP_SELF'], 't.label', '', $param, 'align="left"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.label']['label'], $_SERVER['PHP_SELF'], 't.label', '', $param, 'align="left"', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.datev']['checked'])) {
|
if (!empty($arrayfields['t.datev']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.datev']['label'], $_SERVER['PHP_SELF'], 't.datev', '', $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.datev']['label'], $_SERVER['PHP_SELF'], 't.datev', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.fk_typepayment']['checked'])) {
|
if (!empty($arrayfields['t.fk_typepayment']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.fk_typepayment']['label'], $_SERVER['PHP_SELF'], 't.fk_typepayment', '', $param, '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre($arrayfields['t.fk_typepayment']['label'], $_SERVER['PHP_SELF'], 't.fk_typepayment', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.fk_account']['checked'])) {
|
if (!empty($arrayfields['t.fk_account']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.fk_account']['label'], $_SERVER['PHP_SELF'], 't.fk_account', '', $param, '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre($arrayfields['t.fk_account']['label'], $_SERVER['PHP_SELF'], 't.fk_account', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.amount']['label'], $_SERVER['PHP_SELF'], 't.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre($arrayfields['t.amount']['label'], $_SERVER['PHP_SELF'], 't.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.status']['checked'])) {
|
if (!empty($arrayfields['t.status']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.status']['label'], $_SERVER["PHP_SELF"], "t.paye", "", $param, 'class="right"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.status']['label'], $_SERVER["PHP_SELF"], "t.paye", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
// Loop on record
|
||||||
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$savnbfield = $totalarray['nbfield'];
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
$totalarray['nbfield'] = 0;
|
$totalarray['nbfield'] = 0;
|
||||||
$total = 0;
|
|
||||||
|
|
||||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
while ($i < $imaxinloop) {
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
if (empty($obj)) {
|
||||||
|
break; // Should not happen
|
||||||
|
}
|
||||||
|
|
||||||
$tva_static->id = $obj->rowid;
|
$tva_static->id = $obj->rowid;
|
||||||
$tva_static->ref = $obj->rowid;
|
$tva_static->ref = $obj->rowid;
|
||||||
$tva_static->label = $obj->label;
|
$tva_static->label = $obj->label;
|
||||||
$tva_static->paiementtype = $obj->paye;
|
|
||||||
$tva_static->type_payment = $obj->payment_code;
|
$tva_static->type_payment = $obj->payment_code;
|
||||||
$tva_static->datev = $obj->datev;
|
$tva_static->datev = $obj->datev;
|
||||||
$tva_static->amount = $obj->amount;
|
$tva_static->amount = $obj->amount;
|
||||||
|
$tva_static->paye = $obj->status;
|
||||||
|
$tva_static->status = $obj->status;
|
||||||
|
$object = $tva_static;
|
||||||
|
|
||||||
if ($mode == 'kanban') {
|
if ($mode == 'kanban') {
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
print '<tr><td colspan="12">';
|
print '<tr><td colspan="'.$savnbfield.'">';
|
||||||
print '<div class="box-flex-container kanban">';
|
print '<div class="box-flex-container kanban">';
|
||||||
}
|
}
|
||||||
// Output Kanban
|
// Output Kanban
|
||||||
print $tva_static->getKanbanView('');
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print $object->getKanbanView('');
|
||||||
if ($i == ($imaxinloop - 1)) {
|
if ($i == ($imaxinloop - 1)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven">';
|
// Show here line of result
|
||||||
|
$j = 0;
|
||||||
// Buttons
|
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||||
|
// Action column
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td></td>';
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No
|
// No
|
||||||
@ -588,7 +706,6 @@ while ($i < $imaxinloop) {
|
|||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||||
$total = $total + $obj->amount;
|
|
||||||
print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>';
|
print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
@ -602,7 +719,7 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['t.status']['checked'])) {
|
if (!empty($arrayfields['t.status']['checked'])) {
|
||||||
print '<td class="nowrap right">' . $tva_static->LibStatut($obj->paye, 5, $obj->alreadypayed) . '</td>';
|
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -611,19 +728,28 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buttons
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td></td>';
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</tr>';
|
|
||||||
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a buttons placeholder for the total line
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
|
|
||||||
// Show total line
|
// Show total line
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
@ -641,7 +767,7 @@ if ($num == 0) {
|
|||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
|||||||
@ -86,7 +86,7 @@ abstract class ActionsContactCardCommon
|
|||||||
*
|
*
|
||||||
* @param string $action Type of action
|
* @param string $action Type of action
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return string HTML output
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function assign_values(&$action, $id)
|
public function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -83,7 +83,6 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
|||||||
public function assign_values(&$action, $id)
|
public function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $limit, $offset, $sortfield, $sortorder;
|
|
||||||
global $conf, $db, $langs, $user;
|
global $conf, $db, $langs, $user;
|
||||||
global $form;
|
global $form;
|
||||||
|
|
||||||
|
|||||||
@ -425,7 +425,7 @@ if (isModEnabled('mailing')) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require "../main.inc.php";
|
require "../main.inc.php";
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.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/contract.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
|||||||
@ -56,6 +56,7 @@ $langs->loadLangs(array("contracts", "orders", "companies", "bills", "products",
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
@ -1135,10 +1136,10 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<form name="form_contract" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form name="form_contract" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||||
print '<input type="hidden" name="remise_percent" value="0">';
|
print '<input type="hidden" name="remise_percent" value="0">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print dol_get_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
@ -1350,6 +1351,7 @@ if ($action == 'create') {
|
|||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setremise">';
|
print '<input type="hidden" name="action" value="setremise">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contract card
|
// Contract card
|
||||||
@ -1490,6 +1492,7 @@ if ($action == 'create') {
|
|||||||
print '<form name="update" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">';
|
print '<form name="update" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="updateline">';
|
print '<input type="hidden" name="action" value="updateline">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<input type="hidden" name="elrowid" value="'.$object->lines[$cursorline - 1]->id.'">';
|
print '<input type="hidden" name="elrowid" value="'.$object->lines[$cursorline - 1]->id.'">';
|
||||||
print '<input type="hidden" name="fournprice" value="'.(!empty($object->lines[$cursorline - 1]->fk_fournprice) ? $object->lines[$cursorline - 1]->fk_fournprice : 0).'">';
|
print '<input type="hidden" name="fournprice" value="'.(!empty($object->lines[$cursorline - 1]->fk_fournprice) ? $object->lines[$cursorline - 1]->fk_fournprice : 0).'">';
|
||||||
|
|
||||||
@ -1808,7 +1811,7 @@ if ($action == 'create') {
|
|||||||
$moreparam = 'style="display: none;"';
|
$moreparam = 'style="display: none;"';
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven" '.$moreparam.'>';
|
print '<tr class="oddeven" '.$moreparam.'>';
|
||||||
print '<td class="tdhrthin" colspan="'.($conf->margin->enabled ? 7 : 6).'"><hr class="opacitymedium tdhrthin"></td>';
|
print '<td class="tdhrthin" colspan="'.(isModEnabled('margin') ? 7 : 6).'"><hr class="opacitymedium tdhrthin"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1914,6 +1917,7 @@ if ($action == 'create') {
|
|||||||
print '<form name="active" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form name="active" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="confirm_active">';
|
print '<input type="hidden" name="action" value="confirm_active">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="ligne" value="'.GETPOST('ligne', 'int').'">';
|
print '<input type="hidden" name="ligne" value="'.GETPOST('ligne', 'int').'">';
|
||||||
print '<input type="hidden" name="confirm" value="yes">';
|
print '<input type="hidden" name="confirm" value="yes">';
|
||||||
@ -1973,6 +1977,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="confirm" value="yes">';
|
print '<input type="hidden" name="confirm" value="yes">';
|
||||||
print '<input type="hidden" name="action" value="confirm_closeline">';
|
print '<input type="hidden" name="action" value="confirm_closeline">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print '<table class="noborder tableforservicepart2'.($cursorline < $nbofservices ? ' boxtablenobottom' : '').'" width="100%">';
|
print '<table class="noborder tableforservicepart2'.($cursorline < $nbofservices ? ' boxtablenobottom' : '').'" width="100%">';
|
||||||
|
|
||||||
@ -2038,6 +2043,7 @@ if ($action == 'create') {
|
|||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="'.$object->id.'">
|
<input type="hidden" name="id" value="'.$object->id.'">
|
||||||
<input type="hidden" name="page_y" value="">
|
<input type="hidden" name="page_y" value="">
|
||||||
|
<input type="hidden" name="backtopage" value="'.$backtopage.'">
|
||||||
';
|
';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
|||||||
@ -1995,6 +1995,7 @@ class Contrat extends CommonObject
|
|||||||
$langs->load('contracts');
|
$langs->load('contracts');
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
$nofetch = !empty($params['nofetch']);
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
return ['optimize' => $langs->trans("ShowContract")];
|
return ['optimize' => $langs->trans("ShowContract")];
|
||||||
@ -2006,7 +2007,23 @@ class Contrat extends CommonObject
|
|||||||
$label .= ' '.$this->getLibStatut(5);
|
$label .= ' '.$this->getLibStatut(5);
|
||||||
}*/
|
}*/
|
||||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.($this->ref ? $this->ref : $this->id);
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.($this->ref ? $this->ref : $this->id);
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('companies');
|
||||||
|
if (empty($this->thirdparty)) {
|
||||||
|
$this->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
|
||||||
|
}
|
||||||
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
|
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('project');
|
||||||
|
if (empty($this->project)) {
|
||||||
|
$res = $this->fetch_project();
|
||||||
|
if ($res > 0) {
|
||||||
|
$datas['project'] = '<br><b>'.$langs->trans('Project').':</b> '.$this->project->getNomUrl(1, '', 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$datas['refsupplier'] = '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
|
$datas['refsupplier'] = '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
|
||||||
if (!empty($this->total_ht)) {
|
if (!empty($this->total_ht)) {
|
||||||
$datas['amountht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$datas['amountht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
@ -2052,6 +2069,7 @@ class Contrat extends CommonObject
|
|||||||
$params = [
|
$params = [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
$classfortooltip = 'classfortooltip';
|
$classfortooltip = 'classfortooltip';
|
||||||
$dataparams = '';
|
$dataparams = '';
|
||||||
|
|||||||
@ -279,7 +279,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -85,19 +85,19 @@ class box_birthdays extends ModeleBoxes
|
|||||||
if ($user->rights->user->user->lire) {
|
if ($user->rights->user->user->lire) {
|
||||||
$tmparray = dol_getdate(dol_now(), true);
|
$tmparray = dol_getdate(dol_now(), true);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, 'birth' as typea, u.email, u.statut as status";
|
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, date_format(u.birth, '%d') as daya, 'birth' as typea, u.email, u.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
$sql .= " AND u.statut = 1";
|
$sql .= " AND u.statut = ".User::STATUS_ENABLED;
|
||||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||||
$sql .= ' UNION ';
|
$sql .= ' UNION ';
|
||||||
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, 'employment' as typea, u.email, u.statut as status";
|
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, date_format(u.dateemployment, '%d') as daya, 'employment' as typea, u.email, u.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
$sql .= " AND u.statut = 1";
|
$sql .= " AND u.statut = ".User::STATUS_ENABLED;
|
||||||
$sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
|
||||||
|
$sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year
|
||||||
$sql .= " ORDER BY DAY(datea) ASC";
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
@ -85,12 +85,12 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
if ($user->rights->adherent->lire) {
|
if ($user->rights->adherent->lire) {
|
||||||
$tmparray = dol_getdate(dol_now(), true);
|
$tmparray = dol_getdate(dol_now(), true);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, date_format(u.birth, '%d') as daya, u.email, u.statut as status, u.datefin";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
||||||
$sql .= " AND u.statut = ".Adherent::STATUS_VALIDATED;
|
$sql .= " AND u.statut = ".Adherent::STATUS_VALIDATED;
|
||||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||||
$sql .= " ORDER BY DAY(u.birth) ASC";
|
$sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||||
@ -104,9 +104,16 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
$memberstatic->id = $objp->rowid;
|
$memberstatic->id = $objp->rowid;
|
||||||
$memberstatic->firstname = $objp->firstname;
|
$memberstatic->firstname = $objp->firstname;
|
||||||
$memberstatic->lastname = $objp->lastname;
|
$memberstatic->lastname = $objp->lastname;
|
||||||
|
$memberstatic->email = $objp->email;
|
||||||
|
$memberstatic->status = $objp->status;
|
||||||
|
$memberstatic->statut = $memberstatic->status;
|
||||||
|
$memberstatic->datefin = $this->db->jdate($objp->datefin);
|
||||||
|
//$memberstatic->need_subscription = 1;
|
||||||
$dateb = $this->db->jdate($objp->birth);
|
$dateb = $this->db->jdate($objp->birth);
|
||||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||||
|
|
||||||
|
$typea = '<i class="fas fa-birthday-cake inline-block"></i>';
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => '',
|
'td' => '',
|
||||||
'text' => $memberstatic->getNomUrl(1),
|
'text' => $memberstatic->getNomUrl(1),
|
||||||
@ -118,6 +125,12 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][] = array(
|
||||||
|
'td' => 'class="center nowraponall"',
|
||||||
|
'text' => $typea,
|
||||||
|
'asis' => 1
|
||||||
|
);
|
||||||
|
|
||||||
/*$this->info_box_contents[$line][] = array(
|
/*$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right" width="18"',
|
'td' => 'class="right" width="18"',
|
||||||
'text' => $memberstatic->LibStatut($objp->status, 3)
|
'text' => $memberstatic->LibStatut($objp->status, 3)
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/boxes/modules_boxes.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/boxes/modules_boxes.php';
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4967,9 +4967,9 @@ abstract class CommonObject
|
|||||||
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
||||||
*
|
*
|
||||||
* @param string $action Action code
|
* @param string $action Action code
|
||||||
* @param string $seller Object of seller third party
|
* @param Societe $seller Object of seller third party
|
||||||
* @param string $buyer Object of buyer third party
|
* @param Societe $buyer Object of buyer third party
|
||||||
* @param int $selected Object line selected
|
* @param int $selected ID line selected
|
||||||
* @param int $dateSelector 1=Show also date range input fields
|
* @param int $dateSelector 1=Show also date range input fields
|
||||||
* @param string $defaulttpldir Directory where to find the template
|
* @param string $defaulttpldir Directory where to find the template
|
||||||
* @return void
|
* @return void
|
||||||
@ -5058,9 +5058,9 @@ abstract class CommonObject
|
|||||||
* @param int $num Number of line (0)
|
* @param int $num Number of line (0)
|
||||||
* @param int $i I
|
* @param int $i I
|
||||||
* @param int $dateSelector 1=Show also date range input fields
|
* @param int $dateSelector 1=Show also date range input fields
|
||||||
* @param string $seller Object of seller third party
|
* @param Societe $seller Object of seller third party
|
||||||
* @param string $buyer Object of buyer third party
|
* @param Societe $buyer Object of buyer third party
|
||||||
* @param int $selected Object line selected
|
* @param int $selected ID line selected
|
||||||
* @param Extrafields $extrafields Object of extrafields
|
* @param Extrafields $extrafields Object of extrafields
|
||||||
* @param string $defaulttpldir Directory where to find the template (deprecated)
|
* @param string $defaulttpldir Directory where to find the template (deprecated)
|
||||||
* @return void
|
* @return void
|
||||||
@ -5073,8 +5073,6 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$object_rights = $this->getRights();
|
$object_rights = $this->getRights();
|
||||||
|
|
||||||
$element = $this->element;
|
|
||||||
|
|
||||||
$text = '';
|
$text = '';
|
||||||
$description = '';
|
$description = '';
|
||||||
|
|
||||||
@ -5496,171 +5494,165 @@ abstract class CommonObject
|
|||||||
$parameters = array('modelspath'=>$modelspath, 'modele'=>$modele, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'hidedesc'=>$hidedesc, 'hideref'=>$hideref, 'moreparams'=>$moreparams);
|
$parameters = array('modelspath'=>$modelspath, 'modele'=>$modele, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'hidedesc'=>$hidedesc, 'hideref'=>$hideref, 'moreparams'=>$moreparams);
|
||||||
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (!empty($reshook)) {
|
||||||
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
|
return $reshook;
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($modele)) {
|
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
|
||||||
$this->error = 'BadValueForParameterModele';
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Increase limit for PDF build
|
if (empty($modele)) {
|
||||||
$err = error_reporting();
|
$this->error = 'BadValueForParameterModele';
|
||||||
error_reporting(0);
|
return -1;
|
||||||
@set_time_limit(120);
|
}
|
||||||
error_reporting($err);
|
|
||||||
|
|
||||||
// If selected model is a filename template (then $modele="modelname" or "modelname:filename")
|
// Increase limit for PDF build
|
||||||
$tmp = explode(':', $modele, 2);
|
$err = error_reporting();
|
||||||
if (!empty($tmp[1])) {
|
error_reporting(0);
|
||||||
$modele = $tmp[0];
|
@set_time_limit(120);
|
||||||
$srctemplatepath = $tmp[1];
|
error_reporting($err);
|
||||||
}
|
|
||||||
|
|
||||||
// Search template files
|
// If selected model is a filename template (then $modele="modelname" or "modelname:filename")
|
||||||
$file = '';
|
$tmp = explode(':', $modele, 2);
|
||||||
$classname = '';
|
if (!empty($tmp[1])) {
|
||||||
$filefound = '';
|
$modele = $tmp[0];
|
||||||
$dirmodels = array('/');
|
$srctemplatepath = $tmp[1];
|
||||||
if (is_array($conf->modules_parts['models'])) {
|
}
|
||||||
$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
|
|
||||||
}
|
|
||||||
foreach ($dirmodels as $reldir) {
|
|
||||||
foreach (array('doc', 'pdf') as $prefix) {
|
|
||||||
if (in_array(get_class($this), array('Adherent'))) {
|
|
||||||
// Member module use prefix_modele.class.php
|
|
||||||
$file = $prefix."_".$modele.".class.php";
|
|
||||||
} else {
|
|
||||||
// Other module use prefix_modele.modules.php
|
|
||||||
$file = $prefix."_".$modele.".modules.php";
|
|
||||||
}
|
|
||||||
|
|
||||||
// On verifie l'emplacement du modele
|
// Search template files
|
||||||
$file = dol_buildpath($reldir.$modelspath.$file, 0);
|
$file = '';
|
||||||
if (file_exists($file)) {
|
$classname = '';
|
||||||
$filefound = $file;
|
$filefound = '';
|
||||||
$classname = $prefix.'_'.$modele;
|
$dirmodels = array('/');
|
||||||
break;
|
if (is_array($conf->modules_parts['models'])) {
|
||||||
}
|
$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
|
||||||
|
}
|
||||||
|
foreach ($dirmodels as $reldir) {
|
||||||
|
foreach (array('doc', 'pdf') as $prefix) {
|
||||||
|
if (in_array(get_class($this), array('Adherent'))) {
|
||||||
|
// Member module use prefix_modele.class.php
|
||||||
|
$file = $prefix."_".$modele.".class.php";
|
||||||
|
} else {
|
||||||
|
// Other module use prefix_modele.modules.php
|
||||||
|
$file = $prefix."_".$modele.".modules.php";
|
||||||
}
|
}
|
||||||
if ($filefound) {
|
|
||||||
|
// On verifie l'emplacement du modele
|
||||||
|
$file = dol_buildpath($reldir.$modelspath.$file, 0);
|
||||||
|
if (file_exists($file)) {
|
||||||
|
$filefound = $file;
|
||||||
|
$classname = $prefix.'_'.$modele;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If generator was found
|
|
||||||
if ($filefound) {
|
if ($filefound) {
|
||||||
global $db; // Required to solve a conception default making an include of code using $db instead of $this->db just after.
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
require_once $file;
|
if (!$filefound) {
|
||||||
|
$this->error = $langs->trans("Error").' Failed to load doc generator with modelpaths='.$modelspath.' - modele='.$modele;
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
dol_syslog($this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$obj = new $classname($this->db);
|
// If generator was found
|
||||||
|
global $db; // Required to solve a conception default making an include of code using $db instead of $this->db just after.
|
||||||
|
|
||||||
// If generator is ODT, we must have srctemplatepath defined, if not we set it.
|
require_once $file;
|
||||||
if ($obj->type == 'odt' && empty($srctemplatepath)) {
|
|
||||||
$varfortemplatedir = $obj->scandir;
|
|
||||||
if ($varfortemplatedir && !empty($conf->global->$varfortemplatedir)) {
|
|
||||||
$dirtoscan = $conf->global->$varfortemplatedir;
|
|
||||||
|
|
||||||
$listoffiles = array();
|
$obj = new $classname($this->db);
|
||||||
|
|
||||||
// Now we add first model found in directories scanned
|
// If generator is ODT, we must have srctemplatepath defined, if not we set it.
|
||||||
$listofdir = explode(',', $dirtoscan);
|
if ($obj->type == 'odt' && empty($srctemplatepath)) {
|
||||||
foreach ($listofdir as $key => $tmpdir) {
|
$varfortemplatedir = $obj->scandir;
|
||||||
$tmpdir = trim($tmpdir);
|
if ($varfortemplatedir && !empty($conf->global->$varfortemplatedir)) {
|
||||||
$tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
|
$dirtoscan = $conf->global->$varfortemplatedir;
|
||||||
if (!$tmpdir) {
|
|
||||||
unset($listofdir[$key]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (is_dir($tmpdir)) {
|
|
||||||
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0);
|
|
||||||
if (count($tmpfiles)) {
|
|
||||||
$listoffiles = array_merge($listoffiles, $tmpfiles);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($listoffiles)) {
|
$listoffiles = array();
|
||||||
foreach ($listoffiles as $record) {
|
|
||||||
$srctemplatepath = $record['fullname'];
|
// Now we add first model found in directories scanned
|
||||||
break;
|
$listofdir = explode(',', $dirtoscan);
|
||||||
}
|
foreach ($listofdir as $key => $tmpdir) {
|
||||||
|
$tmpdir = trim($tmpdir);
|
||||||
|
$tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
|
||||||
|
if (!$tmpdir) {
|
||||||
|
unset($listofdir[$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (is_dir($tmpdir)) {
|
||||||
|
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0);
|
||||||
|
if (count($tmpfiles)) {
|
||||||
|
$listoffiles = array_merge($listoffiles, $tmpfiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($srctemplatepath)) {
|
if (count($listoffiles)) {
|
||||||
$this->error = 'ErrorGenerationAskedForOdtTemplateWithSrcFileNotDefined';
|
foreach ($listoffiles as $record) {
|
||||||
return -1;
|
$srctemplatepath = $record['fullname'];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($obj->type == 'odt' && !empty($srctemplatepath)) {
|
if (empty($srctemplatepath)) {
|
||||||
if (!dol_is_file($srctemplatepath)) {
|
$this->error = 'ErrorGenerationAskedForOdtTemplateWithSrcFileNotDefined';
|
||||||
dol_syslog("Failed to locate template file ".$srctemplatepath, LOG_WARNING);
|
|
||||||
$this->error = 'ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound';
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We save charset_output to restore it because write_file can change it if needed for
|
|
||||||
// output format that does not support UTF8.
|
|
||||||
$sav_charset_output = empty($outputlangs->charset_output) ? '' : $outputlangs->charset_output;
|
|
||||||
|
|
||||||
if (in_array(get_class($this), array('Adherent'))) {
|
|
||||||
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams);
|
|
||||||
} else {
|
|
||||||
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);
|
|
||||||
}
|
|
||||||
// After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index.
|
|
||||||
|
|
||||||
if ($resultwritefile > 0) {
|
|
||||||
$outputlangs->charset_output = $sav_charset_output;
|
|
||||||
|
|
||||||
// We delete old preview
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
dol_delete_preview($this);
|
|
||||||
|
|
||||||
// Index file in database
|
|
||||||
if (!empty($obj->result['fullpath'])) {
|
|
||||||
$destfull = $obj->result['fullpath'];
|
|
||||||
|
|
||||||
// Update the last_main_doc field into main object (if document generator has property ->update_main_doc_field set)
|
|
||||||
$update_main_doc_field = 0;
|
|
||||||
if (!empty($obj->update_main_doc_field)) {
|
|
||||||
$update_main_doc_field = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->indexFile($destfull, $update_main_doc_field);
|
|
||||||
} else {
|
|
||||||
dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Success in building document. We build meta file.
|
|
||||||
dol_meta_create($this);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
$outputlangs->charset_output = $sav_charset_output;
|
|
||||||
$this->error = $obj->error;
|
|
||||||
$this->errors = $obj->errors;
|
|
||||||
dol_syslog("Error generating document for ".__CLASS__.". Error: ".$obj->error, LOG_ERR);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!$filefound) {
|
|
||||||
$this->error = $langs->trans("Error").' Failed to load doc generator with modelpaths='.$modelspath.' - modele='.$modele;
|
|
||||||
$this->errors[] = $this->error;
|
|
||||||
dol_syslog($this->error, LOG_ERR);
|
|
||||||
} else {
|
|
||||||
$this->error = $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $filefound);
|
|
||||||
$this->errors[] = $this->error;
|
|
||||||
dol_syslog($this->error, LOG_ERR);
|
|
||||||
}
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($obj->type == 'odt' && !empty($srctemplatepath)) {
|
||||||
|
if (!dol_is_file($srctemplatepath)) {
|
||||||
|
dol_syslog("Failed to locate template file ".$srctemplatepath, LOG_WARNING);
|
||||||
|
$this->error = 'ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We save charset_output to restore it because write_file can change it if needed for
|
||||||
|
// output format that does not support UTF8.
|
||||||
|
$sav_charset_output = empty($outputlangs->charset_output) ? '' : $outputlangs->charset_output;
|
||||||
|
|
||||||
|
if (in_array(get_class($this), array('Adherent'))) {
|
||||||
|
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams);
|
||||||
} else {
|
} else {
|
||||||
return $reshook;
|
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||||
|
}
|
||||||
|
// After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index.
|
||||||
|
|
||||||
|
if ($resultwritefile > 0) {
|
||||||
|
$outputlangs->charset_output = $sav_charset_output;
|
||||||
|
|
||||||
|
// We delete old preview
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
dol_delete_preview($this);
|
||||||
|
|
||||||
|
// Index file in database
|
||||||
|
if (!empty($obj->result['fullpath'])) {
|
||||||
|
$destfull = $obj->result['fullpath'];
|
||||||
|
|
||||||
|
// Update the last_main_doc field into main object (if document generator has property ->update_main_doc_field set)
|
||||||
|
$update_main_doc_field = 0;
|
||||||
|
if (!empty($obj->update_main_doc_field)) {
|
||||||
|
$update_main_doc_field = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->indexFile($destfull, $update_main_doc_field);
|
||||||
|
} else {
|
||||||
|
dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Success in building document. We build meta file.
|
||||||
|
dol_meta_create($this);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$outputlangs->charset_output = $sav_charset_output;
|
||||||
|
$this->error = $obj->error;
|
||||||
|
$this->errors = $obj->errors;
|
||||||
|
dol_syslog("Error generating document for ".__CLASS__.". Error: ".$obj->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -723,14 +723,6 @@ class Conf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// conf->mailing->email_from = email by default to send Dolibarr emailings
|
|
||||||
if (isModEnabled('mailing')) {
|
|
||||||
$this->mailing->email_from = $this->email_from;
|
|
||||||
if (!empty($this->global->MAILING_EMAIL_FROM)) {
|
|
||||||
$this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
||||||
$this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
|
$this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,6 +112,11 @@ class DolGraph
|
|||||||
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
|
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
|
||||||
$this->bgcolor = array(235, 235, 224);
|
$this->bgcolor = array(235, 235, 224);
|
||||||
|
|
||||||
|
// For small screen, we prefer a default with of 300
|
||||||
|
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||||
|
$this->width = 300;
|
||||||
|
}
|
||||||
|
|
||||||
// Load color of the theme
|
// Load color of the theme
|
||||||
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
||||||
if (is_readable($color_file)) {
|
if (is_readable($color_file)) {
|
||||||
|
|||||||
@ -726,6 +726,8 @@ class ExtraFields
|
|||||||
|
|
||||||
if (is_array($param) && count($param) > 0) {
|
if (is_array($param) && count($param) > 0) {
|
||||||
$params = serialize($param);
|
$params = serialize($param);
|
||||||
|
} elseif (is_array($param)) {
|
||||||
|
$params = '';
|
||||||
} elseif (strlen($param) > 0) {
|
} elseif (strlen($param) > 0) {
|
||||||
$params = trim($param);
|
$params = trim($param);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -266,7 +266,7 @@ class FileUpload
|
|||||||
protected function getFileObject($file_name)
|
protected function getFileObject($file_name)
|
||||||
{
|
{
|
||||||
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file_path = $this->options['upload_dir'].$file_name;
|
$file_path = $this->options['upload_dir'].$file_name;
|
||||||
@ -310,7 +310,7 @@ class FileUpload
|
|||||||
global $maxwidthmini, $maxheightmini;
|
global $maxwidthmini, $maxheightmini;
|
||||||
|
|
||||||
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file_path = $this->options['upload_dir'].$file_name;
|
$file_path = $this->options['upload_dir'].$file_name;
|
||||||
@ -345,7 +345,7 @@ class FileUpload
|
|||||||
protected function validate($uploaded_file, $file, $error, $index)
|
protected function validate($uploaded_file, $file, $error, $index)
|
||||||
{
|
{
|
||||||
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -459,12 +459,12 @@ class FileUpload
|
|||||||
* @param string $type Type
|
* @param string $type Type
|
||||||
* @param string $error Error
|
* @param string $error Error
|
||||||
* @param string $index Index
|
* @param string $index Index
|
||||||
* @return stdClass
|
* @return stdClass|null
|
||||||
*/
|
*/
|
||||||
protected function handleFileUpload($uploaded_file, $name, $size, $type, $error, $index)
|
protected function handleFileUpload($uploaded_file, $name, $size, $type, $error, $index)
|
||||||
{
|
{
|
||||||
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = new stdClass();
|
$file = new stdClass();
|
||||||
@ -590,12 +590,12 @@ class FileUpload
|
|||||||
/**
|
/**
|
||||||
* Delete uploaded file
|
* Delete uploaded file
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
if (!getDolGlobalInt('MAIN_USE_JQUERY_FILEUPLOAD')) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$file_name = isset($_REQUEST['file']) ?
|
$file_name = isset($_REQUEST['file']) ?
|
||||||
|
|||||||
@ -6753,8 +6753,8 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Zone de saisie manuelle de la date
|
// Zone de saisie manuelle de la date
|
||||||
$retstring .= '<div class="nowrap inline-block divfordateinput">';
|
$retstring .= '<div class="nowraponall inline-block divfordateinput">';
|
||||||
$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
|
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
|
||||||
$retstring .= ($disabled ? ' disabled' : '');
|
$retstring .= ($disabled ? ' disabled' : '');
|
||||||
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
|
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
|
||||||
$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
||||||
@ -10235,9 +10235,9 @@ class Form
|
|||||||
$out .= '</select>';
|
$out .= '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out;
|
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
return $out;
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@ -1445,7 +1445,25 @@ class FormFile
|
|||||||
if (in_array($modulepart, array('product', 'produit', 'service'))) {
|
if (in_array($modulepart, array('product', 'produit', 'service'))) {
|
||||||
$newmodulepart = 'produit|service';
|
$newmodulepart = 'produit|service';
|
||||||
}
|
}
|
||||||
|
if (image_format_supported($file['name']) > 0) {
|
||||||
|
if ($permtoeditline) {
|
||||||
|
$moreparaminurl = '';
|
||||||
|
if (!empty($object->id) && $object->id > 0) {
|
||||||
|
$moreparaminurl .= '&id='.$object->id;
|
||||||
|
} elseif (GETPOST('website', 'alpha')) {
|
||||||
|
$moreparaminurl .= '&website='.GETPOST('website', 'alpha');
|
||||||
|
}
|
||||||
|
// Set the backtourl
|
||||||
|
if ($modulepart == 'medias' && !GETPOST('website')) {
|
||||||
|
$moreparaminurl .= '&backtourl='.urlencode(DOL_URL_ROOT.'/ecm/index_medias.php?file_manager=1&modulepart='.$modulepart.'§ion_dir='.$relativepath);
|
||||||
|
}
|
||||||
|
if ($modulepart == 'medias' && !GETPOST('website')) {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/ecm/index_medias.php?action=confirmconvertimgwebp&token='.newToken().'§ion_dir='.urlencode($relativepath).'&filetoregenerate='.urlencode($fileinfo['basename']).'&module='.$modulepart.$param.$moreparaminurl.'" title="'.dol_escape_htmltag($langs->trans("GenerateChosenImgWebp")).'">'.img_picto('', 'images', 'class="flip marginrightonly"').'</a>';
|
||||||
|
} elseif ($modulepart == 'medias' && GETPOST('website')) {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/website/index.php?action=confirmconvertimgwebp&token='.newToken().'§ion_dir='.urlencode($relativepath).'&filetoregenerate='.urlencode($fileinfo['basename']).'&module='.$modulepart.$param.$moreparaminurl.'" title="'.dol_escape_htmltag($langs->trans("GenerateChosenImgWebp")).'">'.img_picto('', 'images', 'class="flip marginrightonly"').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!$disablecrop && image_format_supported($file['name']) > 0) {
|
if (!$disablecrop && image_format_supported($file['name']) > 0) {
|
||||||
if ($permtoeditline) {
|
if ($permtoeditline) {
|
||||||
// Link to resize
|
// Link to resize
|
||||||
|
|||||||
@ -98,7 +98,7 @@ class FormMargin
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pv = $line->total_ht;
|
$pv = $line->total_ht;
|
||||||
$pa_ht = (($pv < 0 || ($pv == 0 && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
$pa_ht = (($pv < 0 || ($pv == 0 && in_array($object->element, array('facture', 'facture_fourn')) && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
||||||
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode
|
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode
|
||||||
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|
||||||
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
|
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class FormProjets
|
|||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output a combo list with projects qualified for a third party / user
|
* Output a combo list with projects qualified for a third party / user
|
||||||
*
|
*
|
||||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* @param string|Project $selected Id of preselected project or Project (or ''). Note: If you know the ref, you can also provide it into $selected_input_value to save one request in some cases.
|
* @param string|Project $selected Id of preselected project or Project (or ''). Note: If you know the ref, you can also provide it into $selected_input_value to save one request in some cases.
|
||||||
@ -145,7 +145,7 @@ class FormProjets
|
|||||||
* @param int $htmlid Html id to use instead of htmlname
|
* @param int $htmlid Html id to use instead of htmlname
|
||||||
* @param string $morecss More CSS
|
* @param string $morecss More CSS
|
||||||
* @param string $morefilter More filters (Must be a sql sanitized string)
|
* @param string $morefilter More filters (Must be a sql sanitized string)
|
||||||
* @return int Nb of project if OK, <0 if KO
|
* @return int|string|array HTML string or array of option or <0 if KO
|
||||||
*/
|
*/
|
||||||
public function select_projects_list($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500', $morefilter = '')
|
public function select_projects_list($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500', $morefilter = '')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -339,7 +339,7 @@ class FormSetup
|
|||||||
* Method used to test module builder convertion to this form usage
|
* Method used to test module builder convertion to this form usage
|
||||||
*
|
*
|
||||||
* @param array $params an array of arrays of params from old modulBuilder params
|
* @param array $params an array of arrays of params from old modulBuilder params
|
||||||
* @return void
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function addItemsFromParamsArray($params)
|
public function addItemsFromParamsArray($params)
|
||||||
{
|
{
|
||||||
@ -347,6 +347,7 @@ class FormSetup
|
|||||||
foreach ($params as $confKey => $param) {
|
foreach ($params as $confKey => $param) {
|
||||||
$this->addItemFromParams($confKey, $param); // todo manage error
|
$this->addItemFromParams($confKey, $param); // todo manage error
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2020-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -98,7 +98,7 @@ $arrayoftype = array(
|
|||||||
'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"),
|
'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"),
|
||||||
'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('commande'), 'ClassPath' => "/commande/class/commande.class.php"),
|
'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('commande'), 'ClassPath' => "/commande/class/commande.class.php"),
|
||||||
'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/facture/class/facture.class.php"),
|
'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/facture/class/facture.class.php"),
|
||||||
'invoice_template'=>array('langs'=>'facture', 'label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'),
|
'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'),
|
||||||
'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'),
|
'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'),
|
||||||
'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'),
|
'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'),
|
||||||
'bom' => array('label' => 'BOM', 'picto'=>'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')),
|
'bom' => array('label' => 'BOM', 'picto'=>'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')),
|
||||||
|
|||||||
@ -703,10 +703,10 @@ function currency_name($code_iso, $withcode = '', $outputlangs = null)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne le nom traduit de la forme juridique
|
* Return the name translated of juridical status
|
||||||
*
|
*
|
||||||
* @param string $code Code de la forme juridique
|
* @param string $code Code of juridical status
|
||||||
* @return string Nom traduit du pays
|
* @return string Value of the juridical status
|
||||||
*/
|
*/
|
||||||
function getFormeJuridiqueLabel($code)
|
function getFormeJuridiqueLabel($code)
|
||||||
{
|
{
|
||||||
@ -717,20 +717,24 @@ function getFormeJuridiqueLabel($code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_forme_juridique";
|
$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_forme_juridique";
|
||||||
$sql .= " WHERE code='".$db->escape($code)."'";
|
$sql .= " WHERE code = '".$db->escape($code)."'";
|
||||||
|
|
||||||
dol_syslog("Company.lib::getFormeJuridiqueLabel", LOG_DEBUG);
|
dol_syslog("Company.lib::getFormeJuridiqueLabel", LOG_DEBUG);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
if ($num) {
|
if ($num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$label = ($obj->libelle != '-' ? $obj->libelle : '');
|
$label = ($obj->libelle != '-' ? $obj->libelle : '');
|
||||||
return $label;
|
|
||||||
|
return $langs->trans($label);
|
||||||
} else {
|
} else {
|
||||||
return $langs->trans("NotDefined");
|
return $langs->trans("NotDefined");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return 'Error '.$db->lasterror();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1494,7 +1498,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
*/
|
*/
|
||||||
function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '')
|
function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '')
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf, $hookmanager;
|
||||||
global $form;
|
global $form;
|
||||||
global $param, $massactionbutton;
|
global $param, $massactionbutton;
|
||||||
|
|
||||||
@ -1541,8 +1545,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
$sql = '';
|
$sql = '';
|
||||||
|
|
||||||
if (isModEnabled('agenda')) {
|
if (isModEnabled('agenda')) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($db);
|
|
||||||
// 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('agendadao'));
|
$hookmanager->initHooks(array('agendadao'));
|
||||||
|
|
||||||
@ -2238,8 +2240,7 @@ function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND")
|
|||||||
*/
|
*/
|
||||||
function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
|
function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
|
||||||
{
|
{
|
||||||
global $conf, $db;
|
global $db;
|
||||||
// Condition on actioncode
|
|
||||||
|
|
||||||
if ($donetodo == 'todo') {
|
if ($donetodo == 'todo') {
|
||||||
$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||||
@ -2266,12 +2267,10 @@ function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
|
|||||||
*/
|
*/
|
||||||
function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
|
function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $db;
|
global $db;
|
||||||
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
|
|
||||||
if (isModEnabled('mailing') && !empty($objcon->email)
|
|
||||||
&& (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) {
|
|
||||||
$langs->load("mails");
|
|
||||||
|
|
||||||
|
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
|
||||||
|
if (isModEnabled('mailing') && !empty($objcon->email) && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) {
|
||||||
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
|
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
|
||||||
$sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
|
$sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
|
||||||
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
|
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
|
||||||
@ -2292,6 +2291,9 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
|
|||||||
$sql2 .= " AND mc.statut = 1";
|
$sql2 .= " AND mc.statut = 1";
|
||||||
$sql2 .= " AND u.rowid = m.fk_user_valid";
|
$sql2 .= " AND u.rowid = m.fk_user_valid";
|
||||||
$sql2 .= " AND mc.fk_mailing=m.rowid";
|
$sql2 .= " AND mc.fk_mailing=m.rowid";
|
||||||
|
|
||||||
return $sql2;
|
return $sql2;
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,6 +71,25 @@ if (!function_exists('utf8_decode')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the full path of the directory where a module (or an object of a module) stores its files. Path may depends on the entity if a multicompany module is enabled.
|
||||||
|
*
|
||||||
|
* @param CommonObject $object Dolibarr common object
|
||||||
|
* @param string $module Override object element, for example to use 'mycompany' instead of 'societe'
|
||||||
|
* @return string|void The path of the relative directory of the module
|
||||||
|
* @since Dolibarr V18
|
||||||
|
*/
|
||||||
|
function getMultidirOutput($object, $module = '')
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
if (!is_object($object) && empty($module)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (empty($module) && !empty($object->element)) {
|
||||||
|
$module = $object->element;
|
||||||
|
}
|
||||||
|
return $conf->$module->multidir_output[(!empty($object->entity) ? $object->entity : $conf->entity)];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return dolibarr global constant string value
|
* Return dolibarr global constant string value
|
||||||
@ -5441,7 +5460,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
|
|||||||
} else {
|
} else {
|
||||||
$nextpage = 0;
|
$nextpage = 0;
|
||||||
}
|
}
|
||||||
//print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage;
|
//print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage.'-hideselectlimit='.$hideselectlimit.'-hidenavigation='.$hidenavigation;
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin title -->\n";
|
print "<!-- Begin title -->\n";
|
||||||
@ -5584,7 +5603,8 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
|
|||||||
print $beforearrows;
|
print $beforearrows;
|
||||||
print '</li>';
|
print '</li>';
|
||||||
}
|
}
|
||||||
if (!empty($hidenavigation)) {
|
|
||||||
|
if (empty($hidenavigation)) {
|
||||||
if ((int) $limit > 0 && empty($hideselectlimit)) {
|
if ((int) $limit > 0 && empty($hideselectlimit)) {
|
||||||
$pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000';
|
$pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000';
|
||||||
$pagesizechoices .= ',5000:5000,10000:10000,20000:20000';
|
$pagesizechoices .= ',5000:5000,10000:10000,20000:20000';
|
||||||
@ -8988,7 +9008,7 @@ function verifCond($strToEvaluate)
|
|||||||
* @param string $s String to evaluate
|
* @param string $s String to evaluate
|
||||||
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
||||||
* @param int $hideerrors 1=Hide errors
|
* @param int $hideerrors 1=Hide errors
|
||||||
* @param string $onlysimplestring '0' (used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (not used)=Accept also ';[]'
|
* @param string $onlysimplestring '0' (used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (rarely used)=Accept also '[]'
|
||||||
* @return mixed Nothing or return result of eval
|
* @return mixed Nothing or return result of eval
|
||||||
*/
|
*/
|
||||||
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
||||||
@ -9024,15 +9044,21 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
|||||||
}
|
}
|
||||||
} elseif ($onlysimplestring == '2') {
|
} elseif ($onlysimplestring == '2') {
|
||||||
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@;[]', '/').']/i', $s)) {
|
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@[]', '/').']/i', $s)) {
|
||||||
if ($returnvalue) {
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||||
} else {
|
} else {
|
||||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
// TODO
|
||||||
|
// We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled('
|
||||||
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (is_array($s) || $s === 'Array') {
|
||||||
|
return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true);
|
||||||
|
}
|
||||||
if (strpos($s, '::') !== false) {
|
if (strpos($s, '::') !== false) {
|
||||||
if ($returnvalue) {
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
||||||
@ -10862,8 +10888,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
*
|
*
|
||||||
* @param string $label Label or tooltip of button. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text.
|
* @param string $label Label or tooltip of button. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text.
|
||||||
* @param string $text Optional : short label on button. Can be escaped HTML content or full simple text.
|
* @param string $text Optional : short label on button. Can be escaped HTML content or full simple text.
|
||||||
* @param string $actionType 'default', 'delete', 'danger'
|
* @param string $actionType 'default', 'delete', 'danger', 'email', ...
|
||||||
* @param string $url Url for link
|
* @param string|array $url Url for link or array of subbutton description
|
||||||
* @param string $id Attribute id of button
|
* @param string $id Attribute id of button
|
||||||
* @param int|boolean $userRight User action right
|
* @param int|boolean $userRight User action right
|
||||||
* // phpcs:disable
|
* // phpcs:disable
|
||||||
@ -10890,7 +10916,26 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
|
|||||||
{
|
{
|
||||||
global $hookmanager, $action, $object, $langs;
|
global $hookmanager, $action, $object, $langs;
|
||||||
|
|
||||||
//var_dump($params);
|
// If $url is an array, we must build a dropdown button
|
||||||
|
if (is_array($url)) {
|
||||||
|
$out = '<div class="dropdown inline-block dropdown-holder">';
|
||||||
|
$out .= '<a style="margin-right: auto;" class="dropdown-toggle butAction" data-toggle="dropdown">'.$label.'</a>';
|
||||||
|
$out .= '<div class="dropdown-content">';
|
||||||
|
foreach ($url as $subbutton) {
|
||||||
|
if ($subbutton['enabled'] && $subbutton['perm']) {
|
||||||
|
if (!empty($subbutton['lang'])) {
|
||||||
|
$langs->load($subbutton['lang']);
|
||||||
|
}
|
||||||
|
$out .= dolGetButtonAction('', $langs->trans($subbutton['label']), 'default', DOL_URL_ROOT.$subbutton['url'].(empty($params['backtopage']) ? '' : '&backtopage='.urlencode($params['backtopage'])), '', 1, array('isDropDown' => true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$out .= "</div>";
|
||||||
|
$out .= "</div>";
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If $url is a simple link
|
||||||
if (!empty($params['isDropdown']))
|
if (!empty($params['isDropdown']))
|
||||||
$class = "dropdown-item";
|
$class = "dropdown-item";
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -416,3 +416,207 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
|
|
||||||
return $error ? -1 : 1;
|
return $error ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of existing objects from directory
|
||||||
|
*
|
||||||
|
* @param string $destdir Directory
|
||||||
|
* @return array|int <=0 if KO, array if OK
|
||||||
|
*/
|
||||||
|
function dolGetListOfObjectClasses($destdir)
|
||||||
|
{
|
||||||
|
$objects = array();
|
||||||
|
$listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$');
|
||||||
|
foreach ($listofobject as $fileobj) {
|
||||||
|
if (preg_match('/^api_/', $fileobj['name'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (preg_match('/^actions_/', $fileobj['name'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmpcontent = file_get_contents($fileobj['fullname']);
|
||||||
|
$reg = array();
|
||||||
|
if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) {
|
||||||
|
$objectnameloop = $reg[1];
|
||||||
|
$objects[$fileobj['fullname']] = $objectnameloop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count($objects)>0) {
|
||||||
|
return $objects;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete all permissions
|
||||||
|
*
|
||||||
|
* @param string $file file with path
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function deletePerms($file)
|
||||||
|
{
|
||||||
|
$start = "/* BEGIN MODULEBUILDER PERMISSIONS */";
|
||||||
|
$end = "/* END MODULEBUILDER PERMISSIONS */";
|
||||||
|
$i = 1;
|
||||||
|
$array = array();
|
||||||
|
$lines = file($file);
|
||||||
|
// Search for start and end lines
|
||||||
|
foreach ($lines as $i => $line) {
|
||||||
|
if (strpos($line, $start) !== false) {
|
||||||
|
$start_line = $i + 1;
|
||||||
|
|
||||||
|
// Copy lines until the end on array
|
||||||
|
while (($line = $lines[++$i]) !== false) {
|
||||||
|
if (strpos($line, $end) !== false) {
|
||||||
|
$end_line = $i + 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$array[] = $line;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$allContent = implode("", $array);
|
||||||
|
dolReplaceInFile($file, array($allContent => ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewriting all permissions after any actions
|
||||||
|
* @param string $file filename or path
|
||||||
|
* @param array $permissions permissions existing in file
|
||||||
|
* @param int|null $key key for permission needed
|
||||||
|
* @param array|null $right $right to update or add
|
||||||
|
* @param int $action 0 for delete, 1 for add, 2 for update
|
||||||
|
* @return int 1 if OK,-1 if KO
|
||||||
|
*/
|
||||||
|
function reWriteAllPermissions($file, $permissions, $key, $right, $action)
|
||||||
|
{
|
||||||
|
$error = 0;
|
||||||
|
$rights = array();
|
||||||
|
if ($action == 0) {
|
||||||
|
// delete right from permissions array
|
||||||
|
array_splice($permissions, array_search($permissions[$key], $permissions), 1);
|
||||||
|
} elseif ($action == 1) {
|
||||||
|
array_push($permissions, $right);
|
||||||
|
} elseif ($action == 2 && !empty($right)) {
|
||||||
|
// update right from permissions array
|
||||||
|
array_splice($permissions, array_search($permissions[$key], $permissions), 1, $right);
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if (!$error) {
|
||||||
|
// prepare permissions array
|
||||||
|
$count_perms = count($permissions);
|
||||||
|
for ($i = 0;$i<$count_perms;$i++) {
|
||||||
|
$permissions[$i][0] = "\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1)";
|
||||||
|
$permissions[$i][1] = "\$this->rights[\$r][1] = '".$permissions[$i][1]."'";
|
||||||
|
$permissions[$i][4] = "\$this->rights[\$r][4] = '".$permissions[$i][4]."'";
|
||||||
|
$permissions[$i][5] = "\$this->rights[\$r][5] = '".$permissions[$i][5]."';\n\t\t";
|
||||||
|
}
|
||||||
|
|
||||||
|
//convert to string
|
||||||
|
foreach ($permissions as $perms) {
|
||||||
|
$rights[] = implode(";\n\t\t", $perms);
|
||||||
|
$rights[] = "\$r++;\n\t\t";
|
||||||
|
}
|
||||||
|
$rights_str = implode("", $rights);
|
||||||
|
// delete all permission from file
|
||||||
|
deletePerms($file);
|
||||||
|
// rewrite all permission again
|
||||||
|
dolReplaceInFile($file, array('/* BEGIN MODULEBUILDER PERMISSIONS */' => '/* BEGIN MODULEBUILDER PERMISSIONS */'."\n\t\t".$rights_str));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write all properties of the object in AsciiDoc format
|
||||||
|
* @param string $file path of the class
|
||||||
|
* @param string $objectname name of the objectClass
|
||||||
|
* @param string $destfile file where write table of properties
|
||||||
|
* @return int 1 if OK, -1 if KO
|
||||||
|
*/
|
||||||
|
function writePropsInAsciiDoc($file, $objectname, $destfile)
|
||||||
|
{
|
||||||
|
|
||||||
|
// stock all properties in array
|
||||||
|
$attributesUnique = array ('label', 'type', 'arrayofkeyval', 'notnull', 'default', 'index', 'foreignkey', 'position', 'enabled', 'visible', 'noteditable', 'alwayseditable', 'searchall', 'isameasure', 'css','cssview','csslist', 'help', 'showoncombobox', 'validate','comment','picto' );
|
||||||
|
|
||||||
|
$start = "public \$fields=array(";
|
||||||
|
$end = ");";
|
||||||
|
$i = 1;
|
||||||
|
$keys = array();
|
||||||
|
$lines = file($file);
|
||||||
|
// Search for start and end lines
|
||||||
|
foreach ($lines as $i => $line) {
|
||||||
|
if (strpos($line, $start) !== false) {
|
||||||
|
// Copy lines until the end on array
|
||||||
|
while (($line = $lines[++$i]) !== false) {
|
||||||
|
if (strpos($line, $end) !== false) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$keys[] = $line;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// write the begin of table with specifics options
|
||||||
|
$table = "== DATA SPECIFICATIONS\n";
|
||||||
|
$table .= "== Table of fields and their properties for object *$objectname* : \n";
|
||||||
|
$table .= "[options='header',grid=rows,frame=topbot,width=100%,caption=Organisation]\n";
|
||||||
|
$table .= "|===\n";
|
||||||
|
$table .= "|code";
|
||||||
|
// write all properties in the header of the table
|
||||||
|
foreach ($attributesUnique as $attUnique) {
|
||||||
|
$table .= "|".$attUnique;
|
||||||
|
}
|
||||||
|
$table .="\n";
|
||||||
|
$countKeys = count($keys);
|
||||||
|
for ($j=0;$j<$countKeys;$j++) {
|
||||||
|
$string = $keys[$j];
|
||||||
|
$string = trim($string, "'");
|
||||||
|
$string = rtrim($string, ",");
|
||||||
|
|
||||||
|
$array = [];
|
||||||
|
eval("\$array = [$string];");
|
||||||
|
|
||||||
|
// check if is array after cleaning string
|
||||||
|
if (!is_array($array)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// name of field
|
||||||
|
$field = array_keys($array);
|
||||||
|
// all values of each property
|
||||||
|
$values = array_values($array);
|
||||||
|
|
||||||
|
|
||||||
|
// check each field has all properties and add it if missed
|
||||||
|
if (count($values[0]) <=22) {
|
||||||
|
foreach ($attributesUnique as $cle) {
|
||||||
|
if (!in_array($cle, array_keys($values[0]))) {
|
||||||
|
$values[0][$cle] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reorganize $values with order attributeUnique
|
||||||
|
$valuesRestructured = array();
|
||||||
|
foreach ($attributesUnique as $key) {
|
||||||
|
if (array_key_exists($key, $values[0])) {
|
||||||
|
$valuesRestructured[$key] = $values[0][$key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// write all values of properties for each field
|
||||||
|
$table .= "|*".$field[0]."*|";
|
||||||
|
$table .= implode("|", array_values($valuesRestructured))."\n";
|
||||||
|
}
|
||||||
|
// end table
|
||||||
|
$table .= "|===";
|
||||||
|
//write in file
|
||||||
|
$writeInFile = dolReplaceInFile($destfile, array('== DATA SPECIFICATIONS'=> $table));
|
||||||
|
if ($writeInFile<0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|||||||
@ -1069,6 +1069,18 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||||||
if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
|
if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Check if Extrafields is totalizable
|
||||||
|
foreach ($extrafields->attributes['projet_task']['totalizable'] as $key=>$value) {
|
||||||
|
if ($arrayfields['ef.'.$key]['checked'] == 1) {
|
||||||
|
print '<td align="right">';
|
||||||
|
if ($value == 1) {
|
||||||
|
print $totalarray['totalizable'][$key]['total'];
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class=""></td>';
|
print '<td class=""></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1734,8 +1734,8 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
|
|||||||
$langs->load('accountancy');
|
$langs->load('accountancy');
|
||||||
$journallabel = '';
|
$journallabel = '';
|
||||||
if ($objp->label) {
|
if ($objp->label) {
|
||||||
$journallabelwithoutspan = $langs->transnoentities($objp->label);
|
$journallabelwithoutspan = $langs->trans($objp->label);
|
||||||
$journallabel = '<span class="opacitymedium">('.$langs->transnoentities($objp->label).')</span>'; // Label of bank account in llx_accounting_journal
|
$journallabel = '<span class="opacitymedium">('.$langs->trans($objp->label).')</span>'; // Label of bank account in llx_accounting_journal
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ...
|
$key = $langs->trans("AccountingJournalType".$objp->nature); // $objp->nature is 1, 2, 3 ...
|
||||||
|
|||||||
@ -248,10 +248,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
|
|
||||||
public $export_icon;
|
public $export_icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array export enabled
|
||||||
|
*/
|
||||||
|
public $export_enabled;
|
||||||
public $export_permission;
|
public $export_permission;
|
||||||
public $export_fields_array;
|
public $export_fields_array;
|
||||||
public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid'
|
public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid'
|
||||||
public $export_entities_array;
|
public $export_entities_array;
|
||||||
|
public $export_examplevalues_array;
|
||||||
public $export_help_array;
|
public $export_help_array;
|
||||||
public $export_special_array; // special or computed field
|
public $export_special_array; // special or computed field
|
||||||
public $export_dependencies_array;
|
public $export_dependencies_array;
|
||||||
@ -273,9 +278,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
public $import_label;
|
public $import_label;
|
||||||
|
|
||||||
public $import_icon;
|
public $import_icon;
|
||||||
|
|
||||||
public $import_entities_array;
|
public $import_entities_array;
|
||||||
public $import_tables_array;
|
public $import_tables_array;
|
||||||
|
public $import_tables_creator_array;
|
||||||
public $import_fields_array;
|
public $import_fields_array;
|
||||||
public $import_fieldshidden_array;
|
public $import_fieldshidden_array;
|
||||||
public $import_convertvalue_array;
|
public $import_convertvalue_array;
|
||||||
|
|||||||
@ -296,18 +296,18 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($conf->commande->multidir_output[$conf->entity]) {
|
if (getMultidirOutput($object)) {
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$deja_regle = 0;
|
$deja_regle = 0;
|
||||||
|
|
||||||
// Definition of $dir and $file
|
// Definition of $dir and $file
|
||||||
if ($object->specimen) {
|
if ($object->specimen) {
|
||||||
$dir = $conf->commande->multidir_output[$conf->entity];
|
$dir = getMultidirOutput($object);
|
||||||
$file = $dir."/SPECIMEN.pdf";
|
$file = $dir."/SPECIMEN.pdf";
|
||||||
} else {
|
} else {
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->commande->multidir_output[$object->entity]."/".$objectref;
|
$dir = getMultidirOutput($object)."/".$objectref;
|
||||||
$file = $dir."/".$objectref.".pdf";
|
$file = $dir."/".$objectref.".pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1447,7 +1447,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null, $titlekey = "PdfOrderTitle")
|
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null, $titlekey = "PdfOrderTitle")
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager, $mysoc;
|
||||||
|
|
||||||
$ltrdirection = 'L';
|
$ltrdirection = 'L';
|
||||||
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
|
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
|
||||||
@ -1473,8 +1473,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
if (!getDolGlobalInt('PDF_DISABLE_MYCOMPANY_LOGO')) {
|
if (!getDolGlobalInt('PDF_DISABLE_MYCOMPANY_LOGO')) {
|
||||||
if ($this->emetteur->logo) {
|
if ($this->emetteur->logo) {
|
||||||
$logodir = $conf->mycompany->dir_output;
|
$logodir = $conf->mycompany->dir_output;
|
||||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
if (!empty(getMultidirOutput($mysoc, 'mycompany'))) {
|
||||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
$logodir = getMultidirOutput($mysoc, 'mycompany');
|
||||||
}
|
}
|
||||||
if (!getDolGlobalInt('MAIN_PDF_USE_LARGE_LOGO')) {
|
if (!getDolGlobalInt('MAIN_PDF_USE_LARGE_LOGO')) {
|
||||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||||
|
|||||||
@ -142,16 +142,16 @@ class modCategorie extends DolibarrModules
|
|||||||
if (isModEnabled("societe")) {
|
if (isModEnabled("societe")) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."4=Contact";
|
$typeexample .= ($typeexample ? " / " : "")."4=Contact";
|
||||||
}
|
}
|
||||||
if (!empty($conf->bank->enabled)) {
|
if (isModEnabled('bank')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."5=Bank account";
|
$typeexample .= ($typeexample ? " / " : "")."5=Bank account";
|
||||||
}
|
}
|
||||||
if (isModEnabled('project')) {
|
if (isModEnabled('project')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."6=Project";
|
$typeexample .= ($typeexample ? " / " : "")."6=Project";
|
||||||
}
|
}
|
||||||
if (!empty($conf->user->enabled)) {
|
if (isModEnabled('user')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."7=User";
|
$typeexample .= ($typeexample ? " / " : "")."7=User";
|
||||||
}
|
}
|
||||||
if (!empty($conf->bank->enabled)) {
|
if (isModEnabled('bank')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."8=Bank line";
|
$typeexample .= ($typeexample ? " / " : "")."8=Bank line";
|
||||||
}
|
}
|
||||||
if (isModEnabled('stock')) {
|
if (isModEnabled('stock')) {
|
||||||
@ -411,7 +411,7 @@ class modCategorie extends DolibarrModules
|
|||||||
$this->export_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
$this->export_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
||||||
$this->export_label[$r] = 'CatUsersList';
|
$this->export_label[$r] = 'CatUsersList';
|
||||||
$this->export_icon[$r] = $this->picto;
|
$this->export_icon[$r] = $this->picto;
|
||||||
$this->export_enabled[$r] = '!empty($conf->user->enabled)';
|
$this->export_enabled[$r] = 'isModEnabled("user")';
|
||||||
$this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export"));
|
$this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export"));
|
||||||
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname');
|
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname');
|
||||||
$this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
|
$this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
|
||||||
@ -594,7 +594,7 @@ class modCategorie extends DolibarrModules
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 7 Users
|
// 7 Users
|
||||||
if (!empty($conf->user->enabled)) {
|
if (isModEnabled('user')) {
|
||||||
$r++;
|
$r++;
|
||||||
$this->import_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
$this->import_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
||||||
$this->import_label[$r] = "CatUsersLinks"; // Translation key
|
$this->import_label[$r] = "CatUsersLinks"; // Translation key
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2023 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
|
||||||
@ -342,10 +342,10 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||||||
$odfHandler = new odf(
|
$odfHandler = new odf(
|
||||||
$srctemplatepath,
|
$srctemplatepath,
|
||||||
array(
|
array(
|
||||||
'PATH_TO_TMP' => $conf->mrp->dir_temp,
|
'PATH_TO_TMP' => $conf->mrp->dir_temp,
|
||||||
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
|
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
|
||||||
'DELIMITER_LEFT' => '{',
|
'DELIMITER_LEFT' => '{',
|
||||||
'DELIMITER_RIGHT' => '}'
|
'DELIMITER_RIGHT' => '}'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@ -359,8 +359,6 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||||||
// [!-- BEGIN lines --]*[!-- END lines --]
|
// [!-- BEGIN lines --]*[!-- END lines --]
|
||||||
//print html_entity_decode($odfHandler->__toString());
|
//print html_entity_decode($odfHandler->__toString());
|
||||||
//print exit;
|
//print exit;
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
// Make substitutions into odt of freetext
|
// Make substitutions into odt of freetext
|
||||||
try {
|
try {
|
||||||
@ -461,7 +459,7 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||||||
|
|
||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
*/
|
|
||||||
// Write new file
|
// Write new file
|
||||||
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -207,7 +207,7 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||||||
// Load traductions files required by page
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch", "stocks", "stocktransfer@stocktransfer"));
|
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch", "stocks", "stocktransfer@stocktransfer"));
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = is_array($object->lines) ? count($object->lines) : 0;
|
||||||
|
|
||||||
// Loop on each lines to detect if there is at least one image to show
|
// Loop on each lines to detect if there is at least one image to show
|
||||||
$realpatharray = array();
|
$realpatharray = array();
|
||||||
@ -287,7 +287,7 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||||||
$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
// Set nblines with the new facture lines content after hook
|
// Set nblines with the new facture lines content after hook
|
||||||
$nblines = count($object->lines);
|
$nblines = is_array($object->lines) ? count($object->lines) : 0;
|
||||||
|
|
||||||
$pdf = pdf_getInstance($this->format);
|
$pdf = pdf_getInstance($this->format);
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@ -777,7 +777,7 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||||||
/**
|
/**
|
||||||
* Show table for lines
|
* Show table for lines
|
||||||
*
|
*
|
||||||
* @param PDF $pdf Object PDF
|
* @param TCPDF $pdf Object PDF
|
||||||
* @param string $tab_top Top position of table
|
* @param string $tab_top Top position of table
|
||||||
* @param string $tab_height Height of table (rectangle)
|
* @param string $tab_height Height of table (rectangle)
|
||||||
* @param int $nexY Y
|
* @param int $nexY Y
|
||||||
@ -971,17 +971,11 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||||||
$pdf->SetFont('', 'B', $default_font_size + 2);
|
$pdf->SetFont('', 'B', $default_font_size + 2);
|
||||||
$pdf->SetXY($posx, $posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$title = $outputlangs->transnoentities("StockTransferSheet");
|
$title = $outputlangs->transnoentities("StockTransferSheet").' '.$object->ref;
|
||||||
$pdf->MultiCell($w, 4, $title, '', 'R');
|
$pdf->MultiCell($w, 4, $title, '', 'R');
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size + 1);
|
$pdf->SetFont('', '', $default_font_size + 1);
|
||||||
|
|
||||||
$posy += 5;
|
|
||||||
|
|
||||||
$pdf->SetXY($posx, $posy);
|
|
||||||
$pdf->SetTextColor(0, 0, 60);
|
|
||||||
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("Ref")." : ".$object->ref, '', 'R');
|
|
||||||
|
|
||||||
// Date prévue depart
|
// Date prévue depart
|
||||||
if (!empty($object->date_prevue_depart)) {
|
if (!empty($object->date_prevue_depart)) {
|
||||||
$posy += 4;
|
$posy += 4;
|
||||||
|
|||||||
@ -209,7 +209,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
|||||||
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = is_array($object->lines) ? count($object->lines) : 0;
|
||||||
|
|
||||||
$hidetop = 0;
|
$hidetop = 0;
|
||||||
if (!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)) {
|
if (!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)) {
|
||||||
@ -1551,7 +1551,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
|||||||
|
|
||||||
// Adapt dynamically the width of subprice, if text is too long.
|
// Adapt dynamically the width of subprice, if text is too long.
|
||||||
$tmpwidth = 0;
|
$tmpwidth = 0;
|
||||||
$nblines = count($object->lines);
|
$nblines = is_array($object->lines) ? count($object->lines) : 0;
|
||||||
for ($i = 0; $i < $nblines; $i++) {
|
for ($i = 0; $i < $nblines; $i++) {
|
||||||
$tmpwidth2 = dol_strlen(dol_string_nohtmltag(pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails)));
|
$tmpwidth2 = dol_strlen(dol_string_nohtmltag(pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails)));
|
||||||
$tmpwidth = max($tmpwidth, $tmpwidth2);
|
$tmpwidth = max($tmpwidth, $tmpwidth2);
|
||||||
|
|||||||
@ -203,7 +203,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
|
|||||||
<!-- Always editable -->
|
<!-- Always editable -->
|
||||||
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
||||||
<!-- Visibility -->
|
<!-- Visibility -->
|
||||||
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
|
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")); ?>
|
||||||
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
|
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
|
||||||
<!-- Visibility for PDF-->
|
<!-- Visibility for PDF-->
|
||||||
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
|
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
|
||||||
|
|||||||
@ -289,7 +289,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) {
|
|||||||
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
|
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
|
||||||
|
|
||||||
<!-- Visibility -->
|
<!-- Visibility -->
|
||||||
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
|
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")); ?>
|
||||||
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr>
|
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr>
|
||||||
|
|
||||||
<!-- Visibility for PDF-->
|
<!-- Visibility for PDF-->
|
||||||
|
|||||||
@ -73,7 +73,7 @@ print '<td>'.$langs->trans("ComputedFormula").'</td>';
|
|||||||
print '<td class="center">'.$langs->trans("Unique").'</td>';
|
print '<td class="center">'.$langs->trans("Unique").'</td>';
|
||||||
print '<td class="center">'.$langs->trans("Mandatory").'</td>';
|
print '<td class="center">'.$langs->trans("Mandatory").'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).'</td>';
|
||||||
|
|||||||
@ -336,12 +336,7 @@ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
|||||||
$std_soc = new Societe($db);
|
$std_soc = new Societe($db);
|
||||||
$action_search = 'query';
|
$action_search = 'query';
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
$parameters = array('advtarget'=>1);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($db);
|
|
||||||
$hookmanager->initHooks(array('thirdpartycard'));
|
|
||||||
|
|
||||||
$parameters = array();
|
|
||||||
if (!empty($advTarget->id)) {
|
if (!empty($advTarget->id)) {
|
||||||
$parameters = array('array_query' => $advTarget->filtervalue);
|
$parameters = array('array_query' => $advTarget->filtervalue);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,18 +197,22 @@ if ($action == 'confirmconvertimgwebp') {
|
|||||||
|
|
||||||
$section_dir=GETPOST('section_dir', 'alpha');
|
$section_dir=GETPOST('section_dir', 'alpha');
|
||||||
$section=GETPOST('section', 'alpha');
|
$section=GETPOST('section', 'alpha');
|
||||||
|
$file=GETPOST('filetoregenerate', 'alpha');
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir');
|
$formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir');
|
||||||
$formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section');
|
$formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section');
|
||||||
|
$formquestion['filetoregenerate']=array('type'=>'hidden', 'value'=>$file, 'name'=>'filetoregenerate');
|
||||||
if ($module == 'medias') {
|
if ($module == 'medias') {
|
||||||
$formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website');
|
$formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website');
|
||||||
}
|
}
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', $formquestion, "yes", 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], empty($file) ? $langs->trans('ConfirmImgWebpCreation') : $langs->trans('ConfirmChosenImgWebpCreation'), empty($file) ? $langs->trans('ConfirmGenerateImgWebp') : $langs->trans('ConfirmGenerateChosenImgWebp'), 'convertimgwebp', $formquestion, "yes", 1);
|
||||||
$action = 'file_manager';
|
$action = 'file_manager';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duplicate images into .webp
|
// Duplicate images into .webp
|
||||||
if ($action == 'convertimgwebp' && $permtoadd) {
|
if ($action == 'convertimgwebp' && $permtoadd) {
|
||||||
|
$file = GETPOST('filetoregenerate', 'alpha');
|
||||||
|
|
||||||
if ($module == 'medias') {
|
if ($module == 'medias') {
|
||||||
$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.dol_sanitizePathName(GETPOST('section_dir', 'alpha'));
|
$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.dol_sanitizePathName(GETPOST('section_dir', 'alpha'));
|
||||||
} else {
|
} else {
|
||||||
@ -217,9 +221,14 @@ if ($action == 'convertimgwebp' && $permtoadd) {
|
|||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
|
|
||||||
$regeximgext = getListOfPossibleImageExt();
|
if (!empty($file)) {
|
||||||
|
$filelist = array();
|
||||||
|
$filelist[]["fullname"] = dol_osencode($imagefolder.'/'.$file); // get $imagefolder.'/'.$file infos
|
||||||
|
} else {
|
||||||
|
$regeximgext = getListOfPossibleImageExt();
|
||||||
|
|
||||||
$filelist = dol_dir_list($imagefolder, "files", 0, $regeximgext);
|
$filelist = dol_dir_list($imagefolder, "files", 0, $regeximgext);
|
||||||
|
}
|
||||||
|
|
||||||
$nbconverted = 0;
|
$nbconverted = 0;
|
||||||
|
|
||||||
@ -245,7 +254,11 @@ if ($action == 'convertimgwebp' && $permtoadd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans('SucessConvertImgWebp'), null);
|
if (!empty($file)) {
|
||||||
|
setEventMessages($langs->trans('SucessConvertChosenImgWebp'), null);
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans('SucessConvertImgWebp'), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$action = 'file_manager';
|
$action = 'file_manager';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,8 +102,14 @@ $(document).ready(function () {
|
|||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="login_center center"<?php
|
||||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||||
|
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
|
||||||
|
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
|
||||||
|
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
|
||||||
|
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
|
||||||
|
}
|
||||||
|
?>>
|
||||||
<div class="login_vertical_align">
|
<div class="login_vertical_align">
|
||||||
|
|
||||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||||
|
|||||||
@ -134,7 +134,14 @@ $(document).ready(function () {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
<div class="login_center center"<?php
|
||||||
|
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||||
|
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
|
||||||
|
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
|
||||||
|
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
|
||||||
|
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
|
||||||
|
}
|
||||||
|
?>>
|
||||||
<div class="login_vertical_align">
|
<div class="login_vertical_align">
|
||||||
|
|
||||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||||
|
|||||||
@ -94,7 +94,6 @@ class InterfaceNotification extends DolibarrTriggers
|
|||||||
global $conf, $action;
|
global $conf, $action;
|
||||||
global $hookmanager;
|
global $hookmanager;
|
||||||
|
|
||||||
|
|
||||||
if (!is_object($hookmanager)) {
|
if (!is_object($hookmanager)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
$hookmanager = new HookManager($this->db);
|
$hookmanager = new HookManager($this->db);
|
||||||
|
|||||||
@ -51,7 +51,13 @@ class DolRequestDataCollector extends RequestDataCollector
|
|||||||
}
|
}
|
||||||
//var_dump($arrayofvalues);
|
//var_dump($arrayofvalues);
|
||||||
}
|
}
|
||||||
|
if ($var == '_SERVER') {
|
||||||
|
foreach ($arrayofvalues as $key => $val) {
|
||||||
|
if (preg_match('/^PHP_AUTH_PW/', $key)) {
|
||||||
|
$arrayofvalues[$key] = '*****hidden*****';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$data["$".$var] = $this->getDataFormatter()->formatVar($arrayofvalues);
|
$data["$".$var] = $this->getDataFormatter()->formatVar($arrayofvalues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,6 @@
|
|||||||
dol_include_once('/debugbar/class/autoloader.php');
|
dol_include_once('/debugbar/class/autoloader.php');
|
||||||
|
|
||||||
use \DebugBar\DebugBar;
|
use \DebugBar\DebugBar;
|
||||||
use \DebugBar\DataCollector\PhpInfoCollector;
|
|
||||||
|
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolMessagesCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolMessagesCollector.php');
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php');
|
||||||
@ -71,7 +70,7 @@ class DolibarrDebugBar extends DebugBar
|
|||||||
/**
|
/**
|
||||||
* Returns a JavascriptRenderer for this instance
|
* Returns a JavascriptRenderer for this instance
|
||||||
*
|
*
|
||||||
* @return DebugBar\JavascriptRenderer String content
|
* @return \DebugBar\JavascriptRenderer String content
|
||||||
*/
|
*/
|
||||||
public function getRenderer()
|
public function getRenderer()
|
||||||
{
|
{
|
||||||
@ -80,6 +79,7 @@ class DolibarrDebugBar extends DebugBar
|
|||||||
$renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php
|
$renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php
|
||||||
$renderer->disableVendor('highlightjs'); // We don't need this
|
$renderer->disableVendor('highlightjs'); // We don't need this
|
||||||
$renderer->setEnableJqueryNoConflict(false); // We don't need no conflict
|
$renderer->setEnableJqueryNoConflict(false); // We don't need no conflict
|
||||||
|
|
||||||
return $renderer;
|
return $renderer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -281,7 +281,6 @@ class Delivery extends CommonObject
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$idprod = $fk_product;
|
$idprod = $fk_product;
|
||||||
$j = 0;
|
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."deliverydet (fk_delivery, fk_origin_line,";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."deliverydet (fk_delivery, fk_origin_line,";
|
||||||
$sql .= " fk_product, description, qty)";
|
$sql .= " fk_product, description, qty)";
|
||||||
@ -304,9 +303,11 @@ class Delivery extends CommonObject
|
|||||||
$result = $line->insertExtraFields();
|
$result = $line->insertExtraFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error == 0) {
|
if (!$error) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -317,8 +318,6 @@ class Delivery extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
global $conf;
|
|
||||||
|
|
||||||
$sql = "SELECT l.rowid, l.fk_soc, l.date_creation, l.date_valid, l.ref, l.ref_customer, l.fk_user_author,";
|
$sql = "SELECT l.rowid, l.fk_soc, l.date_creation, l.date_valid, l.ref, l.ref_customer, l.fk_user_author,";
|
||||||
$sql .= " l.total_ht, l.fk_statut, l.fk_user_valid, l.note_private, l.note_public";
|
$sql .= " l.total_ht, l.fk_statut, l.fk_user_valid, l.note_private, l.note_public";
|
||||||
$sql .= ", l.date_delivery, l.fk_address, l.model_pdf";
|
$sql .= ", l.date_delivery, l.fk_address, l.model_pdf";
|
||||||
@ -396,7 +395,8 @@ class Delivery extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function valid($user, $notrigger = 0)
|
public function valid($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::valid begin");
|
dol_syslog(get_class($this)."::valid begin");
|
||||||
@ -521,8 +521,10 @@ class Delivery extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Non autorise";
|
$this->error = "NotAllowed";
|
||||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -532,9 +534,9 @@ class Delivery extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Creating the delivery slip from an existing shipment
|
* Creating the delivery slip from an existing shipment
|
||||||
*
|
*
|
||||||
* @param User $user User who creates
|
* @param User $user User who creates
|
||||||
* @param int $sending_id Id of the expedition that serves as a model
|
* @param int $sending_id Id of the expedition that serves as a model
|
||||||
* @return integer
|
* @return integer <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function create_from_sending($user, $sending_id)
|
public function create_from_sending($user, $sending_id)
|
||||||
{
|
{
|
||||||
@ -543,6 +545,9 @@ class Delivery extends CommonObject
|
|||||||
|
|
||||||
$expedition = new Expedition($this->db);
|
$expedition = new Expedition($this->db);
|
||||||
$result = $expedition->fetch($sending_id);
|
$result = $expedition->fetch($sending_id);
|
||||||
|
if ($result <= 0) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
@ -638,7 +643,7 @@ class Delivery extends CommonObject
|
|||||||
* Delete line
|
* Delete line
|
||||||
*
|
*
|
||||||
* @param int $lineid Line id
|
* @param int $lineid Line id
|
||||||
* @return integer|null
|
* @return integer <0 if KO, 0 if nothing done, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function deleteline($lineid)
|
public function deleteline($lineid)
|
||||||
{
|
{
|
||||||
@ -651,9 +656,11 @@ class Delivery extends CommonObject
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -737,7 +744,7 @@ class Delivery extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getTooltipContentArray($params)
|
public function getTooltipContentArray($params)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $langs;
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
|
||||||
@ -944,8 +951,6 @@ class Delivery extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $user, $langs, $conf;
|
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
// Load array of products prodids
|
// Load array of products prodids
|
||||||
@ -994,13 +999,11 @@ class Delivery extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Renvoie la quantite de produit restante a livrer pour une commande
|
* Renvoie la quantite de produit restante a livrer pour une commande
|
||||||
*
|
*
|
||||||
* @return array Product remaining to be delivered
|
* @return array|int Product remaining to be delivered or <0 if KO
|
||||||
* TODO use new function
|
* TODO use new function
|
||||||
*/
|
*/
|
||||||
public function getRemainingDelivered()
|
public function getRemainingDelivered()
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
// Get the linked object
|
// Get the linked object
|
||||||
$this->fetchObjectLinked('', '', $this->id, $this->element);
|
$this->fetchObjectLinked('', '', $this->id, $this->element);
|
||||||
//var_dump($this->linkedObjectsIds);
|
//var_dump($this->linkedObjectsIds);
|
||||||
@ -1098,7 +1101,7 @@ class Delivery extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
|||||||
@ -278,10 +278,6 @@ if (!file_exists($fullpath_original_file_osencoded)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hooks
|
// Hooks
|
||||||
if (!is_object($hookmanager)) {
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager = new HookManager($this->db);
|
|
||||||
}
|
|
||||||
$hookmanager->initHooks(array('document'));
|
$hookmanager->initHooks(array('document'));
|
||||||
$parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'original_file' => $original_file,
|
$parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'original_file' => $original_file,
|
||||||
'entity' => $entity, 'refname' => $refname, 'fullpath_original_file' => $fullpath_original_file,
|
'entity' => $entity, 'refname' => $refname, 'fullpath_original_file' => $fullpath_original_file,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user