Merge remote-tracking branch 'upstream/develop' into PSdevelop
This commit is contained in:
commit
a1f9005aa3
@ -5,6 +5,7 @@
|
||||
# We use dist: xenial to have php 5.6+ available
|
||||
os: linux
|
||||
dist: xenial
|
||||
#dist: bionic
|
||||
sudo: required
|
||||
|
||||
language: php
|
||||
|
||||
@ -39,7 +39,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
|
||||
JS libraries:
|
||||
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||
ChartJS 2.9.3 MIT License Yes JS library for graph
|
||||
jQuery 3.4.1 MIT License Yes JS library
|
||||
jQuery 3.5.1 MIT License Yes JS library
|
||||
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
||||
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
||||
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
|
||||
|
||||
65
ChangeLog
65
ChangeLog
@ -4,15 +4,78 @@ English Dolibarr ChangeLog
|
||||
|
||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||
For users:
|
||||
|
||||
NEW: Add module Credit transfer SEPA to manage payment of supplier using bank credit transfer SEPA files
|
||||
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable
|
||||
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Properties ->contactid has been renamed into ->contact_id
|
||||
* Rename property $paiementid in API api_supplier_invoices into $payment_mode_id
|
||||
|
||||
|
||||
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||
FIX: DebugBar hides content at page bottom
|
||||
FIX: allow more harmless html tags
|
||||
FIX: Bad back to link
|
||||
FIX: Bad param
|
||||
FIX: Can go on page even when module is disabled
|
||||
FIX: Change position of line in BOM
|
||||
FIX: Checkbox "drop table" was not checked when using php method to generate backup dump
|
||||
FIX: ClickToDial tab of users has disappeared
|
||||
FIX: CSS
|
||||
FIX: date in supplier price log tooltip.
|
||||
FIX: Debug module direct debit order. Solve conflict with credit transfer
|
||||
FIX: Debug setup of receipt printer module
|
||||
FIX: dolGetElementUrl and agenda page for external modules
|
||||
FIX: DO not erase variable $key and $label during output of extrafields
|
||||
FIX: duration fields size with firefox
|
||||
FIX: Edit extrafield of type long text loose carriage returns
|
||||
FIX: Fails to retraive accounting code of social contribution sometimes
|
||||
FIX: Filter too large for extrafields with type text or html
|
||||
FIX: If using a rounding step, localtax1+2 not included in total
|
||||
FIX: input field of extrafields must keep data if form submit fails.
|
||||
FIX: Label of opportunities in graph with special chars badly encoded
|
||||
FIX: locataxes lost on lines when cloning a vendor invoice
|
||||
FIX: Look and feel v12
|
||||
FIX: Missing PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE conf support in supplier order
|
||||
FIX: Navigation in object fails to find the next ref in some cases
|
||||
FIX: null required
|
||||
FIX: order by amount ht uses wrong column
|
||||
FIX: Order by amount in product propal stats must be done on d.total_ht and not p.total
|
||||
FIX: page for confirmation of payments is empty
|
||||
FIX: Param of fetch_name_optionals_label must be object->table_element
|
||||
FIX: Picto of HRM module
|
||||
FIX: product label and desc were never updated when modifying translation
|
||||
FIX: redirect on contact card from main search
|
||||
FIX: Reposition and nav
|
||||
FIX: search warehouse list
|
||||
FIX: Setup of clicktodial hang on smartphone
|
||||
FIX: Setup of currency limit and accuracy
|
||||
FIX: shipping creation: checks not done on weight and sizes
|
||||
FIX: Should not be able to edit qty on shipment when no stock available
|
||||
FIX: Size of image on the help popup of modules
|
||||
FIX: Sql error on stat by referring entries of a product
|
||||
FIX: Warning if no bank account defined
|
||||
FIX: We need to see unit line on PDF even though it's an option
|
||||
FIX: wrong element var for fetch_name_optionals_label function with expeditions
|
||||
FIX: wrong link to third invoice templates
|
||||
FIX: Disable svg as supported image by default (can contains javascript). Set MAIN_ALLOW_SVG_FILES_AS_IMAGES to 1 to have svg accepted
|
||||
FIX: #14076
|
||||
FIX: #14146
|
||||
FIX: #14209
|
||||
FIX: #14222
|
||||
FIX: #14236
|
||||
FIX: #14241 Mysql 8 compatibility
|
||||
FIX: #14253
|
||||
FIX: #14256
|
||||
FIX: #14259
|
||||
FIX: #14279
|
||||
FIX: #14291
|
||||
FIX: #14292
|
||||
FIX: #14336
|
||||
|
||||
***** ChangeLog for 12.0.1 compared to 12.0.0 *****
|
||||
FIX: reposition was broken if url end with #anchor
|
||||
|
||||
36
README.md
36
README.md
@ -3,13 +3,15 @@
|
||||

|
||||

|
||||
|
||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||
|
||||
It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers.
|
||||
It's an Open Source Software suite (written in PHP with optional JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers.
|
||||
|
||||
You can freely use, study, modify or distribute it according to its Free Software licence.
|
||||
You can freely use, study, modify or distribute it according to its licence.
|
||||
|
||||
You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN.
|
||||
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
||||
|
||||
Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||
|
||||

|
||||
|
||||
@ -35,11 +37,15 @@ Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||
|
||||
### Advanced setup
|
||||
|
||||
You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version.
|
||||
You can use a web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version.
|
||||
|
||||
On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
||||
|
||||
#### Generic install steps:
|
||||
|
||||
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Versions).
|
||||
|
||||
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you known git):
|
||||
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later):
|
||||
|
||||
`git clone https://github.com/dolibarr/dolibarr -b x.y` (where x.y is main version like 3.6, 9.0, ...)
|
||||
|
||||
@ -70,13 +76,13 @@ If you don't have time to install it yourself, you can try some commercial 'read
|
||||
|
||||
## UPGRADING
|
||||
|
||||
Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
|
||||
|
||||
- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr
|
||||
- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md).
|
||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||
- At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process.
|
||||
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
|
||||
|
||||
*Note: migration process can be safely done multiple times by calling the `/install/index.php` page*
|
||||
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
|
||||
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
|
||||
|
||||
## WHAT'S NEW
|
||||
|
||||
@ -139,7 +145,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||
|
||||
- APIs
|
||||
- An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture)
|
||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||
- Support a lot of country specific features:
|
||||
- Spanish Tax RE and ISPF
|
||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||
@ -149,7 +155,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
||||
- Compatible with European GDPR rules
|
||||
- ...
|
||||
- PDF or ODT generation for invoice, proposals, orders...
|
||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||
- …
|
||||
|
||||
### System Environment / Requirements
|
||||
@ -167,12 +173,12 @@ These are features that Dolibarr does **not** yet fully support:
|
||||
|
||||
- Tasks dependencies in projects
|
||||
- Payroll module
|
||||
- No native embedded Webmail
|
||||
- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
|
||||
- Dolibarr can't do coffee (yet)
|
||||
|
||||
## DOCUMENTATION
|
||||
|
||||
Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](https://wiki.dolibarr.org).
|
||||
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
||||
|
||||
## CONTRIBUTING
|
||||
|
||||
@ -182,7 +188,7 @@ This project exists thanks to all the people who contribute. [[Contribute](https
|
||||
|
||||
## CREDITS
|
||||
|
||||
Dolibarr is the work of many contributors over the years and uses some fine libraries.
|
||||
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.
|
||||
|
||||
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ Architecture: all
|
||||
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5 | libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php,
|
||||
php5-cli | php-cli,
|
||||
# Required PHP extensions
|
||||
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd,
|
||||
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd, php5-zip | php-zip,
|
||||
# Required PHP libraries
|
||||
php-pear, php-mail-mime,
|
||||
# php-tcpdf,
|
||||
|
||||
@ -8,6 +8,7 @@ ALL:
|
||||
Check "@CHANGE"
|
||||
|
||||
|
||||
|
||||
PrestaShopWebservice:
|
||||
---------------------
|
||||
Replace
|
||||
@ -27,6 +28,19 @@ With
|
||||
|
||||
|
||||
|
||||
DEBUGBAR:
|
||||
---------
|
||||
|
||||
Move
|
||||
this.options = {
|
||||
bodyMarginBottom: true,
|
||||
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
|
||||
};
|
||||
few line lower in the
|
||||
initialize: function() {
|
||||
|
||||
|
||||
|
||||
ESCPOS:
|
||||
-------
|
||||
Replace
|
||||
@ -167,6 +181,7 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||
TCPDI:
|
||||
------
|
||||
Add fpdf_tpl.php 1.2
|
||||
|
||||
Add tcpdi.php
|
||||
|
||||
Add tcpdi_parser.php and replace:
|
||||
@ -205,8 +220,6 @@ with
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
JCROP:
|
||||
------
|
||||
* Remove analytics tag into file index.html
|
||||
|
||||
@ -1326,7 +1326,7 @@ CREATE TABLE `llx_boxes_def` (
|
||||
|
||||
LOCK TABLES `llx_boxes_def` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_boxes_def` DISABLE KEYS */;
|
||||
INSERT INTO `llx_boxes_def` VALUES (188,'box_services_vendus.php',1,'2013-08-05 20:40:27',NULL),(323,'box_actions.php',2,'2015-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2015-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2015-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2015-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2015-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2015-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2015-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2015-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2015-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2015-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2015-03-13 20:33:09',NULL),(347,'box_clients.php',1,'2017-11-15 22:05:57',NULL),(348,'box_prospect.php',1,'2017-11-15 22:05:57',NULL),(349,'box_contacts.php',1,'2017-11-15 22:05:57',NULL),(350,'box_activity.php',1,'2017-11-15 22:05:57','(WarningUsingThisBoxSlowDown)'),(374,'box_services_contracts.php',1,'2017-11-15 22:38:37',NULL),(377,'box_project.php',1,'2017-11-15 22:38:44',NULL),(378,'box_task.php',1,'2017-11-15 22:38:44',NULL),(388,'box_contracts.php',1,'2017-11-15 22:39:52',NULL),(389,'box_services_expired.php',1,'2017-11-15 22:39:52',NULL),(390,'box_ficheinter.php',1,'2017-11-15 22:39:56',NULL),(392,'box_graph_propales_permonth.php',1,'2017-11-15 22:41:47',NULL),(393,'box_propales.php',1,'2017-11-15 22:41:47',NULL),(396,'box_graph_product_distribution.php',1,'2017-11-15 22:41:47',NULL),(403,'box_goodcustomers.php',1,'2018-07-30 11:13:20','(WarningUsingThisBoxSlowDown)'),(404,'box_external_rss.php',1,'2018-07-30 11:15:25','1 (Dolibarr.org News)'),(409,'box_produits.php',1,'2018-07-30 13:38:11',NULL),(410,'box_produits_alerte_stock.php',1,'2018-07-30 13:38:11',NULL),(411,'box_commandes.php',1,'2018-07-30 13:38:11',NULL),(412,'box_graph_orders_permonth.php',1,'2018-07-30 13:38:11',NULL),(413,'box_graph_invoices_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(414,'box_graph_orders_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(415,'box_fournisseurs.php',1,'2018-07-30 13:38:11',NULL),(416,'box_factures_fourn_imp.php',1,'2018-07-30 13:38:11',NULL),(417,'box_factures_fourn.php',1,'2018-07-30 13:38:11',NULL),(418,'box_supplier_orders.php',1,'2018-07-30 13:38:11',NULL),(419,'box_actions.php',1,'2018-07-30 15:42:32',NULL),(424,'box_factures_imp.php',1,'2017-02-07 18:56:12',NULL),(425,'box_factures.php',1,'2017-02-07 18:56:12',NULL),(426,'box_graph_invoices_permonth.php',1,'2017-02-07 18:56:12',NULL),(427,'box_comptes.php',1,'2017-02-07 18:56:12',NULL),(429,'box_lastlogin.php',1,'2017-08-27 13:29:14',NULL),(430,'box_bookmarks.php',1,'2018-01-19 11:27:34',NULL),(431,'box_members.php',1,'2018-01-19 11:27:56',NULL),(432,'box_birthdays.php',1,'2019-06-05 08:45:40',NULL),(433,'box_last_ticket',1,'2019-06-05 09:15:29',NULL),(434,'box_last_modified_ticket',1,'2019-06-05 09:15:29',NULL),(436,'box_accountancy_last_manual_entries.php',1,'2019-11-28 11:52:58',NULL),(437,'box_accountancy_suspense_account.php',1,'2019-11-28 11:52:58',NULL),(438,'box_supplier_orders_awaiting_reception.php',1,'2019-11-28 11:52:59',NULL),(439,'box_mos.php',1,'2019-11-29 08:57:42',NULL),(445,'box_shipments.php',1,'2020-01-13 14:38:20',NULL);
|
||||
INSERT INTO `llx_boxes_def` VALUES (323,'box_actions.php',2,'2015-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2015-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2015-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2015-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2015-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2015-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2015-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2015-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2015-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2015-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2015-03-13 20:33:09',NULL),(347,'box_clients.php',1,'2017-11-15 22:05:57',NULL),(348,'box_prospect.php',1,'2017-11-15 22:05:57',NULL),(349,'box_contacts.php',1,'2017-11-15 22:05:57',NULL),(350,'box_activity.php',1,'2017-11-15 22:05:57','(WarningUsingThisBoxSlowDown)'),(374,'box_services_contracts.php',1,'2017-11-15 22:38:37',NULL),(377,'box_project.php',1,'2017-11-15 22:38:44',NULL),(378,'box_task.php',1,'2017-11-15 22:38:44',NULL),(388,'box_contracts.php',1,'2017-11-15 22:39:52',NULL),(389,'box_services_expired.php',1,'2017-11-15 22:39:52',NULL),(390,'box_ficheinter.php',1,'2017-11-15 22:39:56',NULL),(392,'box_graph_propales_permonth.php',1,'2017-11-15 22:41:47',NULL),(393,'box_propales.php',1,'2017-11-15 22:41:47',NULL),(396,'box_graph_product_distribution.php',1,'2017-11-15 22:41:47',NULL),(403,'box_goodcustomers.php',1,'2018-07-30 11:13:20','(WarningUsingThisBoxSlowDown)'),(404,'box_external_rss.php',1,'2018-07-30 11:15:25','1 (Dolibarr.org News)'),(409,'box_produits.php',1,'2018-07-30 13:38:11',NULL),(410,'box_produits_alerte_stock.php',1,'2018-07-30 13:38:11',NULL),(411,'box_commandes.php',1,'2018-07-30 13:38:11',NULL),(412,'box_graph_orders_permonth.php',1,'2018-07-30 13:38:11',NULL),(413,'box_graph_invoices_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(414,'box_graph_orders_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(415,'box_fournisseurs.php',1,'2018-07-30 13:38:11',NULL),(416,'box_factures_fourn_imp.php',1,'2018-07-30 13:38:11',NULL),(417,'box_factures_fourn.php',1,'2018-07-30 13:38:11',NULL),(418,'box_supplier_orders.php',1,'2018-07-30 13:38:11',NULL),(419,'box_actions.php',1,'2018-07-30 15:42:32',NULL),(424,'box_factures_imp.php',1,'2017-02-07 18:56:12',NULL),(425,'box_factures.php',1,'2017-02-07 18:56:12',NULL),(426,'box_graph_invoices_permonth.php',1,'2017-02-07 18:56:12',NULL),(427,'box_comptes.php',1,'2017-02-07 18:56:12',NULL),(429,'box_lastlogin.php',1,'2017-08-27 13:29:14',NULL),(430,'box_bookmarks.php',1,'2018-01-19 11:27:34',NULL),(431,'box_members.php',1,'2018-01-19 11:27:56',NULL),(432,'box_birthdays.php',1,'2019-06-05 08:45:40',NULL),(433,'box_last_ticket',1,'2019-06-05 09:15:29',NULL),(434,'box_last_modified_ticket',1,'2019-06-05 09:15:29',NULL),(436,'box_accountancy_last_manual_entries.php',1,'2019-11-28 11:52:58',NULL),(437,'box_accountancy_suspense_account.php',1,'2019-11-28 11:52:58',NULL),(438,'box_supplier_orders_awaiting_reception.php',1,'2019-11-28 11:52:59',NULL),(439,'box_mos.php',1,'2019-11-29 08:57:42',NULL),(445,'box_shipments.php',1,'2020-01-13 14:38:20',NULL);
|
||||
/*!40000 ALTER TABLE `llx_boxes_def` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
172
dev/resources/sepa/sample-credit-transfer.xml
Normal file
172
dev/resources/sepa/sample-credit-transfer.xml
Normal file
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
|
||||
<CstmrCdtTrfInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>message-id-001</MsgId>
|
||||
<CreDtTm>2010-09-28T14:07:00</CreDtTm>
|
||||
<NbOfTxs>1</NbOfTxs>
|
||||
<CtrlSum>10.1</CtrlSum>
|
||||
<InitgPty>
|
||||
<Nm>Bedrijfsnaam</Nm>
|
||||
<Id>
|
||||
<OrgId>
|
||||
<Othr>
|
||||
<Id>123456789123456</Id>
|
||||
</Othr>
|
||||
</OrgId>
|
||||
</Id>
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
<PmtInf>
|
||||
<PmtInfId>minimaal gevuld</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<NbOfTxs>1</NbOfTxs>
|
||||
<CtrlSum>10.1</CtrlSum>
|
||||
<ReqdExctnDt>2009-11-01</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>Naam</Nm>
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
<Id>
|
||||
<IBAN>NL44RABO0123456789</IBAN>
|
||||
</Id>
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>RABONL2U</BIC>
|
||||
</FinInstnId>
|
||||
</DbtrAgt>
|
||||
<CdtTrfTxInf>
|
||||
<PmtId>
|
||||
<EndToEndId>non ref</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">10.1</InstdAmt>
|
||||
</Amt>
|
||||
<ChrgBr>SLEV</ChrgBr>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>ABNANL2A</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<Nm>Naam creditor</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>NL90ABNA0111111111</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<RmtInf>
|
||||
<Ustrd>vrije tekst</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
</PmtInf>
|
||||
<PmtInf>
|
||||
<PmtInfId>maximaal gevuld</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<BtchBookg>true</BtchBookg>
|
||||
<NbOfTxs>1</NbOfTxs>
|
||||
<CtrlSum>20.2</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<InstrPrty>NORM</InstrPrty>
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
<LclInstrm>
|
||||
<Cd>IDEAL</Cd>
|
||||
</LclInstrm>
|
||||
<CtgyPurp>
|
||||
<Cd>SECU</Cd>
|
||||
</CtgyPurp>
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>2009-11-01</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>Naam</Nm>
|
||||
<PstlAdr>
|
||||
<Ctry>NL</Ctry>
|
||||
<AdrLine>Debtor straat 1</AdrLine>
|
||||
<AdrLine>9999 XX Plaats debtor</AdrLine>
|
||||
</PstlAdr>
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
<Id>
|
||||
<IBAN>NL44RABO0123456789</IBAN>
|
||||
</Id>
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>RABONL2U</BIC>
|
||||
</FinInstnId>
|
||||
</DbtrAgt>
|
||||
<UltmtDbtr>
|
||||
<Id>
|
||||
<OrgId>
|
||||
<Othr>
|
||||
<Id>12345678</Id>
|
||||
<SchmeNm>
|
||||
<Prtry>klantnummer</Prtry>
|
||||
</SchmeNm>
|
||||
<Issr>klantnummer uitgifte instantie</Issr>
|
||||
</Othr>
|
||||
</OrgId>
|
||||
</Id>
|
||||
</UltmtDbtr>
|
||||
<ChrgBr>SLEV</ChrgBr>
|
||||
<CdtTrfTxInf>
|
||||
<PmtId>
|
||||
<InstrId>debtor-to-debtor-bank-01</InstrId>
|
||||
<EndToEndId>End-to-end-id-debtor-to-creditor-01</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">20.2</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>ABNANL2A</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<Nm>Naam creditor</Nm>
|
||||
<PstlAdr>
|
||||
<Ctry>NL</Ctry>
|
||||
<AdrLine>Straat creditor 1</AdrLine>
|
||||
<AdrLine>9999 XX Plaats creditor</AdrLine>
|
||||
</PstlAdr>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>NL90ABNA0111111111</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<UltmtCdtr>
|
||||
<Id>
|
||||
<PrvtId>
|
||||
<DtAndPlcOfBirth>
|
||||
<BirthDt>1969-07-03</BirthDt>
|
||||
<CityOfBirth>PLAATS</CityOfBirth>
|
||||
<CtryOfBirth>NL</CtryOfBirth>
|
||||
</DtAndPlcOfBirth>
|
||||
</PrvtId>
|
||||
</Id>
|
||||
</UltmtCdtr>
|
||||
<Purp>
|
||||
<Cd>CHAR</Cd>
|
||||
</Purp>
|
||||
<RmtInf>
|
||||
<Strd>
|
||||
<CdtrRefInf>
|
||||
<Tp>
|
||||
<CdOrPrtry>
|
||||
<Cd>SCOR</Cd>
|
||||
</CdOrPrtry>
|
||||
<Issr>CUR</Issr>
|
||||
</Tp>
|
||||
<Ref>1234567</Ref>
|
||||
</CdtrRefInf>
|
||||
</Strd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
</PmtInf>
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
@ -1,2 +1,8 @@
|
||||
Spec for credit transfer:
|
||||
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
|
||||
|
||||
To validate a SEPA file:
|
||||
xmllint --schema pain.001.001.03.xsd T200801.xml --noout
|
||||
|
||||
To test a SEPA file:
|
||||
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa
|
||||
|
||||
@ -79,6 +79,7 @@ $object = new Fiscalyear($db);
|
||||
$max = 100;
|
||||
|
||||
$form = new Form($db);
|
||||
$fiscalyearstatic = new Fiscalyear($db);
|
||||
|
||||
$title = $langs->trans('AccountingPeriods');
|
||||
$helpurl = "";
|
||||
@ -132,13 +133,15 @@ if ($result)
|
||||
print '</tr>';
|
||||
|
||||
if ($num) {
|
||||
$fiscalyearstatic = new Fiscalyear($db);
|
||||
|
||||
while ($i < $num && $i < $max) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$fiscalyearstatic->id = $obj->rowid;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"), "technic").' '.$obj->rowid.'</a></td>';
|
||||
print '<td>';
|
||||
print $fiscalyearstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td class="left">'.$obj->label.'</td>';
|
||||
print '<td class="left">'.dol_print_date($db->jdate($obj->date_start), 'day').'</td>';
|
||||
print '<td class="left">'.dol_print_date($db->jdate($obj->date_end), 'day').'</td>';
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
|
||||
@ -51,7 +52,9 @@ $list = array(
|
||||
// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
||||
);
|
||||
|
||||
|
||||
$list_binding = array(
|
||||
'ACCOUNTING_DATE_START_BINDING',
|
||||
);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -75,6 +78,22 @@ if ($action == 'update') {
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
|
||||
foreach ($list_binding as $constname)
|
||||
{
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
|
||||
$constvalue = dol_mktime(12, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
|
||||
}
|
||||
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -158,6 +177,7 @@ if ($action == 'setenablesubsidiarylist') {
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('ConfigAccountingExpert');
|
||||
llxHeader('', $title);
|
||||
@ -200,41 +220,15 @@ print "</table>\n";
|
||||
print '<br>';
|
||||
*/
|
||||
|
||||
// Others params
|
||||
|
||||
// Params
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans('OtherOptions').'</td>';
|
||||
print '<td colspan="2">'.$langs->trans('Options').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (!empty($user->admin))
|
||||
{
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
/* Set this option as a hidden option but keep it for some needs.
|
||||
print '<tr>';
|
||||
@ -251,7 +245,7 @@ if (!empty($user->admin))
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '<tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
|
||||
if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisabledirectinput&value=0">';
|
||||
@ -289,22 +283,81 @@ if (!empty($user->admin))
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Param a user $user->rights->accounting->chartofaccount can access
|
||||
foreach ($list as $key)
|
||||
{
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td class="right">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
// Binding params
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (!empty($user->admin))
|
||||
{
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsorttodo&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setlistsortdone&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Param a user $user->rights->accounting->chartofaccount can access
|
||||
foreach ($list as $key)
|
||||
foreach ($list_binding as $key)
|
||||
{
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td class="right">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
if ($key == 'ACCOUNTING_DATE_START_BINDING') {
|
||||
print $form->selectDate(($conf->global->$key ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -315,10 +368,6 @@ print '</table>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
|
||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -78,6 +79,7 @@ if ($sortfield == "") $sortfield = "t.doc_date,t.rowid";
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new BookKeeping($db);
|
||||
$formfile = new FormFile($db);
|
||||
$hookmanager->initHooks(array('bookkeepingbyaccountlist'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
@ -543,7 +545,7 @@ while ($i < min($num, $limit))
|
||||
|
||||
// Show the break account
|
||||
print "<tr>";
|
||||
print '<td colspan="'.$totalarray['nbfield'].'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 9).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte);
|
||||
else print '<span class="error">'.$langs->trans("Unknown").'</span>';
|
||||
print '</td>';
|
||||
|
||||
@ -256,6 +256,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql .= " AND fd.product_type <= 2";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
@ -330,6 +334,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql .= " AND fd.product_type <= 2";
|
||||
@ -405,6 +413,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql .= " AND fd.product_type <= 2";
|
||||
@ -458,6 +470,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql .= " AND fd.product_type <= 2";
|
||||
|
||||
@ -227,6 +227,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$chartaccountcode."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Add search filter like
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
@ -384,7 +388,7 @@ if ($result) {
|
||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
|
||||
@ -407,7 +411,7 @@ if ($result) {
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
|
||||
$checkpicto = '';
|
||||
@ -553,14 +557,14 @@ if ($result) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
|
||||
|
||||
// Ref Product
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($product_static->id > 0) {
|
||||
print $product_static->getNomUrl(1);
|
||||
}
|
||||
if ($objp->product_label) print '<br><span class="opacitymedium">'.$objp->product_label.'</span>';
|
||||
if ($objp->product_label) print '<br><span class="opacitymedium small">'.$objp->product_label.'</span>';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
|
||||
@ -174,6 +174,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_e
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||
$sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
@ -243,6 +247,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_e
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||
$sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
@ -312,6 +320,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
|
||||
|
||||
@ -198,6 +198,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as f ON f.id = erd.fk_c_type_f
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = er.fk_user_author";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '".$chartaccountcode."' AND aa.entity = ".$conf->entity;
|
||||
$sql .= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Add search filter like
|
||||
if (strlen(trim($search_login))) {
|
||||
$sql .= natural_search("u.login", $search_login);
|
||||
|
||||
@ -124,6 +124,10 @@ $sql .= " WHERE ba.fk_accountancy_journal=".$id_journal;
|
||||
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
{
|
||||
|
||||
@ -101,6 +101,10 @@ $sql .= " AND erd.fk_code_ventilation > 0";
|
||||
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($date_start)."' AND er.date_debut <= '".$db->idate($date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
{
|
||||
|
||||
@ -111,6 +111,10 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
}
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
{
|
||||
|
||||
@ -115,6 +115,10 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Non common s
|
||||
$sql .= " AND fd.product_type IN (0,1)";
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already')
|
||||
{
|
||||
|
||||
@ -245,6 +245,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON ff.rowid = ffd.fk_
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation";
|
||||
$sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
@ -314,6 +318,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON ff.rowid = ffd.fk_
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation";
|
||||
$sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
@ -383,6 +391,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||
$sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
|
||||
@ -231,6 +231,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$chartaccountcode."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// Add search filter like
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
@ -371,7 +375,7 @@ if ($result) {
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="'.dol_escape_htmltag($search_invoice).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
print '<td class="liste_titre center nowraponall minwidth100imp">';
|
||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
@ -383,7 +387,7 @@ if ($result) {
|
||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
|
||||
@ -398,7 +402,7 @@ if ($result) {
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
@ -407,7 +411,7 @@ if ($result) {
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
|
||||
$checkpicto = '';
|
||||
@ -459,6 +463,7 @@ if ($result) {
|
||||
$facturefourn_static->ref = $objp->ref;
|
||||
$facturefourn_static->id = $objp->facid;
|
||||
$facturefourn_static->type = $objp->type;
|
||||
$facturefourn_static->label = $objp->invoice_label;
|
||||
|
||||
$code_buy_p_notset = '';
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
@ -531,21 +536,22 @@ if ($result) {
|
||||
// Ref Invoice
|
||||
print '<td class="nowraponall">'.$facturefourn_static->getNomUrl(1).'</td>';
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
/*print '<td class="tdoverflowonsmartphone">';
|
||||
print $objp->invoice_label;
|
||||
print '</td>';
|
||||
*/
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
|
||||
|
||||
// Ref Product
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($product_static->id > 0)
|
||||
print $product_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br><span class="opacitymedium">'.$objp->product_label.'</span>';
|
||||
if ($objp->product_label) print '<br><span class="opacitymedium small">'.$objp->product_label.'</span>';
|
||||
print '</td>';
|
||||
|
||||
// Description
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
|
||||
@ -88,6 +88,7 @@ if ($action == 'update' || $action == 'add') {
|
||||
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
|
||||
|
||||
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
|
||||
$constvalue = preg_replace('/:member$/', '', $constvalue);
|
||||
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
||||
|
||||
@ -100,23 +101,6 @@ if ($action == 'update' || $action == 'add') {
|
||||
}
|
||||
}
|
||||
|
||||
// Action to enable a submodule of the adherent module
|
||||
if ($action == 'set') {
|
||||
$result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity);
|
||||
if ($result < 0) {
|
||||
print $db->error();
|
||||
}
|
||||
}
|
||||
|
||||
// Action to disable a submodule of the adherent module
|
||||
if ($action == 'unset') {
|
||||
$result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity);
|
||||
if ($result < 0) {
|
||||
print $db->error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/adherents/card.php
|
||||
* \ingroup member
|
||||
* \brief Page of member
|
||||
* \brief Page of a member
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -850,9 +850,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MemberType").'</td><td>';
|
||||
$listetype = $adht->liste_array();
|
||||
$listetype = $adht->liste_array(1);
|
||||
if (count($listetype)) {
|
||||
print $form->selectarray("typeid", $listetype, GETPOST('typeid', 'int') ?GETPOST('typeid', 'int') : $typeid, count($listetype) > 1 ? 1 : 0);
|
||||
print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<font class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</font>';
|
||||
}
|
||||
@ -862,7 +862,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MemberNature")."</td><td>\n";
|
||||
print $form->selectarray("morphy", $morphys, GETPOST('morphy', 'alpha') ?GETPOST('morphy', 'alpha') : $object->morphy, 1);
|
||||
print $form->selectarray("morphy", $morphys, (GETPOST('morphy', 'alpha') ?GETPOST('morphy', 'alpha') : $object->morphy), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print "</td>\n";
|
||||
|
||||
// Company
|
||||
@ -870,7 +870,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
print $formcompany->select_civility(GETPOST('civility_id', 'int') ?GETPOST('civility_id', 'int') : $object->civility_id, 'civility_id').'</td>';
|
||||
print $formcompany->select_civility(GETPOST('civility_id', 'int') ? GETPOST('civility_id', 'int') : $object->civility_id, 'civility_id', 'maxwidth150', 1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
@ -885,7 +885,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
|
||||
print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1);
|
||||
print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
@ -1074,13 +1074,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ? GETPOST("morphy", 'alpha') : $object->morphy));
|
||||
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ? GETPOST("morphy", 'alpha') : $object->morphy), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print "</td></tr>";
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
if ($user->rights->adherent->creer) {
|
||||
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid));
|
||||
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print $adht->getNomUrl(1);
|
||||
print '<input type="hidden" name="typeid" value="'.$object->typeid.'">';
|
||||
@ -1092,7 +1092,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
print $formcompany->select_civility(GETPOSTISSET("civility_id") ? GETPOST("civility_id", 'alpha') : $object->civility_id)."\n";
|
||||
print $formcompany->select_civility(GETPOSTISSET("civility_id") ? GETPOST("civility_id", 'alpha') : $object->civility_id, 'civility_id', 'maxwidth150', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1108,7 +1108,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
|
||||
print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ? GETPOST('gender', 'alphanohtml') : $object->gender, 1);
|
||||
print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ? GETPOST('gender', 'alphanohtml') : $object->gender, 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Photo
|
||||
@ -1164,7 +1164,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone_perso" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile').' <input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
|
||||
@ -112,7 +112,7 @@ class AdherentType extends CommonObject
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->statut = 1;
|
||||
$this->status = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -280,7 +280,7 @@ class AdherentType extends CommonObject
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->statut = (int) $this->statut;
|
||||
$this->status = (int) $this->status;
|
||||
$this->label = trim($this->label);
|
||||
|
||||
$this->db->begin();
|
||||
@ -347,7 +347,7 @@ class AdherentType extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
|
||||
$sql .= "SET ";
|
||||
$sql .= "statut = ".$this->statut.",";
|
||||
$sql .= "statut = ".$this->status.",";
|
||||
$sql .= "libelle = '".$this->db->escape($this->label)."',";
|
||||
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
|
||||
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
@ -456,7 +456,6 @@ class AdherentType extends CommonObject
|
||||
$this->ref = $obj->rowid;
|
||||
$this->label = $obj->label;
|
||||
$this->morphy = $obj->morphy;
|
||||
$this->statut = $obj->status; // deprecated
|
||||
$this->status = $obj->status;
|
||||
$this->duration = $obj->duration;
|
||||
$this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1);
|
||||
@ -483,9 +482,10 @@ class AdherentType extends CommonObject
|
||||
/**
|
||||
* Return list of members' type
|
||||
*
|
||||
* @return array List of types of members
|
||||
* @param int $status Filter on status of type
|
||||
* @return array List of types of members
|
||||
*/
|
||||
public function liste_array()
|
||||
public function liste_array($status = -1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
@ -495,6 +495,7 @@ class AdherentType extends CommonObject
|
||||
$sql = "SELECT rowid, libelle as label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql .= " WHERE entity IN (".getEntity('member_type').")";
|
||||
if ($status >= 0) $sql .= " AND statut = ".((int) $status);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -719,7 +720,7 @@ class AdherentType extends CommonObject
|
||||
$this->subscription = 1;
|
||||
$this->vote = 0;
|
||||
|
||||
$this->statut = 1;
|
||||
$this->status = 1;
|
||||
|
||||
// Members of this member type is just me
|
||||
$this->members = array(
|
||||
|
||||
@ -121,7 +121,7 @@ $arrayfields = array(
|
||||
'd.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0),
|
||||
'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
||||
'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
|
||||
'd.morphy'=>array('label'=>$langs->trans("MorPhy"), 'checked'=>1),
|
||||
'd.morphy'=>array('label'=>$langs->trans("MemberNature"), 'checked'=>1),
|
||||
't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
|
||||
'd.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1),
|
||||
'd.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0),
|
||||
@ -707,9 +707,20 @@ while ($i < min($num, $limit)) {
|
||||
print "<td>".$obj->login."</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Moral/Physique
|
||||
// Nature (Moral/Physical)
|
||||
if (!empty($arrayfields['d.morphy']['checked'])) {
|
||||
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
|
||||
print '<td class="center">';
|
||||
$s = '';
|
||||
if ($obj->morphy == 'phy')
|
||||
{
|
||||
$s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>';
|
||||
}
|
||||
if ($obj->morphy == 'mor')
|
||||
{
|
||||
$s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>';
|
||||
}
|
||||
print $s;
|
||||
print "</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Type label
|
||||
|
||||
@ -890,7 +890,10 @@ if ($rowid > 0) {
|
||||
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>';
|
||||
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
|
||||
$prodtmp = new Product($db);
|
||||
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
$result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodtmp->error, 'errors');
|
||||
}
|
||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||
}
|
||||
print '<br>';
|
||||
@ -912,7 +915,10 @@ if ($rowid > 0) {
|
||||
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>';
|
||||
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
|
||||
$prodtmp = new Product($db);
|
||||
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
$result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodtmp->error, 'errors');
|
||||
}
|
||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
@ -61,7 +61,7 @@ if (!$sortfield) { $sortfield = "d.lastname"; }
|
||||
|
||||
$label = GETPOST("label", "alpha");
|
||||
$morphy = GETPOST("morphy", "alpha");
|
||||
$statut = GETPOST("statut", "int");
|
||||
$status = GETPOST("status", "int");
|
||||
$subscription = GETPOST("subscription", "int");
|
||||
$duration_value = GETPOST('duration_value', 'int');
|
||||
$duration_unit = GETPOST('duration_unit', 'alpha');
|
||||
@ -108,7 +108,7 @@ if ($cancel) {
|
||||
if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||
$object->label = trim($label);
|
||||
$object->morphy = trim($morphy);
|
||||
$object->statut = (int) $statut;
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
@ -157,7 +157,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
|
||||
|
||||
$object->label = trim($label);
|
||||
$object->morphy = trim($morphy);
|
||||
$object->statut = (int) $statut;
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
@ -205,7 +205,6 @@ $formproduct = new FormProduct($db);
|
||||
|
||||
llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||
|
||||
|
||||
// List of members type
|
||||
if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
//dol_fiche_head('');
|
||||
@ -317,7 +316,7 @@ if ($action == 'create') {
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1);
|
||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Morphy
|
||||
@ -448,7 +447,7 @@ if ($rowid > 0) {
|
||||
}
|
||||
|
||||
// Add
|
||||
if ($user->rights->adherent->configurer && !empty($object->statut)) {
|
||||
if ($user->rights->adherent->configurer && !empty($object->status)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
@ -470,7 +469,7 @@ if ($rowid > 0) {
|
||||
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,";
|
||||
$sql .= " d.datefin,";
|
||||
$sql .= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||
$sql .= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
|
||||
$sql .= " t.libelle as type, t.subscription";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql .= " WHERE d.fk_adherent_type = t.rowid ";
|
||||
@ -643,13 +642,13 @@ if ($rowid > 0) {
|
||||
|
||||
// Statut
|
||||
print '<td class="nowrap">';
|
||||
print $adh->LibStatut($objp->statut, $objp->subscription, $datefin, 2);
|
||||
print $adh->LibStatut($objp->status, $objp->subscription, $datefin, 2);
|
||||
print "</td>";
|
||||
|
||||
// Date end subscription
|
||||
if ($datefin) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($datefin < dol_now() && $objp->statut > 0) {
|
||||
if ($datefin < dol_now() && $objp->status > 0) {
|
||||
print dol_print_date($datefin, 'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
||||
} else {
|
||||
print dol_print_date($datefin, 'day');
|
||||
@ -659,7 +658,7 @@ if ($rowid > 0) {
|
||||
print '<td class="nowrap left">';
|
||||
if ($objp->subscription == 'yes') {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($objp->statut > 0) print " ".img_warning();
|
||||
if ($objp->status > 0) print " ".img_warning();
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
@ -720,7 +719,7 @@ if ($rowid > 0) {
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->statut);
|
||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status);
|
||||
print '</td></tr>';
|
||||
|
||||
// Morphy
|
||||
@ -741,7 +740,7 @@ if ($rowid > 0) {
|
||||
|
||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
|
||||
print '<input name="duration_value" size="5" value="'.$object->duration_value.'"> ';
|
||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1);
|
||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", ($object->duration_unit === '' ? 'y' : $object->duration_unit), 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
|
||||
@ -350,13 +350,13 @@ foreach ($dirmodels as $reldir) {
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ foreach ($dirmodels as $reldir) {
|
||||
if ($conf->global->BANKADDON_PDF == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -370,13 +370,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_valu
|
||||
print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
$head = bomAdminPrepareHead(null);
|
||||
$head = bomAdminPrepareHead();
|
||||
|
||||
dol_fiche_head($head, 'bom_extrafields', $langs->trans("ExtraFields"), -1, 'account');
|
||||
|
||||
|
||||
@ -95,8 +95,10 @@ if ($action == 'add') {
|
||||
{
|
||||
if (!$error && $fk_user != '')
|
||||
{
|
||||
$arrayofexistingboxid = array();
|
||||
$nbboxonleft = $nbboxonright = 0;
|
||||
$sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".$pos." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
||||
$sql = "SELECT box_id, box_order FROM ".MAIN_DB_PREFIX."boxes";
|
||||
$sql .= " WHERE position = ".$pos." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -106,21 +108,26 @@ if ($action == 'add') {
|
||||
$boxorder = $obj->box_order;
|
||||
if (preg_match('/A/', $boxorder)) $nbboxonleft++;
|
||||
if (preg_match('/B/', $boxorder)) $nbboxonright++;
|
||||
$arrayofexistingboxid[$obj->box_id] = 1;
|
||||
}
|
||||
} else dol_print_error($db);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql .= "box_id, position, box_order, fk_user, entity";
|
||||
$sql .= ") values (";
|
||||
$sql .= $boxid['value'].", ".$pos.", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
|
||||
$sql .= ")";
|
||||
if (empty($arrayofexistingboxid[$boxid['value']])) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql .= "box_id, position, box_order, fk_user, entity";
|
||||
$sql .= ") values (";
|
||||
$sql .= $boxid['value'].", ".$pos.", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
|
||||
$sql .= ")";
|
||||
|
||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
$error++;
|
||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
dol_syslog("boxes.php activate box - already exists in database", LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -314,7 +321,7 @@ $boxactivated = InfoBox::listBoxes($db, 'activated', -1, null);
|
||||
|
||||
print "<br>\n";
|
||||
print "\n\n".'<!-- Boxes Available -->'."\n";
|
||||
print load_fiche_titre($langs->trans("BoxesAvailable"));
|
||||
print load_fiche_titre($langs->trans("BoxesAvailable"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
|
||||
@ -341,7 +348,7 @@ foreach ($boxtoadd as $box)
|
||||
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.img_object("", $logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
if (!empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')';
|
||||
print '</td>'."\n";
|
||||
print '<td>';
|
||||
@ -355,7 +362,7 @@ foreach ($boxtoadd as $box)
|
||||
|
||||
// For each possible position, an activation link is displayed if the box is not already active for that position
|
||||
print '<td class="center">';
|
||||
print $form->selectarray("boxid[".$box->box_id."][pos]", $pos_name, 0, 1, 0, 0, '', 1)."\n";
|
||||
print $form->selectarray("boxid[".$box->box_id."][pos]", $pos_name, -1, 1, 0, 0, '', 1)."\n";
|
||||
print '<input type="hidden" name="boxid['.$box->box_id.'][value]" value="'.$box->box_id.'">'."\n";
|
||||
print '</td>';
|
||||
|
||||
@ -377,7 +384,7 @@ print "\n".'<!-- End Boxes Available -->'."\n";
|
||||
|
||||
//var_dump($boxactivated);
|
||||
print "<br>\n\n";
|
||||
print load_fiche_titre($langs->trans("BoxesActivated"));
|
||||
print load_fiche_titre($langs->trans("BoxesActivated"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="tagtable liste">'."\n";
|
||||
@ -403,7 +410,7 @@ foreach ($boxactivated as $key => $box)
|
||||
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.img_object("", $logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
if (!empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
@ -436,7 +443,7 @@ print '<br>';
|
||||
// Other parameters
|
||||
|
||||
print "\n\n".'<!-- Other Const -->'."\n";
|
||||
print load_fiche_titre($langs->trans("Other"));
|
||||
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="addconst">';
|
||||
|
||||
@ -60,6 +60,8 @@ if ($action == 'setvalue' && $user->admin)
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$user->fetch_clicktodial();
|
||||
|
||||
$wikihelp = 'EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
|
||||
@ -75,6 +77,7 @@ print '<form method="post" action="clicktodial.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setvalue">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -107,6 +110,7 @@ print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
|
||||
@ -435,13 +435,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -109,6 +109,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|
||||
foreach ($arrayofimages as $varforimage)
|
||||
{
|
||||
if ($_FILES[$varforimage]["name"] && ! preg_match('/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage]["name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($_FILES[$varforimage]["tmp_name"])
|
||||
{
|
||||
$reg = array();
|
||||
@ -473,10 +479,17 @@ if (!empty($mysoc->logo_mini)) {
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
print '</div>';
|
||||
} elseif (!empty($mysoc->logo)) {
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 60px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo).'">';
|
||||
print '</div>';
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
@ -493,10 +506,18 @@ if (!empty($mysoc->logo_squarred_mini)) {
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
print '</div>';
|
||||
} elseif (!empty($mysoc->logo_squarred)) {
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred)) {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 60px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo_squarred).'">';
|
||||
print '</div>';
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
}
|
||||
else {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -92,7 +92,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup')
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment');
|
||||
|
||||
// Miscellaneous parameters
|
||||
|
||||
|
||||
@ -365,13 +365,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -90,7 +91,11 @@ $hookmanager->initHooks(array('admin'));
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 27, 38, 0, 5, 11, 0, 32, 33, 34, 0, 6, 0, 29, 0, 7, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 0, 14, 0, 22, 20, 18, 21, 0, 15, 30, 0, 37, 0, 25, 0);
|
||||
if (! empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
|
||||
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 32, 33, 34, 0, 6, 0, 29, 0, 7, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 0, 14, 0, 22, 20, 18, 21, 0, 15, 30, 0, 37, 0, 25, 0);
|
||||
} else {
|
||||
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 27, 38, 0, 5, 11, 0, 32, 33, 34, 0, 6, 0, 29, 0, 7, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 0, 14, 0, 22, 20, 18, 21, 0, 15, 30, 0, 37, 0, 25, 0);
|
||||
}
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname = array();
|
||||
@ -133,6 +138,8 @@ $tabname[35] = MAIN_DB_PREFIX."c_exp_tax_cat";
|
||||
$tabname[36] = MAIN_DB_PREFIX."c_exp_tax_range";
|
||||
$tabname[37] = MAIN_DB_PREFIX."c_units";
|
||||
$tabname[38] = MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$tabname[39] = MAIN_DB_PREFIX."c_prospectcontactlevel";
|
||||
$tabname[40] = MAIN_DB_PREFIX."c_stcommcontact";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib = array();
|
||||
@ -174,6 +181,8 @@ $tablib[35] = "DictionaryExpenseTaxCat";
|
||||
$tablib[36] = "DictionaryExpenseTaxRange";
|
||||
$tablib[37] = "DictionaryMeasuringUnits";
|
||||
$tablib[38] = "DictionarySocialNetworks";
|
||||
$tablib[39] = "DictionaryProspectContactLevel";
|
||||
$tablib[40] = "DictionaryProspectContactStatus";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql = array();
|
||||
@ -203,7 +212,7 @@ $tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as
|
||||
$tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
||||
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
||||
@ -215,6 +224,8 @@ $tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX
|
||||
$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
|
||||
$tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
|
||||
$tabsql[38] = "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel";
|
||||
$tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort = array();
|
||||
@ -256,6 +267,8 @@ $tabsqlsort[35] = "c.label ASC";
|
||||
$tabsqlsort[36] = "r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
|
||||
$tabsqlsort[37] = "r.unit_type ASC, r.scale ASC, r.code ASC";
|
||||
$tabsqlsort[38] = "rowid, code ASC";
|
||||
$tabsqlsort[39] = "sortorder ASC";
|
||||
$tabsqlsort[40] = "code ASC";
|
||||
|
||||
// Field names in select result for dictionary display
|
||||
$tabfield = array();
|
||||
@ -285,7 +298,7 @@ $tabfield[23] = "country_id,country,taux,revenuestamp_type,accountancy_code_sell
|
||||
$tabfield[24] = "code,label";
|
||||
$tabfield[25] = "code,label";
|
||||
//$tabfield[26]= "code,label,short_label";
|
||||
$tabfield[27] = "code,libelle";
|
||||
$tabfield[27] = "code,libelle,picto";
|
||||
$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country";
|
||||
$tabfield[29] = "code,label,percent,position";
|
||||
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
@ -297,6 +310,8 @@ $tabfield[35] = "label";
|
||||
$tabfield[36] = "range_ik,fk_c_exp_tax_cat";
|
||||
$tabfield[37] = "code,label,short_label,unit_type,scale";
|
||||
$tabfield[38] = "code,label,url,icon,entity";
|
||||
$tabfield[39] = "code,libelle,sortorder";
|
||||
$tabfield[40] = "code,libelle,picto";
|
||||
|
||||
// Edit field names for editing a record
|
||||
$tabfieldvalue = array();
|
||||
@ -326,7 +341,7 @@ $tabfieldvalue[23] = "country,taux,revenuestamp_type,accountancy_code_sell,accou
|
||||
$tabfieldvalue[24] = "code,label";
|
||||
$tabfieldvalue[25] = "code,label";
|
||||
//$tabfieldvalue[26]= "code,label,short_label";
|
||||
$tabfieldvalue[27] = "code,libelle";
|
||||
$tabfieldvalue[27] = "code,libelle,picto";
|
||||
$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country";
|
||||
$tabfieldvalue[29] = "code,label,percent,position";
|
||||
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
@ -338,6 +353,8 @@ $tabfieldvalue[35] = "label";
|
||||
$tabfieldvalue[36] = "range_ik,fk_c_exp_tax_cat";
|
||||
$tabfieldvalue[37] = "code,label,short_label,unit_type,scale";
|
||||
$tabfieldvalue[38] = "code,label,url,icon";
|
||||
$tabfieldvalue[39] = "code,libelle,sortorder";
|
||||
$tabfieldvalue[40] = "code,libelle,picto";
|
||||
|
||||
// Field names in the table for inserting a record
|
||||
$tabfieldinsert = array();
|
||||
@ -367,7 +384,7 @@ $tabfieldinsert[23] = "fk_pays,taux,revenuestamp_type,accountancy_code_sell,acco
|
||||
$tabfieldinsert[24] = "code,label";
|
||||
$tabfieldinsert[25] = "code,label";
|
||||
//$tabfieldinsert[26]= "code,label,short_label";
|
||||
$tabfieldinsert[27] = "code,libelle";
|
||||
$tabfieldinsert[27] = "code,libelle,picto";
|
||||
$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country";
|
||||
$tabfieldinsert[29] = "code,label,percent,position";
|
||||
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
@ -380,6 +397,8 @@ $tabfieldinsert[35] = "label";
|
||||
$tabfieldinsert[36] = "range_ik,fk_c_exp_tax_cat";
|
||||
$tabfieldinsert[37] = "code,label,short_label,unit_type,scale";
|
||||
$tabfieldinsert[38] = "code,label,url,icon,entity";
|
||||
$tabfieldinsert[39] = "code,label,sortorder";
|
||||
$tabfieldinsert[40] = "code,libelle,picto";
|
||||
|
||||
// Rowid name of field depending if field is autoincrement on or off..
|
||||
// Use "" if id field is "rowid" and has autoincrement on
|
||||
@ -423,6 +442,8 @@ $tabrowid[35] = "";
|
||||
$tabrowid[36] = "";
|
||||
$tabrowid[37] = "";
|
||||
$tabrowid[38] = "";
|
||||
$tabrowid[39] = "code";
|
||||
$tabrowid[40] = "id";
|
||||
|
||||
// Condition to show dictionary in setup page
|
||||
$tabcond = array();
|
||||
@ -464,6 +485,8 @@ $tabcond[35] = !empty($conf->expensereport->enabled);
|
||||
$tabcond[36] = !empty($conf->expensereport->enabled);
|
||||
$tabcond[37] = !empty($conf->product->enabled);
|
||||
$tabcond[38] = !empty($conf->socialnetworks->enabled);
|
||||
$tabcond[39] = (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
|
||||
$tabcond[40] = ! empty($conf->societe->enabled);
|
||||
|
||||
// List of help for fields
|
||||
$tabhelp = array();
|
||||
@ -493,7 +516,7 @@ $tabhelp[23] = array('revenuestamp_type'=>'FixedOrPercent');
|
||||
$tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
||||
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"),'picto'=>$langs->trans("PictoHelp"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||
@ -505,6 +528,8 @@ $tabhelp[35] = array();
|
||||
$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
||||
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"), 'unit_type' => $langs->trans('MeasuringUnitTypeDesc'), 'scale' => $langs->trans('MeasuringScaleDesc'));
|
||||
$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
||||
$tabhelp[39] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[40] = array('code'=>$langs->trans("EnterAnyCode"),'picto'=>$langs->trans("PictoHelp"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck = array();
|
||||
@ -546,6 +571,8 @@ $tabfieldcheck[35] = array();
|
||||
$tabfieldcheck[36] = array();
|
||||
$tabfieldcheck[37] = array();
|
||||
$tabfieldcheck[38] = array();
|
||||
$tabfieldcheck[39] = array();
|
||||
$tabfieldcheck[40] = array();
|
||||
|
||||
// Complete all arrays with entries found into modules
|
||||
complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck);
|
||||
@ -647,7 +674,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($value == 'dayrule' && empty($_POST['dayrule'])) continue;
|
||||
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
|
||||
if ((!isset($_POST[$value]) || $_POST[$value] == '')
|
||||
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory
|
||||
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
|
||||
&& (!($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
||||
)
|
||||
) {
|
||||
|
||||
@ -102,7 +102,7 @@ print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
$head = security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'audit', $langs->trans("Security"), -1);
|
||||
dol_fiche_head($head, 'audit', '', -1);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
|
||||
@ -184,7 +184,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup')
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'shipment');
|
||||
|
||||
// Shipment numbering model
|
||||
|
||||
@ -373,13 +373,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -389,7 +389,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'shipment');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'shipment');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -500,13 +500,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -516,7 +516,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -378,13 +378,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup')
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment');
|
||||
|
||||
|
||||
// Delivery numbering model
|
||||
|
||||
@ -76,7 +76,7 @@ print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'shipment');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ print "<br>\n";
|
||||
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'sending');
|
||||
dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'shipment');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -153,20 +153,20 @@ $sourceList = array();
|
||||
|
||||
// We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']"
|
||||
$elementList = array();
|
||||
if ($conf->propal->enabled) $elementList['propal_send'] = $langs->trans('MailToSendProposal');
|
||||
if ($conf->commande->enabled) $elementList['order_send'] = $langs->trans('MailToSendOrder');
|
||||
if ($conf->facture->enabled) $elementList['facture_send'] = $langs->trans('MailToSendInvoice');
|
||||
if ($conf->propal->enabled && $user->rights->propal->lire) $elementList['propal_send'] = $langs->trans('MailToSendProposal');
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire) $elementList['order_send'] = $langs->trans('MailToSendOrder');
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire) $elementList['facture_send'] = $langs->trans('MailToSendInvoice');
|
||||
if ($conf->expedition->enabled) $elementList['shipping_send'] = $langs->trans('MailToSendShipment');
|
||||
if ($conf->reception->enabled) $elementList['reception_send'] = $langs->trans('MailToSendReception');
|
||||
if ($conf->ficheinter->enabled) $elementList['fichinter_send'] = $langs->trans('MailToSendIntervention');
|
||||
if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send'] = $langs->trans('MailToSendSupplierRequestForQuotation');
|
||||
if ($conf->fournisseur->enabled && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled) $elementList['order_supplier_send'] = $langs->trans('MailToSendSupplierOrder');
|
||||
if ($conf->fournisseur->enabled && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_invoice->enabled) $elementList['invoice_supplier_send'] = $langs->trans('MailToSendSupplierInvoice');
|
||||
if ($conf->societe->enabled) $elementList['thirdparty'] = $langs->trans('MailToThirdparty');
|
||||
if ($conf->adherent->enabled) $elementList['member'] = $langs->trans('MailToMember');
|
||||
if ($conf->contrat->enabled) $elementList['contract'] = $langs->trans('MailToSendContract');
|
||||
if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_order->enabled && $user->rights->supplier_order->lire)) $elementList['order_supplier_send'] = $langs->trans('MailToSendSupplierOrder');
|
||||
if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_invoice->enabled && $user->rights->supplier_invoice->lire)) $elementList['invoice_supplier_send'] = $langs->trans('MailToSendSupplierInvoice');
|
||||
if ($conf->societe->enabled && $user->rights->societe->lire) $elementList['thirdparty'] = $langs->trans('MailToThirdparty');
|
||||
if ($conf->adherent->enabled && $user->rights->adherent->lire) $elementList['member'] = $langs->trans('MailToMember');
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementList['contract'] = $langs->trans('MailToSendContract');
|
||||
if ($conf->projet->enabled) $elementList['project'] = $langs->trans('MailToProject');
|
||||
if ($conf->ticket->enabled) $elementList['ticket_send'] = $langs->trans('MailToTicket');
|
||||
if ($conf->ticket->enabled && $user->rights->ticket->read) $elementList['ticket_send'] = $langs->trans('MailToTicket');
|
||||
$elementList['user'] = $langs->trans('MailToUser');
|
||||
|
||||
$parameters = array('elementList'=>$elementList);
|
||||
@ -540,10 +540,11 @@ print "</tr>";
|
||||
|
||||
// Show fields for topic, join files and body
|
||||
$fieldsforcontent = array('topic', 'joinfiles', 'content');
|
||||
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content', 'content_lines'); }
|
||||
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); }
|
||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
{
|
||||
print '<tr class="impair nodrag nodrop nohover"><td colspan="6" class="nobottom">';
|
||||
|
||||
// Label
|
||||
if ($tmpfieldlist == 'topic')
|
||||
{
|
||||
@ -557,6 +558,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
|
||||
if ($tmpfieldlist == 'content_lines')
|
||||
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
|
||||
|
||||
// Input field
|
||||
if ($tmpfieldlist == 'topic') {
|
||||
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="'.(!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '').'">';
|
||||
@ -633,30 +635,34 @@ if ($resql)
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
$filterfound = 0;
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" class="maxwidth100" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
elseif ($value == 'lang')
|
||||
{
|
||||
if ($value == 'label') {
|
||||
print '<td class="liste_titre"><input type="text" name="search_label" class="maxwidth100" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
} elseif ($value == 'lang') {
|
||||
print '<td class="liste_titre">';
|
||||
print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth100');
|
||||
print '</td>';
|
||||
} elseif ($value == 'fk_user')
|
||||
{
|
||||
} elseif ($value == 'fk_user') {
|
||||
print '<td class="liste_titre">';
|
||||
$restrictid = array();
|
||||
if (!$user->admin) $restrictid = array($user->id);
|
||||
//var_dump($restrictid);
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth100');
|
||||
print '</td>';
|
||||
} elseif ($value == 'topic') print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
elseif ($value == 'type_template')
|
||||
{
|
||||
} elseif ($value == 'topic') {
|
||||
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
} elseif ($value == 'type_template') {
|
||||
print '<td class="liste_titre">'.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100 maxwidth100onsmartphone').'</td>';
|
||||
} elseif (!in_array($value, array('content', 'content_lines'))) print '<td class="liste_titre"></td>';
|
||||
} elseif (!in_array($value, array('content', 'content_lines'))) {
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print '<td class="liste_titre"></td>';
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre right" width="64">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
|
||||
@ -151,7 +151,7 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1);
|
||||
dol_fiche_head($head, 'handler', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("MenusDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@ -229,7 +229,7 @@ $head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'misc';
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1);
|
||||
dol_fiche_head($head, 'editor', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("MenusEditorDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@ -75,7 +75,7 @@ $head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'misc';
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
|
||||
dol_fiche_head($head, 'misc', '', -1);
|
||||
|
||||
|
||||
// Other Options
|
||||
|
||||
@ -262,7 +262,7 @@ print '<div class="centpercent">';
|
||||
|
||||
$picto = 'object_'.$objMod->picto;
|
||||
|
||||
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto);
|
||||
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto, 0, '', 'titlemodulehelp');
|
||||
print '<br>';
|
||||
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors", "admin", "modulebuilder"));
|
||||
|
||||
$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : 'commonkanban';
|
||||
$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : (empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common');
|
||||
if (empty($mode)) $mode = 'common';
|
||||
$action = GETPOST('action', 'alpha');
|
||||
//var_dump($_POST);exit;
|
||||
@ -506,10 +506,10 @@ if ($mode == 'common' || $mode == 'commonkanban')
|
||||
$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="">'.$moreinfo.'</span><br><b class="largenumber">'.$moreinfo2.'</b></div>';
|
||||
|
||||
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Keyword').': <input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
||||
$moreforfilter .= '</div>';
|
||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
@ -518,11 +518,11 @@ if ($mode == 'common' || $mode == 'commonkanban')
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 0) $array_version['deprecated'] = $langs->trans("Deprecated");
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental'] = $langs->trans("Experimental");
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development'] = $langs->trans("Development");
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Version').': '.$form->selectarray('search_version', $array_version, $search_version, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $langs->trans('Status').': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= ' ';
|
||||
|
||||
@ -371,13 +371,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_valu
|
||||
print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
$head = mrpAdminPrepareHead(null);
|
||||
$head = mrpAdminPrepareHead();
|
||||
|
||||
dol_fiche_head($head, 'mrp_extrafields', $langs->trans("ExtraFields"), -1, 'account');
|
||||
|
||||
|
||||
@ -291,7 +291,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
@ -299,7 +299,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ $db->commit();
|
||||
|
||||
$head = security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'default', $langs->trans("Security"), -1);
|
||||
dol_fiche_head($head, 'default', '', -1);
|
||||
|
||||
|
||||
// Show warning about external users
|
||||
|
||||
@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ print '<input type="hidden" name="action" value="set_proxy">';
|
||||
|
||||
$head = security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1);
|
||||
dol_fiche_head($head, 'proxy', '', -1);
|
||||
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
|
||||
@ -65,13 +65,13 @@ if (!function_exists('gzdecode')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
||||
if ($action == 'addprinter' && $user->admin) {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
if (empty($printername)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors');
|
||||
@ -82,7 +82,8 @@ if ($action == 'addprinter' && $user->admin) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
|
||||
$db->begin();
|
||||
$result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (!$error)
|
||||
@ -99,14 +100,14 @@ if ($action == 'addprinter' && $user->admin) {
|
||||
|
||||
if ($action == 'deleteprinter' && $user->admin) {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
if (empty($printerid)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $printer->deletePrinter($printerid);
|
||||
$db->begin();
|
||||
$result = $printer->deletePrinter($printerid);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (!$error)
|
||||
@ -123,14 +124,14 @@ if ($action == 'deleteprinter' && $user->admin) {
|
||||
|
||||
if ($action == 'updateprinter' && $user->admin) {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
if (empty($printerid)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
|
||||
$db->begin();
|
||||
$result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
@ -189,14 +190,14 @@ if ($action == 'testtemplate' && $user->admin) {
|
||||
|
||||
if ($action == 'updatetemplate' && $user->admin) {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
if (empty($templateid)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $printer->updateTemplate($templatename, $template, $templateid);
|
||||
$db->begin();
|
||||
$result = $printer->updateTemplate($templatename, $template, $templateid);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
@ -212,14 +213,14 @@ if ($action == 'updatetemplate' && $user->admin) {
|
||||
|
||||
if ($action == 'addtemplate' && $user->admin) {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
if (empty($templatename)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $printer->addTemplate($templatename, $template);
|
||||
$db->begin();
|
||||
$result = $printer->addTemplate($templatename, $template);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
@ -233,6 +234,29 @@ if ($action == 'addtemplate' && $user->admin) {
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'deletetemplate' && $user->admin) {
|
||||
$error = 0;
|
||||
if (empty($templateid)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
$result = $printer->deleteTemplate($templateid);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("TemplateDeleted", $templatename), null);
|
||||
} else {
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$action = '';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -247,6 +271,7 @@ print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_s
|
||||
|
||||
$head = receiptprinteradmin_prepare_head($mode);
|
||||
|
||||
// mode = config
|
||||
if ($mode == 'config' && $user->admin) {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -259,7 +284,7 @@ if ($mode == 'config' && $user->admin) {
|
||||
|
||||
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
|
||||
|
||||
print $langs->trans("ReceiptPrinterDesc")."<br><br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("ReceiptPrinterDesc")."</span><br><br>\n";
|
||||
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
@ -272,6 +297,22 @@ if ($mode == 'config' && $user->admin) {
|
||||
$ret = $printer->listprinters();
|
||||
$nbofprinters = count($printer->listprinters);
|
||||
|
||||
if ($action != 'editprinter') {
|
||||
print '<tr>';
|
||||
print '<td><input size="50" type="text" name="printername"></td>';
|
||||
$ret = $printer->selectTypePrinter();
|
||||
print '<td>'.$printer->resprint.'</td>';
|
||||
$ret = $printer->selectProfilePrinter();
|
||||
print '<td>'.$printer->profileresprint.'</td>';
|
||||
print '<td><input size="60" type="text" name="parameter"></td>';
|
||||
print '<td class="right">';
|
||||
if ($action != 'editprinter') {
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($ret > 0) {
|
||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
} else {
|
||||
@ -285,7 +326,9 @@ if ($mode == 'config' && $user->admin) {
|
||||
$ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
|
||||
print '<td>'.$printer->profileresprint.'</td>';
|
||||
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
|
||||
print '<td></td>';
|
||||
print '<td>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<td>'.$printer->listprinters[$line]['name'].'</td>';
|
||||
@ -293,15 +336,15 @@ if ($mode == 'config' && $user->admin) {
|
||||
print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
|
||||
print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
|
||||
// edit icon
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&printerid='.$printer->listprinters[$line]['rowid'].'">';
|
||||
print '<td class="right"><a class="editfielda marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&printerid='.$printer->listprinters[$line]['rowid'].'">';
|
||||
print img_picto($langs->trans("Edit"), 'edit');
|
||||
print '</a>';
|
||||
// delete icon
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=config&action=deleteprinter&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.$printer->listprinters[$line]['name'].'">';
|
||||
print '<a class="marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=deleteprinter&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.$printer->listprinters[$line]['name'].'">';
|
||||
print img_picto($langs->trans("Delete"), 'delete');
|
||||
print '</a>';
|
||||
// test icon
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=config&action=testprinter&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.$printer->listprinters[$line]['name'].'">';
|
||||
print '<a class="marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=config&action=testprinter&printerid='.$printer->listprinters[$line]['rowid'].'&printername='.$printer->listprinters[$line]['name'].'">';
|
||||
print img_picto($langs->trans("TestPrinter"), 'printer');
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
@ -309,38 +352,10 @@ if ($mode == 'config' && $user->admin) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action != 'editprinter') {
|
||||
if ($nbofprinters > 0) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Name").'</th>';
|
||||
print '<th>'.$langs->trans("Type").'</th>';
|
||||
print '<th>'.$langs->trans("Profile").'</th>';
|
||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
||||
print '<th></th>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print '<tr>';
|
||||
print '<td><input size="50" type="text" name="printername"></td>';
|
||||
$ret = $printer->selectTypePrinter();
|
||||
print '<td>'.$printer->resprint.'</td>';
|
||||
$ret = $printer->selectProfilePrinter();
|
||||
print '<td>'.$printer->profileresprint.'</td>';
|
||||
print '<td><input size="60" type="text" name="parameter"></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($action != 'editprinter') {
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
|
||||
} else {
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
||||
}
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
@ -370,8 +385,11 @@ if ($mode == 'config' && $user->admin) {
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
// mode = template
|
||||
if ($mode == 'template' && $user->admin) {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
|
||||
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic');
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if ($action != 'edittemplate') {
|
||||
print '<input type="hidden" name="action" value="addtemplate">';
|
||||
@ -379,16 +397,11 @@ if ($mode == 'template' && $user->admin) {
|
||||
print '<input type="hidden" name="action" value="updatetemplate">';
|
||||
}
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("ReceiptPrinterTemplateDesc"), '', '')."<br><br>\n";
|
||||
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Name").'</th>';
|
||||
print '<th>'.$langs->trans("Template").'</th>';
|
||||
print '<th></th>';
|
||||
print '<th></th>';
|
||||
print '<th></th>';
|
||||
print "</tr>\n";
|
||||
$ret = $printer->listPrintersTemplates();
|
||||
//print '<pre>'.print_r($printer->listprinterstemplates, true).'</pre>';
|
||||
@ -401,22 +414,23 @@ if ($mode == 'template' && $user->admin) {
|
||||
if ($action == 'edittemplate' && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
|
||||
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td><textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
|
||||
print '<td>';
|
||||
print '<textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
} else {
|
||||
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
|
||||
print '<td>'.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).'</td>';
|
||||
// edit icon
|
||||
print '<td><a class="editfielda paddingleftonly paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print '<td><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print img_picto($langs->trans("Edit"), 'edit');
|
||||
print '</a>';
|
||||
// delete icon
|
||||
print '<a class="paddingleftonly paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=deletetemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'&templatename='.$printer->listprinterstemplates[$line]['name'].'">';
|
||||
print '<a class="paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=deletetemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'&templatename='.$printer->listprinterstemplates[$line]['name'].'">';
|
||||
print img_picto($langs->trans("Delete"), 'delete');
|
||||
print '</a>';
|
||||
// test icon
|
||||
print '<a class="paddingleftonly paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=testtemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'&templatename='.$printer->listprinterstemplates[$line]['name'].'">';
|
||||
print '<a class="paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=testtemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'&templatename='.$printer->listprinterstemplates[$line]['name'].'">';
|
||||
print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -424,20 +438,30 @@ if ($mode == 'template' && $user->admin) {
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
if ($action != 'edittemplate') {
|
||||
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print '<tr>';
|
||||
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td><textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
|
||||
print '<td>';
|
||||
print '<textarea name="template" wrap="soft" cols="120" rows="12">';
|
||||
print GETPOSTISSET('template') ? GETPOST('template', 'alpha') : $printer->listprinterstemplates[$line]['template'];
|
||||
print '</textarea>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
|
||||
print '</table>';
|
||||
|
||||
if ($action != 'edittemplate') {
|
||||
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
|
||||
} else {
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
||||
}
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
|
||||
@ -379,13 +379,13 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -395,7 +395,7 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -487,7 +487,7 @@ print "</td></tr>\n";
|
||||
*/
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
//print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ print "<br>\n";
|
||||
|
||||
$head = security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'passwords', $langs->trans("Security"), -1);
|
||||
dol_fiche_head($head, 'passwords', '', -1);
|
||||
|
||||
|
||||
// Choix du gestionnaire du generateur de mot de passe
|
||||
|
||||
@ -100,7 +100,7 @@ print '<input type="hidden" name="action" value="updateform">';
|
||||
|
||||
$head = security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'file', $langs->trans("Security"), -1);
|
||||
dol_fiche_head($head, 'file', '', -1);
|
||||
|
||||
|
||||
// Upload options
|
||||
|
||||
@ -93,7 +93,7 @@ print '<input type="hidden" name="action" value="updateform">';
|
||||
|
||||
$head = security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'misc', $langs->trans("Security"), -1);
|
||||
dol_fiche_head($head, 'misc', '', -1);
|
||||
|
||||
|
||||
// Other Options
|
||||
|
||||
@ -37,18 +37,40 @@ $langs->loadLangs(array("admin", "stocks"));
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'stock';
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
||||
$reg = array();
|
||||
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
||||
{
|
||||
$code = $reg[1];
|
||||
|
||||
// If constant is for a unique choice, delete other choices
|
||||
if (in_array($code, array('STOCK_CALCULATE_ON_BILL', 'STOCK_CALCULATE_ON_VALIDATE_ORDER', 'STOCK_CALCULATE_ON_SHIPMENT', 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_BILL', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_VALIDATE_ORDER', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SHIPMENT', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', $conf->entity);
|
||||
}
|
||||
if (in_array($code, array('STOCK_CALCULATE_ON_SUPPLIER_BILL', 'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', 'STOCK_CALCULATE_ON_RECEPTION', 'STOCK_CALCULATE_ON_RECEPTION_CLOSE', 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'))) {
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SUPPLIER_BILL', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_RECEPTION', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_RECEPTION_CLOSE', $conf->entity);
|
||||
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', $conf->entity);
|
||||
}
|
||||
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -77,11 +99,84 @@ if ($action == 'warehouse')
|
||||
if (!$res > 0) $error++;
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
$object = new Entrepot($db);
|
||||
$object->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file = ''; $classname = ''; $filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$file = dol_buildpath($reldir."core/modules/stock/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($object, $langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=stock&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($module->error, null, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
elseif ($action == 'set') {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
} elseif ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->STOCK_ADDON_PDF == "$value") dolibarr_del_const($db, 'STOCK_ADDON_PDF', $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
// Set default model
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "STOCK_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
// The constant that was read before the new set
|
||||
// We therefore requires a variable to have a coherent view
|
||||
$conf->global->STOCK_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader('', $langs->trans("StockSetup"));
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
@ -130,7 +225,7 @@ print '<td class="right">';
|
||||
if (!empty($conf->facture->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
|
||||
@ -148,7 +243,7 @@ print '<td class="right">';
|
||||
if (!empty($conf->commande->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
|
||||
@ -168,7 +263,7 @@ print '<td class="right">';
|
||||
if (!empty($conf->expedition->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
|
||||
@ -186,7 +281,7 @@ print '<td class="right">';
|
||||
if (!empty($conf->expedition->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
|
||||
@ -197,18 +292,12 @@ if (!empty($conf->expedition->enabled))
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
|
||||
/*if (! $found)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockDecrease").'</td>';
|
||||
print "</tr>\n";
|
||||
}*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Title rule for stock increase
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -224,7 +313,7 @@ print '<td class="right">';
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
|
||||
@ -243,7 +332,7 @@ print '<td class="right">';
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
|
||||
@ -261,7 +350,7 @@ if (!empty($conf->reception->enabled))
|
||||
print '<td class="right">';
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
|
||||
@ -276,7 +365,7 @@ if (!empty($conf->reception->enabled))
|
||||
print '<td class="right">';
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
|
||||
@ -290,7 +379,7 @@ if (!empty($conf->reception->enabled))
|
||||
if (!empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER');
|
||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
|
||||
@ -409,6 +498,161 @@ if ($virtualdiffersfromphysical)
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("WarehouseModelModules"), '', '');
|
||||
|
||||
// Load array def with activated templates
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE type = '".$type."'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num_rows = $db->num_rows($resql);
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>'.$langs->trans("Name").'</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("Default")."</td>\n";
|
||||
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach (array('', '/doc') as $valdir)
|
||||
{
|
||||
$realpath = $reldir."core/modules/stock".$valdir;
|
||||
$dir = dol_buildpath($realpath);
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle)) !== false)
|
||||
{
|
||||
$filelist[] = $file;
|
||||
}
|
||||
closedir($handle);
|
||||
arsort($filelist);
|
||||
|
||||
foreach ($filelist as $file)
|
||||
{
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
|
||||
{
|
||||
if (file_exists($dir.'/'.$file))
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module, 'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print '<td class="center">'."\n";
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
print '<td class="center">';
|
||||
if ($conf->global->STOCK_ADDON_PDF == $name)
|
||||
{
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
}
|
||||
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||
|
||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Other
|
||||
|
||||
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -28,21 +28,27 @@ require '../../main.inc.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin)
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
|
||||
if ($action == 'convert')
|
||||
{
|
||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
|
||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
|
||||
$db->query($sql);
|
||||
}
|
||||
if ($action == 'convertutf8')
|
||||
{
|
||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
|
||||
$db->query($sql);
|
||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
|
||||
$db->query($sql);
|
||||
}
|
||||
if ($action == 'convertdynamic')
|
||||
{
|
||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ROW_FORMAT=DYNAMIC;";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -82,8 +88,8 @@ if (!$base)
|
||||
} else {
|
||||
if ($base == 1)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||
@ -112,13 +118,17 @@ if (!$base)
|
||||
|
||||
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
|
||||
print '<td>'.$obj->Engine.'</td>';
|
||||
if (isset($obj->Engine) && $obj->Engine == "MyISAM")
|
||||
{
|
||||
print '<td><a class="reposition" href="database-tables.php?action=convert&table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDB</a></td>';
|
||||
if (isset($obj->Engine) && $obj->Engine == "MyISAM") {
|
||||
print '<td><a class="reposition" href="database-tables.php?action=convert&table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDb</a></td>';
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
}
|
||||
print '<td>'.$obj->Row_format.'</td>';
|
||||
print '<td>';
|
||||
print $obj->Row_format;
|
||||
if (isset($obj->Row_format) && (in_array($obj->Row_format, array("Compact")))) {
|
||||
print '<br><a class="reposition" href="database-tables.php?action=convertdynamic&table='.$obj->Name.'">'.$langs->trans("Convert").' Dynamic</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right">'.$obj->Rows.'</td>';
|
||||
print '<td align="right">'.$obj->Avg_row_length.'</td>';
|
||||
print '<td align="right">'.$obj->Data_length.'</td>';
|
||||
@ -127,9 +137,8 @@ if (!$base)
|
||||
print '<td align="right">'.$obj->Auto_increment.'</td>';
|
||||
print '<td align="right">'.$obj->Check_time.'</td>';
|
||||
print '<td align="right">'.$obj->Collation;
|
||||
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci"))))
|
||||
{
|
||||
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
|
||||
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) {
|
||||
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -142,8 +151,8 @@ if (!$base)
|
||||
|
||||
if ($base == 2)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>Nb of tuples</td>';
|
||||
@ -182,8 +191,8 @@ if (!$base)
|
||||
if ($base == 4)
|
||||
{
|
||||
// Sqlite by PDO or by Sqlite3
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||
|
||||
@ -348,7 +348,7 @@ if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
|
||||
// @todo Use module notification instead...
|
||||
|
||||
// Email d'envoi des notifications
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("TicketEmailNotificationFrom").'</td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationFrom").'</td>';
|
||||
print '<td class="left">';
|
||||
print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_FROM" value="'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'"></td>';
|
||||
print '<td class="center">';
|
||||
|
||||
@ -237,7 +237,8 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
|
||||
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
|
||||
print '</legend>';
|
||||
print '<input type="checkbox" name="drop"'.(((!isset($_GET["drop"]) && !isset($_POST["drop"])) || GETPOST('drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
|
||||
|
||||
print '<input type="checkbox" name="drop"'.((! GETPOSTISSET("drop") || GETPOST('drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
|
||||
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
|
||||
print '<br>';
|
||||
print '</fieldset>';
|
||||
|
||||
@ -419,8 +419,10 @@ class Documents extends DolibarrApi
|
||||
|
||||
$object = new Product($this->db);
|
||||
$result = $object->fetch($id, $ref);
|
||||
if (!$result) {
|
||||
if ($result==0) {
|
||||
throw new RestException(404, 'Product not found');
|
||||
} elseif ($result<0) {
|
||||
throw new RestException(500, 'Error while fetching object: '.$object->error);
|
||||
}
|
||||
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
@ -630,7 +632,7 @@ class Documents extends DolibarrApi
|
||||
}
|
||||
elseif ($result < 0)
|
||||
{
|
||||
throw new RestException(500, 'Error while fetching object.');
|
||||
throw new RestException(500, 'Error while fetching object: '.$object->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -251,15 +251,17 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
|
||||
if ($tmpmodule != 'api')
|
||||
$tmpmodule = preg_replace('/api$/i', '', $tmpmodule);
|
||||
$classfile = str_replace('_', '', $tmpmodule);
|
||||
if ($module == 'supplierproposals')
|
||||
|
||||
// Special cases that does not match name rules conventions
|
||||
if ($moduleobject == 'supplierproposals')
|
||||
$classfile = 'supplier_proposals';
|
||||
if ($module == 'supplierorders')
|
||||
if ($moduleobject == 'supplierorders')
|
||||
$classfile = 'supplier_orders';
|
||||
if ($module == 'supplierinvoices')
|
||||
if ($moduleobject == 'supplierinvoices')
|
||||
$classfile = 'supplier_invoices';
|
||||
if ($module == 'ficheinter')
|
||||
if ($moduleobject == 'ficheinter')
|
||||
$classfile = 'interventions';
|
||||
if ($module == 'interventions')
|
||||
if ($moduleobject == 'interventions')
|
||||
$classfile = 'interventions';
|
||||
|
||||
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php', 0, 2);
|
||||
|
||||
@ -57,9 +57,11 @@ $thirdpartytmp = new Societe($db);
|
||||
if (GETPOST('submitproduct') && GETPOST('submitproduct'))
|
||||
{
|
||||
$action = ''; // We reset because we don't want to build doc
|
||||
if (GETPOST('productid') > 0)
|
||||
{
|
||||
$producttmp->fetch(GETPOST('productid'));
|
||||
if (GETPOST('productid') > 0) {
|
||||
$result = $producttmp->fetch(GETPOST('productid'));
|
||||
if ($result < 0) {
|
||||
setEventMessage($producttmp->error, 'errors');
|
||||
}
|
||||
$forbarcode = $producttmp->barcode;
|
||||
$fk_barcode_type = $producttmp->barcode_type;
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ if ($object->id > 0)
|
||||
|
||||
// Object card
|
||||
// ------------------------------------------------------------
|
||||
$linkback = '<a href="'.dol_buildpath('/bom/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.dol_buildpath('/bom/bom_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
/*
|
||||
|
||||
@ -192,10 +192,10 @@ if (empty($reshook))
|
||||
$error = 0;
|
||||
|
||||
// Set if we used free entry or predefined product
|
||||
$qty = GETPOST('qty', 'int');
|
||||
$qty = price2num(GETPOST('qty', 'int'));
|
||||
$qty_frozen = GETPOST('qty_frozen', 'int');
|
||||
$disable_stock_change = GETPOST('disable_stock_change', 'int');
|
||||
$efficiency = GETPOST('efficiency', 'int');
|
||||
$efficiency = price2num(GETPOST('efficiency', 'int'));
|
||||
|
||||
if ($qty == '') {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
@ -219,6 +219,8 @@ if (empty($reshook))
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['qty_frozen']);
|
||||
unset($_POST['disable_stock_change']);
|
||||
|
||||
$object->fetchLines();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -541,7 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
if (!empty($object->table_element_line))
|
||||
{
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '').'" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
|
||||
@ -929,6 +929,7 @@ class BOM extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("mrp");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'standard';
|
||||
@ -1004,7 +1005,11 @@ class BOM extends CommonObject
|
||||
|
||||
foreach ($this->lines as &$line) {
|
||||
$tmpproduct = new Product($this->db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
$result= $tmpproduct->fetch($line->fk_product);
|
||||
if ($result < 0) {
|
||||
$this->error=$tmpproduct->error;
|
||||
return -1;
|
||||
}
|
||||
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
|
||||
if (empty($line->unit_cost)) {
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0)
|
||||
|
||||
@ -52,8 +52,15 @@ foreach ($linkedObjectBlock as $key => $objectlink)
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
|
||||
$product_static->fetch($objectlink->fk_product);
|
||||
echo '<td class="linkedcol-ref" align="center">'.$product_static->getNomUrl(1).'</td>';
|
||||
|
||||
echo '<td class="linkedcol-ref" align="center">';
|
||||
$result=$product_static->fetch($objectlink->fk_product);
|
||||
if ($result<0) {
|
||||
setEventMessage($product_static->error, 'errors');
|
||||
} elseif ($result>0) {
|
||||
$product_static->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
|
||||
echo '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->commande->lire) {
|
||||
|
||||
@ -113,7 +113,7 @@ if ($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
$coldisplay++;
|
||||
print '<td class="nobottom linecoluseunit left">';
|
||||
print $form->selectUnits($line->fk_unit, "units");
|
||||
print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -145,6 +145,7 @@ if ($action == 'create')
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewBookmark"));
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
||||
@ -819,8 +819,8 @@ class Categorie extends CommonObject
|
||||
|
||||
$objs = array();
|
||||
|
||||
$tmpclass = $this->MAP_OBJ_CLASS[$type];
|
||||
$obj = new $tmpclass($this->db);
|
||||
$classnameforobj = $this->MAP_OBJ_CLASS[$type];
|
||||
$obj = new $classnameforobj($this->db);
|
||||
|
||||
$sql = "SELECT c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as c";
|
||||
@ -842,12 +842,14 @@ class Categorie extends CommonObject
|
||||
{
|
||||
while ($rec = $this->db->fetch_array($resql))
|
||||
{
|
||||
if ($onlyids)
|
||||
{
|
||||
if ($onlyids) {
|
||||
$objs[] = $rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])];
|
||||
} else {
|
||||
$obj = new $this->MAP_OBJ_CLASS[$type]($this->db);
|
||||
$classnameforobj = $this->MAP_OBJ_CLASS[$type];
|
||||
|
||||
$obj = new $classnameforobj($this->db);
|
||||
$obj->fetch($rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])]);
|
||||
|
||||
$objs[] = $obj;
|
||||
}
|
||||
}
|
||||
@ -1213,7 +1215,8 @@ class Categorie extends CommonObject
|
||||
//print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'<br>'."\n";
|
||||
|
||||
// We count number of _ to have level
|
||||
$this->cats[$id_categ]['level'] = dol_strlen(preg_replace('/[^_]/i', '', $this->cats[$id_categ]['fullpath']));
|
||||
$nbunderscore = substr_count($this->cats[$id_categ]['fullpath'], '_');
|
||||
$this->cats[$id_categ]['level'] = ($nbunderscore ? $nbunderscore : null);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -2009,4 +2012,25 @@ class Categorie extends CommonObject
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Count all categories
|
||||
*
|
||||
* @return int Number of categories, -1 on error
|
||||
*/
|
||||
public function countNbOfCategories()
|
||||
{
|
||||
dol_syslog(get_class($this)."::count_all_categories", LOG_DEBUG);
|
||||
$sql = "SELECT COUNT(rowid) FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql .= " WHERE entity IN (".getEntity('category').")";
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if ($res) {
|
||||
$obj = $this->db->fetch_object($res);
|
||||
return $obj->count;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -526,6 +527,7 @@ if ($object->id > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
// Prospection level and status
|
||||
if ($object->client == 2 || $object->client == 3)
|
||||
{
|
||||
print '<br>';
|
||||
@ -533,12 +535,12 @@ if ($object->id > 0)
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Level of prospect
|
||||
// Level of prospection
|
||||
print '<tr><td class="titlefield nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('ProspectLevel');
|
||||
print '<td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editlevel')
|
||||
@ -550,17 +552,17 @@ if ($object->id > 0)
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
// Status of prospection
|
||||
$object->loadCacheOfProspStatus();
|
||||
print '<tr><td>'.$langs->trans("StatusProsp").'</td><td>'.$object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']);
|
||||
print ' ';
|
||||
print '<div class="floatright">';
|
||||
foreach ($object->cacheprospectstatus as $key => $val)
|
||||
{
|
||||
$titlealt = 'default';
|
||||
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label'];
|
||||
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt, $val['code']).'</a>';
|
||||
}
|
||||
$titlealt = 'default';
|
||||
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label'];
|
||||
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus reposition" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt, $val['code'], $val['picto']).'</a>';
|
||||
}
|
||||
print '</div></td></tr>';
|
||||
print "</table>";
|
||||
}
|
||||
@ -1127,7 +1129,7 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
/*
|
||||
* Last invoices
|
||||
* Latest invoices
|
||||
*/
|
||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
|
||||
@ -230,6 +230,7 @@ if (empty($reshook))
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
if ($ret > 0) $object->fetch_thirdparty();
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
@ -767,6 +768,7 @@ if (empty($reshook))
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
if ($ret > 0) $object->fetch_thirdparty();
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
} elseif ($action == "setabsolutediscount" && $usercancreate) {
|
||||
@ -1240,6 +1242,7 @@ if (empty($reshook))
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
if ($ret > 0) $object->fetch_thirdparty();
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
|
||||
@ -1494,6 +1494,7 @@ class Propal extends CommonObject
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->project = null; // Clear if another value was already set by fetch_projet
|
||||
|
||||
$this->model_pdf = $obj->model_pdf;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->last_main_doc = $obj->last_main_doc;
|
||||
$this->note = $obj->note_private; // TODO deprecated
|
||||
@ -3341,6 +3342,8 @@ class Propal extends CommonObject
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " WHERE entity IN (".getEntity('product').")";
|
||||
$sql .= $this->db->plimit(100);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -3664,6 +3667,7 @@ class Propal extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("propale");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'azur';
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -71,7 +72,7 @@ if (!empty($conf->propal->enabled))
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT count(*) as cc, st.libelle, st.id";
|
||||
$sql = "SELECT count(*) as cc, st.libelle, st.picto, st.id";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st ";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -98,7 +99,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<a href="prospects.php?page=0&stcomm='.$obj->id.'">';
|
||||
print img_action($langs->trans("Show"), $obj->id).' ';
|
||||
print img_action($langs->trans("Show"), $obj->id, $obj->picto).' ';
|
||||
print $langs->trans("StatusProspect".$obj->id);
|
||||
print '</a></td><td class="right">'.$obj->cc.'</td></tr>';
|
||||
$i++;
|
||||
|
||||
@ -1824,6 +1824,7 @@ class Commande extends CommonOrder
|
||||
$this->note = $obj->note_private; // deprecated
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->model_pdf = $obj->model_pdf;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->last_main_doc = $obj->last_main_doc;
|
||||
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
||||
@ -3719,6 +3720,8 @@ class Commande extends CommonOrder
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " WHERE entity IN (".getEntity('product').")";
|
||||
$sql .= $this->db->plimit(100);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -3859,6 +3862,7 @@ class Commande extends CommonOrder
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("orders");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'einstein';
|
||||
|
||||
@ -116,7 +116,7 @@ $hookmanager->initHooks(array('orderlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('commande');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -469,7 +469,7 @@ class Account extends CommonObject
|
||||
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
||||
*
|
||||
* @param int $date Date operation
|
||||
* @param string $oper 1,2,3,4... (deprecated) or 'TYP','VIR','PRE','LIQ','VAD','CB','CHQ'...
|
||||
* @param string $oper 'VIR','PRE','LIQ','VAD','CB','CHQ'...
|
||||
* @param string $label Descripton
|
||||
* @param float $amount Amount
|
||||
* @param string $num_chq Numero cheque ou virement
|
||||
|
||||
@ -1555,6 +1555,8 @@ class FactureRec extends CommonInvoice
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " WHERE entity IN (".getEntity('product').")";
|
||||
$sql .= $this->db->plimit(100);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -423,7 +423,7 @@ class Facture extends CommonInvoice
|
||||
$this->brouillon = 1;
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
@ -1581,6 +1581,7 @@ class Facture extends CommonInvoice
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->user_author = $obj->fk_user_author;
|
||||
$this->user_valid = $obj->fk_user_valid;
|
||||
$this->model_pdf = $obj->model_pdf;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->last_main_doc = $obj->last_main_doc;
|
||||
$this->situation_cycle_ref = $obj->situation_cycle_ref;
|
||||
@ -4089,6 +4090,8 @@ class Facture extends CommonInvoice
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " WHERE entity IN (".getEntity('product').")";
|
||||
$sql .= $this->db->plimit(100);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -4296,6 +4299,7 @@ class Facture extends CommonInvoice
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele))
|
||||
{
|
||||
|
||||
@ -53,6 +53,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inv
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
// Security check
|
||||
$id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
@ -106,7 +108,7 @@ $hookmanager->initHooks(array('invoicereclist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
@ -151,6 +153,11 @@ if ($socid > 0) {
|
||||
}
|
||||
|
||||
|
||||
if ($socid > 0) {
|
||||
$tmpthirdparty = new Societe($db);
|
||||
$res = $tmpthirdparty->fetch($socid);
|
||||
if ($res > 0) $search_societe = $tmpthirdparty->name;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
@ -150,7 +150,7 @@ $hookmanager->initHooks(array('invoicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('facture');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
@ -545,6 +545,8 @@ if (!$sall)
|
||||
$sql .= ' f.paye, f.fk_statut, f.close_code,';
|
||||
$sql .= ' f.datec, f.tms, f.date_closing,';
|
||||
$sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
|
||||
$sql .= ' f.fk_user_author, f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva,';
|
||||
$sql .= ' f.multicurrency_total_tva, f.multicurrency_total_ttc,';
|
||||
$sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
|
||||
$sql .= ' typent.code,';
|
||||
$sql .= ' state.code_departement, state.nom,';
|
||||
@ -830,12 +832,15 @@ if ($resql)
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
/*
|
||||
print $langs->trans('From').' ';
|
||||
print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to').' ';
|
||||
print $langs->trans('to').' ';*/
|
||||
print $langs->trans("Before").' ';
|
||||
print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1);
|
||||
print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late' ? ' checked' : '').'> '.$langs->trans("Alert");
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -1442,7 +1447,7 @@ if ($resql)
|
||||
{
|
||||
$userstatic->id = $obj->fk_user_author;
|
||||
$userstatic->login = $obj->login;
|
||||
print '<td align="center">';
|
||||
print '<td class="center tdoverflowmax100">';
|
||||
if ($userstatic->id) print $userstatic->getLoginUrl(1);
|
||||
else print ' ';
|
||||
print "</td>\n";
|
||||
@ -1592,19 +1597,21 @@ if ($resql)
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
$hidegeneratedfilelistifempty = 1;
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
|
||||
if ($contextpage != 'poslist') {
|
||||
$hidegeneratedfilelistifempty = 1;
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
|
||||
|
||||
// Show list of available documents
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
$urlsource .= str_replace('&', '&', $param);
|
||||
// Show list of available documents
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
$urlsource .= str_replace('&', '&', $param);
|
||||
|
||||
$filedir = $diroutputmassaction;
|
||||
$genallowed = $user->rights->facture->lire;
|
||||
$delallowed = $user->rights->facture->creer;
|
||||
$title = '';
|
||||
$filedir = $diroutputmassaction;
|
||||
$genallowed = $user->rights->facture->lire;
|
||||
$delallowed = $user->rights->facture->creer;
|
||||
$title = '';
|
||||
|
||||
print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -38,8 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
if (!$user->rights->facture->lire) accessforbidden();
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('bills', 'banks', 'withdrawals', 'companies'));
|
||||
|
||||
@ -51,7 +49,6 @@ $type = GETPOST('type', 'aZ09');
|
||||
|
||||
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
|
||||
|
||||
if ($type == 'bank-transfer') {
|
||||
$object = new FactureFournisseur($db);
|
||||
@ -63,6 +60,7 @@ if ($type == 'bank-transfer') {
|
||||
if ($id > 0 || !empty($ref))
|
||||
{
|
||||
$ret = $object->fetch($id, $ref);
|
||||
$isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
@ -71,6 +69,13 @@ if ($id > 0 || !empty($ref))
|
||||
|
||||
$hookmanager->initHooks(array('directdebitcard', 'globalcard'));
|
||||
|
||||
if ($type == 'bank-transfer') {
|
||||
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', $fieldid, $isdraft);
|
||||
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
|
||||
} else {
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||
if (!$user->rights->facture->lire) accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015-2020 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
@ -161,6 +161,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhereCustomerDraft', $parameters);
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, ";
|
||||
$sql.= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
|
||||
|
||||
// Add Group from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupByCustomerDraft', $parameters);
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
@ -458,7 +466,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye,";
|
||||
$sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur";
|
||||
$sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email";
|
||||
$sql .= " ORDER BY ff.tms DESC ";
|
||||
$sql .= $db->plimit($max, 0);
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
$thirdpartystatic = new Societe($db);
|
||||
$invoicestatic = new Facture($db);
|
||||
$invoicestatic = new FactureFournisseur($db);
|
||||
$bprev = new BonPrelevement($db);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -94,7 +94,7 @@ print '</td></tr></table></div><br>';
|
||||
*/
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
|
||||
$sql .= " pfd.date_demande, pfd.amount,";
|
||||
$sql .= " s.nom as name, s.email, s.rowid as socid";
|
||||
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -138,13 +138,14 @@ if ($resql)
|
||||
$thirdpartystatic->id = $obj->socid;
|
||||
$thirdpartystatic->name = $obj->name;
|
||||
$thirdpartystatic->email = $obj->email;
|
||||
$thirdpartystatic->tva_intra = $obj->tva_intra;
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||
print $thirdpartystatic->getNomUrl(1, 'supplier');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
|
||||
@ -31,10 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'bills', 'withdrawals'));
|
||||
|
||||
if (!$user->rights->prelevement->bons->lire)
|
||||
accessforbidden();
|
||||
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals'));
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
@ -44,7 +41,6 @@ $action = GETPOST('action', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
|
||||
// Load variable for pagination
|
||||
@ -67,6 +63,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
||||
|
||||
$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
|
||||
|
||||
if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -83,7 +86,11 @@ if (empty($reshook))
|
||||
$res = $object->delete($user);
|
||||
if ($res > 0)
|
||||
{
|
||||
header("Location: index.php");
|
||||
if ($object->type == 'bank-transfer') {
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php');
|
||||
} else {
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/index.php');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -139,11 +146,9 @@ if (empty($reshook))
|
||||
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
|
||||
$error = $object->set_infocredit($user, $dt);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
header("Location: card.php?id=".$id."&error=$error");
|
||||
exit;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -174,7 +179,7 @@ if ($id > 0 || $ref)
|
||||
|
||||
}*/
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php'.($object->type != 'bank-transfer' ? '' : '?type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
|
||||
@ -200,7 +205,7 @@ if ($id > 0 || $ref)
|
||||
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($object->date_trans, 'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $object->methodes_trans[$object->method_trans];
|
||||
print '</td></tr>';
|
||||
@ -223,7 +228,9 @@ if ($id > 0 || $ref)
|
||||
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("BankToReceiveWithdraw");
|
||||
$labelofbankfield = "BankToReceiveWithdraw";
|
||||
if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
|
||||
print $langs->trans($labelofbankfield);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($acc->id > 0)
|
||||
@ -232,9 +239,13 @@ if ($id > 0 || $ref)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$labelfororderfield = 'WithdrawalFile';
|
||||
if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
|
||||
print $langs->trans($labelfororderfield).'</td><td>';
|
||||
$relativepath = 'receipts/'.$object->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
$modulepart = 'prelevement';
|
||||
if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart='.$modulepart.'&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -59,7 +59,7 @@ class LignePrelevement
|
||||
|
||||
$langs->load("withdrawals");
|
||||
$this->statuts[0] = $langs->trans("StatusWaiting");
|
||||
$this->statuts[2] = $langs->trans("StatusCredited");
|
||||
$this->statuts[2] = $langs->trans("StatusPaid");
|
||||
$this->statuts[3] = $langs->trans("StatusRefused");
|
||||
}
|
||||
|
||||
|
||||
@ -88,11 +88,9 @@ if (empty($reshook))
|
||||
|
||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->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);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||
} elseif ($result == 0)
|
||||
{
|
||||
} elseif ($result == 0) {
|
||||
$mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$mesg .= '<br>'."\n";
|
||||
@ -101,7 +99,11 @@ if (empty($reshook))
|
||||
$mesg .= '<span class="warning">'.$val."</span><br>\n";
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
if ($type != 'bank-transfer') {
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
} else {
|
||||
setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
}
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id);
|
||||
exit;
|
||||
@ -366,10 +368,15 @@ if ($resql)
|
||||
|
||||
// RUM
|
||||
print '<td>';
|
||||
print $thirdpartystatic->display_rib('rum');
|
||||
$format = $thirdpartystatic->display_rib('format');
|
||||
if ($type != 'bank-transfer') {
|
||||
if ($format) print ' ('.$format.')';
|
||||
$rumtoshow = $thirdpartystatic->display_rib('rum');
|
||||
if ($rumtoshow) {
|
||||
print $rumtoshow;
|
||||
$format = $thirdpartystatic->display_rib('format');
|
||||
if ($type != 'bank-transfer') {
|
||||
if ($format) print ' ('.$format.')';
|
||||
}
|
||||
} else {
|
||||
print img_warning($langs->trans("NoBankAccount"));
|
||||
}
|
||||
print '</td>';
|
||||
// Amount
|
||||
|
||||
@ -105,14 +105,17 @@ if ($type != 'bank-transfer') {
|
||||
llxHeader('', $title);
|
||||
|
||||
$thirdpartystatic = new Societe($db);
|
||||
$invoicestatic = new Facture($db);
|
||||
if ($type == 'bank-transfer') {
|
||||
$invoicestatic = new FactureFournisseur($db);
|
||||
} else {
|
||||
$invoicestatic = new Facture($db);
|
||||
}
|
||||
|
||||
// List of requests
|
||||
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc,";
|
||||
$sql .= " s.nom as name, s.rowid as socid,";
|
||||
$sql .= " pfd.date_demande as date_demande,";
|
||||
$sql .= " pfd.fk_user_demande";
|
||||
$sql .= " pfd.date_demande as date_demande, pfd.amount, pfd.fk_user_demande";
|
||||
if ($type != 'bank-transfer') {
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
||||
} else {
|
||||
@ -126,6 +129,7 @@ $sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
|
||||
if (!$status) $sql .= " AND pfd.traite = 0";
|
||||
$sql .= " AND pfd.ext_payment_id IS NULL";
|
||||
if ($status) $sql .= " AND pfd.traite = ".$status;
|
||||
$sql .= " AND f.total_ttc > 0";
|
||||
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
|
||||
@ -141,7 +145,6 @@ if ($search_facture) $sql .= natural_search("f.ref", $search_facture);
|
||||
if ($search_societe) $sql .= natural_search("s.nom", $search_societe);
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -173,9 +176,9 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
|
||||
|
||||
|
||||
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
|
||||
$newcardbutton = '<a class="marginrightonly" href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
|
||||
if ($type == 'bank-transfer') {
|
||||
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
|
||||
$newcardbutton = '<a class="marginrightonly" href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="searchFormList" name="searchFormList">';
|
||||
@ -190,6 +193,14 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$param = '';
|
||||
|
||||
$label = 'NewStandingOrder';
|
||||
$typefilter = '';
|
||||
if ($type == 'bank-transfer') {
|
||||
$label = 'NewPaymentByBankTransfer';
|
||||
$typefilter = 'type='.$type;
|
||||
}
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'.($typefilter ? '?'.$typefilter : ''));
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
||||
|
||||
print '<table class="liste centpercent">';
|
||||
@ -197,7 +208,7 @@ print '<table class="liste centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
|
||||
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center ');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
@ -220,12 +231,12 @@ while ($i < min($num, $limit))
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) break; // Should not happen
|
||||
|
||||
$invoicestatic->fetch($obj->rowid);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref facture
|
||||
print '<td>';
|
||||
$invoicestatic->id = $obj->rowid;
|
||||
$invoicestatic->ref = $obj->ref;
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
@ -235,7 +246,9 @@ while ($i < min($num, $limit))
|
||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
print '<td class="right">';
|
||||
print price($obj->amount, 1, $langs, 1, -1, -1, $conf->currency).' / '.price($obj->total_ttc, 1, $langs, 1, -1, -1, $conf->currency);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
||||
|
||||
|
||||
@ -32,21 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'companies', 'withdrawals', 'bills'));
|
||||
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals'));
|
||||
|
||||
// Securite acces client
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
|
||||
// Get supervariables
|
||||
$id = GETPOST('id', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
@ -57,6 +57,17 @@ if (!$sortorder) $sortorder = 'DESC';
|
||||
|
||||
$object = new BonPrelevement($db);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
||||
$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
|
||||
|
||||
if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -75,19 +86,17 @@ if ($id > 0 || $ref)
|
||||
$head = prelevement_prepare_head($object);
|
||||
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/bons.php'.($object->type != 'bank-transfer' ? '' : '?type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
//print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec, 'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
// Status
|
||||
//print '<tr><td>'.$langs->trans('Status').'</td><td>'.$object->getLibStatut(1).'</td></tr>';
|
||||
|
||||
if ($object->date_trans <> 0)
|
||||
{
|
||||
@ -96,7 +105,7 @@ if ($id > 0 || $ref)
|
||||
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($object->date_trans, 'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $object->methodes_trans[$object->method_trans];
|
||||
print '</td></tr>';
|
||||
@ -119,7 +128,9 @@ if ($id > 0 || $ref)
|
||||
$result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("BankToReceiveWithdraw");
|
||||
$labelofbankfield = "BankToReceiveWithdraw";
|
||||
if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer';
|
||||
print $langs->trans($labelofbankfield);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($acc->id > 0)
|
||||
@ -128,9 +139,13 @@ if ($id > 0 || $ref)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$labelfororderfield = 'WithdrawalFile';
|
||||
if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile';
|
||||
print $langs->trans($labelfororderfield).'</td><td>';
|
||||
$relativepath = 'receipts/'.$object->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
$modulepart = 'prelevement';
|
||||
if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart='.$modulepart.'&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
@ -143,19 +158,31 @@ if ($id > 0 || $ref)
|
||||
|
||||
|
||||
// List of invoices
|
||||
$sql = "SELECT pf.rowid,";
|
||||
$sql = "SELECT pf.rowid, p.type,";
|
||||
$sql .= " f.rowid as facid, f.ref as ref, f.total_ttc,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
if ($object->type != 'bank-transfer') {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
} else {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
}
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid";
|
||||
$sql .= " AND pl.fk_prelevement_bons = p.rowid";
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
$sql .= " AND pf.fk_facture = f.rowid";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if ($object->type != 'bank-transfer') {
|
||||
$sql .= " AND pf.fk_facture = f.rowid";
|
||||
} else {
|
||||
$sql .= " AND pf.fk_facture_fourn = f.rowid";
|
||||
}
|
||||
if ($object->type != 'bank-transfer') {
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
} else {
|
||||
$sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
|
||||
}
|
||||
if ($object->id > 0) $sql .= " AND p.rowid=".$object->id;
|
||||
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
@ -164,8 +191,8 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
{
|
||||
$page = 0;
|
||||
@ -175,10 +202,10 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$param = "&id=".$id;
|
||||
@ -207,22 +234,28 @@ if ($result)
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountInvoice", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("StatusDebitCredit", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$totalinvoices = 0;
|
||||
$totalamount_requested = 0;
|
||||
|
||||
$invoicetmpcustomer = new Facture($db);
|
||||
$invoicetmpsupplier = new FactureFournisseur($db);
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$invoicetmp->id = $obj->facid;
|
||||
$invoicetmp->ref = $obj->ref;
|
||||
if ($obj->type == 'bank-transfer') {
|
||||
$invoicetmp = $invoicetmpsupplier;
|
||||
} else {
|
||||
$invoicetmp = $invoicetmpcustomer;
|
||||
}
|
||||
$invoicetmp->fetch($obj->facid);
|
||||
|
||||
$thirdpartytmp->id = $obj->socid;
|
||||
$thirdpartytmp->name = $obj->name;
|
||||
$thirdpartytmp->fetch($obj->socid);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -243,14 +276,15 @@ if ($result)
|
||||
// Status of requests
|
||||
print '<td class="center">';
|
||||
|
||||
if ($obj->statut == 0)
|
||||
{
|
||||
if ($obj->statut == 0) {
|
||||
print '-';
|
||||
} elseif ($obj->statut == 2)
|
||||
{
|
||||
print $langs->trans("StatusCredited");
|
||||
} elseif ($obj->statut == 3)
|
||||
{
|
||||
} elseif ($obj->statut == 2) {
|
||||
if ($obj->type == 'bank-transfer') {
|
||||
print $langs->trans("StatusDebited");
|
||||
} else {
|
||||
print $langs->trans("StatusCredited");
|
||||
}
|
||||
} elseif ($obj->statut == 3) {
|
||||
print '<b>'.$langs->trans("StatusRefused").'</b>';
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user