Merge remote branch 'upstream/develop' into tooltip
Conflicts: htdocs/langs/en_US/sendings.lang
This commit is contained in:
commit
b850b7b448
@ -8,6 +8,9 @@ notifications:
|
|||||||
on_success: never # [always|never|change] default: change
|
on_success: never # [always|never|change] default: change
|
||||||
on_failure: change # [always|never|change] default: always
|
on_failure: change # [always|never|change] default: always
|
||||||
|
|
||||||
|
addons:
|
||||||
|
postgresql: "9.3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- memcached # will start memcached
|
- memcached # will start memcached
|
||||||
|
|
||||||
|
|||||||
60
CONTRIBUTING.md
Normal file
60
CONTRIBUTING.md
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
How to contribute to Dolibarr
|
||||||
|
=============================
|
||||||
|
|
||||||
|
Bug reports and feature requests
|
||||||
|
--------------------------------
|
||||||
|
Issues are tracked at [Doliforge](https://doliforge.org/projects/dolibarr)
|
||||||
|
|
||||||
|
*You need to create an account before being able to use the "Bugs & Tasks" feature.*
|
||||||
|
|
||||||
|
1. Use the search engine to check if nobody's already reported your problem.
|
||||||
|
2. Choose the right section. (Bugs or Task and Feature Request).
|
||||||
|
3. Report with as much detail as possible (Use screenshots or even screencasts whenever possible).
|
||||||
|
|
||||||
|
Code
|
||||||
|
----
|
||||||
|
1. Fork the [GitHub repository](https://github.com/Dolibarr/dolibarr).
|
||||||
|
2. Clone your fork.
|
||||||
|
3. Commit and push your changes.
|
||||||
|
4. Make a pull request.
|
||||||
|
|
||||||
|
### General rules
|
||||||
|
Please don't edit the ChangeLog file. A project manager will update it from your commit messages.
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
Use clear commit messages with the following structure:
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
KEYWORD Short description
|
||||||
|
|
||||||
|
Long description (Can span accross multiple lines).
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Where KEYWORD is one of:
|
||||||
|
|
||||||
|
- void: don't put a keyword if the commit is not introducing feature or closing a bug.
|
||||||
|
- NEW: for new features (May be followed by the task number i.e: #123)
|
||||||
|
- FIXED: for bug fixes (May be followed by the bug number i.e: #456)
|
||||||
|
|
||||||
|
### Resources
|
||||||
|
[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)
|
||||||
|
|
||||||
|
Translations
|
||||||
|
------------
|
||||||
|
en_US and delta languages (i.e: fr_XX) are maintained in the repository. See Code section above.
|
||||||
|
|
||||||
|
All other translations are managed online at [Transifex](https://www.transifex.com/projects/p/dolibarr).
|
||||||
|
|
||||||
|
Join an existing translation team or create your own and translate into the interface.
|
||||||
|
|
||||||
|
Your translations will be available in the next major release.
|
||||||
|
|
||||||
|
### Resources
|
||||||
|
[Translator documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
-------------
|
||||||
|
The project's documentation is maintained on the [Wiki](http://wiki.dolibarr.org/index.php).
|
||||||
|
|
||||||
|
*You need to create an account before being able to edit.*
|
||||||
|
|
||||||
221
README.md
221
README.md
@ -1,151 +1,166 @@
|
|||||||
# DOLIBARR ERP & CRM
|
# DOLIBARR ERP & CRM
|
||||||
|
|
||||||
Dolibarr ERP & CRM is a modern software to manage your company or foundation activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).It's an opensource software (wrote with PHP language) designed for small and medium companies, foundation and freelances. You can freely install, use and distribute it as a standalone application or as a web application to use it from every internet access and media.
|
Dolibarr ERP & CRM is a modern software to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
||||||
|
|
||||||
|
It's an Open Source software (wrote in PHP language) designed for small and medium companies, foundation and freelances.
|
||||||
|
|
||||||
|
You can freely use, study, modify or distribute it according to it's Free Software 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## LICENSE
|
## LICENSE
|
||||||
|
|
||||||
Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (GPL-3+).
|
Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (GPL-3+).
|
||||||
|
|
||||||
|
See the [COPYING](COPYING) file for a full copy of the license.
|
||||||
|
|
||||||
|
Other licenses apply for some included dependencies. See [COPYRIGHT](COPYRIGHT) for a full list.
|
||||||
|
|
||||||
## INSTALL
|
## INSTALLING
|
||||||
|
|
||||||
If you have no technical knowledge, and you are looking for an autoinstaller to install Dolibarr ERP/CRM in few clicks, you must download DoliWamp (the all-in-one package of Dolibarr for Windows), DoliDeb (the all-in-one package of Dolibarr for Debian or Ubuntu) or DoliRpm (the all-in-one package of Dolibarr for Fedora, Redhat, Opensuse, Mandriva or Mageia).
|
### Download
|
||||||
|
|
||||||
You can download this at: [Official website] (<http://www.dolibarr.org/downloads/>)
|
Official releases are available on the [website](http://www.dolibarr.org/downloads).
|
||||||
|
|
||||||
If you already have installed a Web server and a Mysql database, you can install the standard version like this:
|
### Simple setup
|
||||||
|
|
||||||
- Uncompress the downloaded archive.
|
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
|
||||||
|
|
||||||
- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator).
|
- DoliWamp for Windows
|
||||||
|
- DoliDeb for Debian or Ubuntu
|
||||||
|
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
|
||||||
|
|
||||||
- Create an empty file "htdocs/conf/conf.php" and set permissions for your web server user (write permissions will be removed once install is finished).
|
### Advanced setup
|
||||||
|
|
||||||
- From your browser, call the dolibarr "install/" page.
|
You can use a Web server and a supported database (MySQL recommended) to install the standard version.
|
||||||
|
|
||||||
Url depends on choice made on first step:
|
- Uncompress the downloaded archive
|
||||||
|
- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator)
|
||||||
|
- Create an empty file "htdocs/conf/conf.php" and set permissions for your web server user (write permissions will be removed once install is finished)
|
||||||
|
- From your browser, go to the dolibarr "install/" page
|
||||||
|
|
||||||
http://localhost/dolibarr/htdocs/install/
|
The URL will depends on choices made in the first step:
|
||||||
or
|
|
||||||
|
|
||||||
http://localhost/dolibarr/install/
|
http://localhost/dolibarr/htdocs/install/
|
||||||
or
|
|
||||||
|
|
||||||
http://yourdolibarrvirtualhost/install/
|
or
|
||||||
|
|
||||||
- Follow instructions provided by installer...
|
http://localhost/dolibarr/install/
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
http://yourdolibarrvirtualhost/install/
|
||||||
|
|
||||||
## UPGRADE
|
- Follow the installer instructions
|
||||||
|
|
||||||
To upgrade Dolibarr from an old version to this one:
|
## UPGRADING
|
||||||
|
|
||||||
- Overwrite all old files inside old 'dolibarr' directory by files provided into new version package.
|
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||||
|
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process
|
||||||
|
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
|
||||||
|
-
|
||||||
|
*Note: migration process can safely be done multiple times.*
|
||||||
|
|
||||||
- If you came from version x.y.z to x.y.w (only third number differ), there is no need to run any migrate process.
|
## NEWS
|
||||||
|
|
||||||
- If you came from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access).
|
See the [ChangeLog](ChangeLog) file.
|
||||||
|
|
||||||
This URL should looks like:
|
## FEATURES
|
||||||
|
|
||||||
http://localhost/dolibarr/htdocs/install/
|
### General features
|
||||||
or
|
- Users and groups with finely grained rights
|
||||||
|
- Localization in most major languages
|
||||||
|
- Very user friendly and easy to use
|
||||||
|
- 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)
|
||||||
|
- Works with PHP 5.3+ and MySQL 4.1+ or PostgreSQL 8.1. (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite))
|
||||||
|
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
|
||||||
|
- An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture)
|
||||||
|
- Support for country specific features:
|
||||||
|
- Spanish Tax RE and ISPF
|
||||||
|
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||||
|
- Canadian double taxes (federal/province) and other countries using cumulative VAT
|
||||||
|
- Tunisian tax stamp
|
||||||
|
- Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
||||||
|
- ...
|
||||||
|
|
||||||
http://localhost/dolibarr/install/
|
### Main modules
|
||||||
or
|
|
||||||
|
|
||||||
http://yourdolibarrhost/install/
|
- Customers, Prospects and/or Suppliers directory
|
||||||
|
- Products and/or Services catalog
|
||||||
Then choose the "update" option according to your case.
|
- Bank accounts management
|
||||||
Note: Migrate process can be ran safely several times.
|
- Customer and Supplier Orders management
|
||||||
|
- Commercial proposals management
|
||||||
|
- Contracts management
|
||||||
|
- Invoices management
|
||||||
## WHAT'S NEW
|
- Projects management
|
||||||
|
- Events management
|
||||||
See ChangeLog file found into package.
|
- Payments management
|
||||||
|
- Standing orders management
|
||||||
|
- Stock management
|
||||||
|
- Shipping management
|
||||||
## WHAT DOLIBARR CAN DO
|
- Interventions management
|
||||||
|
|
||||||
### Main modules/features:
|
|
||||||
|
|
||||||
- Customers, Prospects or Suppliers directory.
|
|
||||||
- Products and services catalog.
|
|
||||||
- Bank accounts management.
|
|
||||||
- Orders management.
|
|
||||||
- Commercial proposals management.
|
|
||||||
- Contracts management.
|
|
||||||
- Invoices management.
|
|
||||||
- Payments management.
|
|
||||||
- Standing orders management.
|
|
||||||
- Stock management.
|
|
||||||
- Shipping management.
|
|
||||||
- PDF or ODT generation for invoice, proposals, orders...
|
- PDF or ODT generation for invoice, proposals, orders...
|
||||||
- Agenda with ical,vcal export for third tools integration.
|
- Agenda with ical and vcal export for third party tools integration
|
||||||
- EDM (Electronic Document Management).
|
- Electronic Document Management (EDM)
|
||||||
- Foundations members management.
|
- Foundations members management
|
||||||
- Employee's holidays management.
|
- Employee's holidays management
|
||||||
- Mass Emailing.
|
- Mass emailing
|
||||||
- Realize surveys.
|
- Surveys
|
||||||
- Point of Sale.
|
- Point of Sale
|
||||||
|
- …
|
||||||
|
|
||||||
### Other modules:
|
### Other modules
|
||||||
|
|
||||||
- Bookmarks management.
|
- Bookmarks management
|
||||||
- Donations management.
|
- Donations management
|
||||||
- Reporting.
|
- Reporting
|
||||||
- Data export/import.
|
- Data export/import
|
||||||
- Third parties or products categories.
|
- Thirdparties and/or products categories
|
||||||
- LDAP connectivity.
|
- Barcodes support
|
||||||
- ClickToDial integration.
|
- Margin calculations
|
||||||
- RSS integration.
|
- LDAP connectivity
|
||||||
- Can be extended with a lot of other external modules available onto DoliStore.com.
|
- ClickToDial integration
|
||||||
|
- RSS integration
|
||||||
|
- Skype integration
|
||||||
|
- Payment platforms integration (PayBox, PayPal)
|
||||||
|
- …
|
||||||
|
|
||||||
### Miscellaneous:
|
### Extending
|
||||||
|
|
||||||
- Multi-user, with several permissions levels for each feature.
|
Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](http://www.dolistore.com).
|
||||||
- Very user friendly and easy to use.
|
|
||||||
- Highly customizable: Enable only modules you need, 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).
|
|
||||||
- Works with PHP 5.3+, MySql 4.1 or PostgreSQL 8.1.
|
|
||||||
- Require PHP and Mysql or Postgresql (See exatc versions on http://wiki.dolibarr.org/index.php/Prerequisite).
|
|
||||||
- Compatible with all Cloud solutions that match MySql, PHP or PostgreSQL prerequisites.
|
|
||||||
- An easy to understand, maintain and code interfaces with your own system information (PHP with no heavy frameworks, trigger and hook architecture).
|
|
||||||
- Support countries specific features:
|
|
||||||
Spanish Tax RE and ISPF.
|
|
||||||
French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM).
|
|
||||||
Canadian double taxes (federal/province) and other countries using cumulative VAT.
|
|
||||||
Tunisian tax stamp.
|
|
||||||
Compatible with European directives (2006/112/CE ... 2010/45/UE) (http://europa.eu/legislation_summaries/taxation/l31057_en.htm)
|
|
||||||
...
|
|
||||||
|
|
||||||
|
## FUTURE
|
||||||
|
|
||||||
## WHAT DOLIBARR CAN'T DO YET (TODO LIST)
|
These are features that Dolibarr does **not** yet fully support:
|
||||||
|
|
||||||
This is features that Dolibarr does not support completely yet:
|
- Double-entry bookkeeping (only bank and treasury management)
|
||||||
|
- Multiple currencies
|
||||||
|
- Multiple companies
|
||||||
|
If you want to manage several companies or foundations, you must install the software several times (on same server or not) or use the MultiCompany addon module that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas)
|
||||||
|
- Tasks dependencies in projects
|
||||||
|
- Payroll module
|
||||||
|
- Webmail
|
||||||
|
- Dolibarr can't do coffee (yet)
|
||||||
|
|
||||||
- No double party accountancy (only bank and treasury management).
|
## DOCUMENTATION
|
||||||
- Dolibarr manage one currency at once (mono-currency).
|
|
||||||
- Dolibarr manage one master activity (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas).
|
|
||||||
- Tasks on module project can't have dependencies between each other.
|
|
||||||
- Dolibarr does not contains Payroll module.
|
|
||||||
- Dolibarr does not include any Webmail.
|
|
||||||
- Dolibarr can't do coffee (not yet).
|
|
||||||
|
|
||||||
|
Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](http://wiki.dolibarr.org).
|
||||||
|
|
||||||
|
## CREDITS
|
||||||
|
|
||||||
|
Dolibarr is the work of many contributors over the years and uses some fine libraries.
|
||||||
|
|
||||||
|
See [COPYRIGHT](COPYRIGHT) file.
|
||||||
|
|
||||||
## SOCIAL NETWORKS
|
## SOCIAL NETWORKS
|
||||||
|
|
||||||
Follow Dolibarr project on
|
Follow Dolibarr project on:
|
||||||
|
|
||||||
Facebook: <https://www.facebook.com/dolibarr>
|
|
||||||
|
|
||||||
Google+: <https://plus.google.com/+DolibarrOrg>
|
|
||||||
|
|
||||||
Twitter: <http://www.twitter.com/dolibarr>
|
|
||||||
|
|
||||||
|
- [Facebook](https://www.facebook.com/dolibarr)
|
||||||
|
- [Google+](https://plus.google.com/+DolibarrOrg)
|
||||||
|
- [Twitter](http://www.twitter.com/dolibarr)
|
||||||
|
- [LinkedIn](http://https//www.linkedin.com/groups/Dolibarr-ERP-CRM-2743052?gid=2743052)
|
||||||
|
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||||
|
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|||||||
@ -299,3 +299,17 @@ http://packages.qa.debian.org
|
|||||||
|
|
||||||
* Package will be into release when test will be moved as stable.
|
* Package will be into release when test will be moved as stable.
|
||||||
|
|
||||||
|
|
||||||
|
##### Send an unblock request
|
||||||
|
Use this to move from unstable to testing.
|
||||||
|
reportbug -B debian
|
||||||
|
Choose package "release.debian.org"
|
||||||
|
Then "unblock"
|
||||||
|
Then name of package "dolibarr"
|
||||||
|
Fill message, for example:
|
||||||
|
"Please unblock package dolibarr
|
||||||
|
A security error CVE-2014-7137 was reported and is fixed into package 3.5.5.
|
||||||
|
Note that package 3.5.5 was prepared before the CVE was reported and include other fixes, but they are all related to stability or security (other se$
|
||||||
|
After discussion with ..., it appears that security holes are enough to request this unblock request."
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -376,7 +376,7 @@ $cfg['DefaultConnectionCollation'] = 'utf8_unicode_ci';
|
|||||||
// libraries/select_lang.lib.php
|
// libraries/select_lang.lib.php
|
||||||
// $cfg['Lang'] = 'en-iso-8859-1';
|
// $cfg['Lang'] = 'en-iso-8859-1';
|
||||||
|
|
||||||
// Regullar expression to limit listed languages, eg. '^(cs|en)' for Czech and
|
// Regular expression to limit listed languages, eg. '^(cs|en)' for Czech and
|
||||||
// English only
|
// English only
|
||||||
$cfg['FilterLanguages'] = '';
|
$cfg['FilterLanguages'] = '';
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,8 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->rights->propale->valider=1;
|
$user->rights->propal->creer=1;
|
||||||
|
$user->rights->propal->propal_advance->validate=1;
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -44,7 +44,13 @@ $action = GETPOST('action', 'alpha');
|
|||||||
|
|
||||||
// Other parameters ACCOUNTING_*
|
// Other parameters ACCOUNTING_*
|
||||||
$list = array (
|
$list = array (
|
||||||
'ACCOUNTING_SEPARATORCSV'
|
'ACCOUNTING_EXPORT_SEPARATORCSV',
|
||||||
|
'ACCOUNTING_EXPORT_DATE',
|
||||||
|
'ACCOUNTING_EXPORT_PIECE',
|
||||||
|
'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
|
||||||
|
'ACCOUNTING_EXPORT_LABEL',
|
||||||
|
'ACCOUNTING_EXPORT_AMOUNT',
|
||||||
|
'ACCOUNTING_EXPORT_DEVISE'
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -57,7 +63,7 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
if (! empty($modelcsv)) {
|
if (! empty($modelcsv)) {
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -112,12 +118,12 @@ print "<td>" . $langs->trans("Selectmodelcsv") . "</td>";
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print '<select class="flat" name="modelcsv" id="modelcsv">';
|
print '<select class="flat" name="modelcsv" id="modelcsv">';
|
||||||
print '<option value="0"';
|
print '<option value="0"';
|
||||||
if ($conf->global->ACCOUNTING_MODELCSV == 0) {
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 0) {
|
||||||
print ' selected="selected"';
|
print ' selected="selected"';
|
||||||
}
|
}
|
||||||
print '>' . $langs->trans("Modelcsv_normal") . '</option>';
|
print '>' . $langs->trans("Modelcsv_normal") . '</option>';
|
||||||
print '<option value="1"';
|
print '<option value="1"';
|
||||||
if ($conf->global->ACCOUNTING_MODELCSV == 1) {
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
|
||||||
print ' selected="selected"';
|
print ' selected="selected"';
|
||||||
}
|
}
|
||||||
print '>' . $langs->trans("Modelcsv_CEGID") . '</option>';
|
print '>' . $langs->trans("Modelcsv_CEGID") . '</option>';
|
||||||
@ -128,8 +134,7 @@ print "</table>";
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Params
|
* Parameters
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$num = count($list);
|
$num = count($list);
|
||||||
|
|||||||
@ -50,10 +50,10 @@ if ($year == 0) {
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
llxHeader('', $langs->trans("CustomersVentilation"));
|
llxHeader('', $langs->trans("Bookkeeping"));
|
||||||
|
|
||||||
$textprevyear = "<a href=\"balancebymonth.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
|
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||||
$textnextyear = " <a href=\"balancebymonth.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
|
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear);
|
print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear);
|
||||||
|
|
||||||
|
|||||||
@ -151,7 +151,7 @@ else {
|
|||||||
|
|
||||||
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
|
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
|
||||||
|
|
||||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" />';
|
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -56,12 +56,11 @@ $offset = $conf->liste_limit * $page;
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("Bookkeeping"));
|
llxHeader('', $langs->trans("Bookkeeping"));
|
||||||
|
|
||||||
$textprevyear = "<a href=\"listbyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
|
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||||
$textnextyear = " <a href=\"listbyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
|
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mode Liste
|
* Mode List
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal";
|
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal";
|
||||||
|
|||||||
@ -53,7 +53,6 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param DoliDB $db Database handle
|
* @param DoliDB $db Database handle
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
|
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,7 +128,7 @@ class FormVentilation extends Form
|
|||||||
$label = $obj->account_number . ' - ' . $obj->label;
|
$label = $obj->account_number . ' - ' . $obj->label;
|
||||||
|
|
||||||
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number
|
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number
|
||||||
// Bacause same account_number can be share between different accounting_system and do have the same meaning
|
// Because same account_number can be share between different accounting_system and do have the same meaning
|
||||||
if (($selectid != '') && $selectid == $obj->rowid) {
|
if (($selectid != '') && $selectid == $obj->rowid) {
|
||||||
// $out .= '<option value="' . $obj->account_number . '" selected="selected">' . $label . '</option>';
|
// $out .= '<option value="' . $obj->account_number . '" selected="selected">' . $label . '</option>';
|
||||||
$out .= '<option value="' . $obj->rowid . '" selected="selected">' . $label . '</option>';
|
$out .= '<option value="' . $obj->rowid . '" selected="selected">' . $label . '</option>';
|
||||||
|
|||||||
@ -45,8 +45,7 @@ if ($user->societe_id > 0)
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
|
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
|
||||||
{
|
|
||||||
if (! GETPOST('cancel', 'alpha'))
|
if (! GETPOST('cancel', 'alpha'))
|
||||||
{
|
{
|
||||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/customer/index.php
|
* \file htdocs/accountancy/customer/index.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Page accueil clients ventilation comptable
|
* \brief Home customer ventilation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@ -76,6 +76,8 @@ if ($action == 'validatehistory') {
|
|||||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
|
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
@ -93,7 +95,7 @@ if ($action == 'validatehistory') {
|
|||||||
llxHeader('', $langs->trans("CustomersVentilation"));
|
llxHeader('', $langs->trans("CustomersVentilation"));
|
||||||
|
|
||||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
||||||
|
|
||||||
@ -105,6 +107,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
|||||||
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
||||||
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
|
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
|
||||||
|
|
||||||
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$row = $db->fetch_row($result);
|
$row = $db->fetch_row($result);
|
||||||
@ -160,6 +163,7 @@ if (! empty($conf->multicompany->enabled)) {
|
|||||||
|
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation";
|
$sql .= " GROUP BY fd.fk_code_ventilation";
|
||||||
|
|
||||||
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -194,7 +198,7 @@ print "</table>\n";
|
|||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
|
||||||
@ -232,6 +236,7 @@ if (! empty($conf->multicompany->enabled)) {
|
|||||||
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -304,6 +309,7 @@ if (! empty($conf->margin->enabled)) {
|
|||||||
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
|||||||
}
|
}
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
dol_syslog("/accountancy/customer/linges.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("/accountancy/customer/lines.php sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num_lines = $db->num_rows($result);
|
$num_lines = $db->num_rows($result);
|
||||||
@ -220,5 +220,5 @@ if ($result) {
|
|||||||
|
|
||||||
print "</table></form>";
|
print "</table></form>";
|
||||||
|
|
||||||
$db->close();
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -52,9 +52,25 @@ $formventilation = new FormVentilation($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("Ventilation"));
|
llxHeader('', $langs->trans("Ventilation"));
|
||||||
|
|
||||||
|
print '<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
$(\'#select-all\').click(function(event) {
|
||||||
|
// Iterate each checkbox
|
||||||
|
$(\':checkbox\').each(function() {
|
||||||
|
this.checked = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(\'#unselect-all\').click(function(event) {
|
||||||
|
// Iterate each checkbox
|
||||||
|
$(\':checkbox\').each(function() {
|
||||||
|
this.checked = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'ventil') {
|
if ($action == 'ventil') {
|
||||||
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||||
@ -113,8 +129,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac
|
|||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||||
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
|
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
|
||||||
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
|
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
|
||||||
if (! empty($conf->multicompany->enabled)) {
|
if (! empty($conf->multicompany->enabled)) {
|
||||||
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
||||||
}
|
}
|
||||||
@ -147,7 +163,7 @@ if ($result) {
|
|||||||
print '<td align="right">' . $langs->trans("Amount") . '</td>';
|
print '<td align="right">' . $langs->trans("Amount") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("AccountAccounting") . '</td>';
|
print '<td align="right">' . $langs->trans("AccountAccounting") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
|
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
|
print '<td align="center">' . $langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>'.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$facture_static = new Facture($db);
|
$facture_static = new Facture($db);
|
||||||
|
|||||||
@ -450,14 +450,14 @@ if ($action == 'writeBookKeeping')
|
|||||||
// export csv
|
// export csv
|
||||||
if ($action == 'export_csv')
|
if ($action == 'export_csv')
|
||||||
{
|
{
|
||||||
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
header('Content-Type: text/csv');
|
||||||
header('Content-Disposition: attachment;filename=journal_banque.csv');
|
header('Content-Disposition: attachment;filename=journal_banque.csv');
|
||||||
|
|
||||||
$companystatic = new Client($db);
|
$companystatic = new Client($db);
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
|
||||||
{
|
{
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||||
|
|||||||
@ -367,12 +367,12 @@ if ($action == 'writeBookKeeping')
|
|||||||
}
|
}
|
||||||
// export csv
|
// export csv
|
||||||
if ($action == 'export_csv') {
|
if ($action == 'export_csv') {
|
||||||
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
header('Content-Type: text/csv');
|
||||||
header('Content-Disposition:attachment;filename=journal_caisse.csv');
|
header('Content-Disposition:attachment;filename=journal_caisse.csv');
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
|
||||||
{
|
{
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||||
|
|||||||
@ -185,8 +185,8 @@ if ($action == 'writebookkeeping') {
|
|||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
// get compte id and label
|
// get compte id and label
|
||||||
$compte = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
if ($compte->fetch(null, $k)) {
|
if ($accountingaccount->fetch(null, $k)) {
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
$bookkeeping->doc_ref = $val["ref"];
|
$bookkeeping->doc_ref = $val["ref"];
|
||||||
@ -195,7 +195,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
|
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
|
||||||
$bookkeeping->code_tiers = '';
|
$bookkeeping->code_tiers = '';
|
||||||
$bookkeeping->label_compte = dol_trunc($val["description"], 128);
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||||
@ -213,7 +213,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
// get compte id and label
|
// get compte id and label
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
$bookkeeping->doc_ref = $val["ref"];
|
$bookkeeping->doc_ref = $val["ref"];
|
||||||
@ -246,12 +245,12 @@ $companystatic = new Fournisseur($db);
|
|||||||
// export csv
|
// export csv
|
||||||
if ($action == 'export_csv')
|
if ($action == 'export_csv')
|
||||||
{
|
{
|
||||||
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
header('Content-Type: text/csv');
|
||||||
header('Content-Disposition: attachment;filename=journal_achats.csv');
|
header('Content-Disposition: attachment;filename=journal_achats.csv');
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
|
||||||
{
|
{
|
||||||
foreach ( $tabfac as $key => $val ) {
|
foreach ( $tabfac as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||||
@ -314,11 +313,13 @@ if ($action == 'export_csv')
|
|||||||
|
|
||||||
// Product / Service
|
// Product / Service
|
||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch(null, $k);
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
print '"' . $date . '"' . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
print '"' . $val["ref"] . '"' . $sep;
|
print '"' . $val["ref"] . '"' . $sep;
|
||||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||||
print '"' . dol_trunc($val["description"], 32) . '"' . $sep;
|
print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -417,12 +418,15 @@ if ($action == 'export_csv')
|
|||||||
|
|
||||||
// Product / Service
|
// Product / Service
|
||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch(null, $k);
|
||||||
|
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
print "<tr " . $bc[$var] . " >";
|
print "<tr " . $bc[$var] . " >";
|
||||||
print "<td>" . $date . "</td>";
|
print "<td>" . $date . "</td>";
|
||||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||||
print "<td>" . length_accountg($k) . "</td>";
|
print "<td>" . length_accountg($k) . "</td>";
|
||||||
print "<td>" . $invoicestatic->description . "</td>";
|
print "<td>" . $accountingaccount->label . "</td>";
|
||||||
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||||
print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|||||||
@ -151,7 +151,7 @@ if ($result) {
|
|||||||
$tabfac[$obj->rowid]["date"] = $obj->df;
|
$tabfac[$obj->rowid]["date"] = $obj->df;
|
||||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
||||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||||
$tabfac[$obj->rowid]["description"] = $obj->description;
|
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
|
||||||
$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
|
$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
|
||||||
if (! isset($tabttc[$obj->rowid][$compta_soc]))
|
if (! isset($tabttc[$obj->rowid][$compta_soc]))
|
||||||
$tabttc[$obj->rowid][$compta_soc] = 0;
|
$tabttc[$obj->rowid][$compta_soc] = 0;
|
||||||
@ -207,8 +207,8 @@ if ($action == 'writebookkeeping') {
|
|||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
// get compte id and label
|
// get compte id and label
|
||||||
$compte = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
if ($compte->fetch(null, $k)) {
|
if ($accountingaccount->fetch(null, $k)) {
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
$bookkeeping->doc_ref = $val["ref"];
|
$bookkeeping->doc_ref = $val["ref"];
|
||||||
@ -218,7 +218,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
||||||
$bookkeeping->code_tiers = '';
|
$bookkeeping->code_tiers = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = dol_trunc($val["description"], 128);
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
|
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
|
||||||
@ -258,14 +258,14 @@ if ($action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
// export csv
|
// export csv
|
||||||
if ($action == 'export_csv') {
|
if ($action == 'export_csv') {
|
||||||
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
header('Content-Type: text/csv');
|
||||||
header('Content-Disposition: attachment;filename=journal_ventes.csv');
|
header('Content-Disposition: attachment;filename=journal_ventes.csv');
|
||||||
|
|
||||||
$companystatic = new Client($db);
|
$companystatic = new Client($db);
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
|
||||||
{
|
{
|
||||||
foreach ( $tabfac as $key => $val ) {
|
foreach ( $tabfac as $key => $val ) {
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
@ -335,11 +335,14 @@ if ($action == 'export_csv') {
|
|||||||
|
|
||||||
// Product / Service
|
// Product / Service
|
||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch(null, $k);
|
||||||
|
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
print '"' . $date . '"' . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
print '"' . $val["ref"] . '"' . $sep;
|
print '"' . $val["ref"] . '"' . $sep;
|
||||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||||
print '"' . dol_trunc($val["description"], 32) . '"' . $sep;
|
print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -447,12 +450,15 @@ if ($action == 'export_csv') {
|
|||||||
|
|
||||||
// Product / Service
|
// Product / Service
|
||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingaccount->fetch(null, $k);
|
||||||
|
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
print "<tr " . $bc[$var] . ">";
|
print "<tr " . $bc[$var] . ">";
|
||||||
print "<td>" . $date . "</td>";
|
print "<td>" . $date . "</td>";
|
||||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||||
print "<td>" . length_accountg($k) . "</td>";
|
print "<td>" . length_accountg($k) . "</td>";
|
||||||
print "<td>" . $invoicestatic->description . "</td>";
|
print "<td>" . $accountingaccount->label . "</td>";
|
||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
@ -478,8 +484,8 @@ if ($action == 'export_csv') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
// End of page
|
|
||||||
llxFooter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent s<jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/supplier/index.php
|
* \file htdocs/accountancy/supplier/index.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Page accueil ventilation
|
* \brief Home supplier ventilation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@ -93,9 +93,9 @@ if ($action == 'validatehistory') {
|
|||||||
llxHeader('', $langs->trans("SuppliersVentilation"));
|
llxHeader('', $langs->trans("SuppliersVentilation"));
|
||||||
|
|
||||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
||||||
|
|
||||||
print '<b>' . $langs->trans("DescVentilSupplier") . '</b>';
|
print '<b>' . $langs->trans("DescVentilSupplier") . '</b>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>';
|
||||||
@ -105,7 +105,7 @@ $y = $year_current;
|
|||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
|
print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>';
|
||||||
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
|
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
||||||
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
|
||||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
@ -48,6 +46,7 @@ if ($user->societe_id > 0)
|
|||||||
if (! $user->rights->accounting->ventilation->dispatch)
|
if (! $user->rights->accounting->ventilation->dispatch)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
$formventilation = new FormVentilation($db);
|
$formventilation = new FormVentilation($db);
|
||||||
|
|
||||||
$changeaccount = GETPOST('changeaccount');
|
$changeaccount = GETPOST('changeaccount');
|
||||||
@ -107,7 +106,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
|
|||||||
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||||
$sql .= " AND aa.rowid = l.fk_code_ventilation";
|
$sql .= " AND aa.rowid = l.fk_code_ventilation";
|
||||||
if (strlen(trim($_GET["search_facture"]))) {
|
if (strlen(trim($_GET["search_facture"]))) {
|
||||||
$sql .= " AND f.facnumber like '%" . $_GET["search_facture"] . "%'";
|
$sql .= " AND f.ref like '%" . $_GET["search_facture"] . "%'";
|
||||||
}
|
}
|
||||||
if (strlen(trim($_GET["search_ref"]))) {
|
if (strlen(trim($_GET["search_ref"]))) {
|
||||||
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
|
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
|
||||||
@ -218,7 +217,8 @@ if ($result) {
|
|||||||
print $db->error();
|
print $db->error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "</table></form>";
|
print "</table></form>";
|
||||||
|
|
||||||
$db->close();
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -22,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/supplier/list.php
|
* \file htdocs/accountancy/supplier/list.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Page de ventilation des lignes de facture
|
* \brief Ventilation page from suppliers invoices
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@ -53,6 +53,22 @@ $formventilation = new FormVentilation($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("Ventilation"));
|
llxHeader('', $langs->trans("Ventilation"));
|
||||||
|
|
||||||
|
print '<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
$(\'#select-all\').click(function(event) {
|
||||||
|
// Iterate each checkbox
|
||||||
|
$(\':checkbox\').each(function() {
|
||||||
|
this.checked = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(\'#unselect-all\').click(function(event) {
|
||||||
|
// Iterate each checkbox
|
||||||
|
$(\':checkbox\').each(function() {
|
||||||
|
this.checked = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
@ -115,8 +131,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l
|
|||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||||
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
|
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
|
||||||
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
|
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
|
||||||
|
|
||||||
if (! empty($conf->multicompany->enabled)) {
|
if (! empty($conf->multicompany->enabled)) {
|
||||||
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
||||||
@ -150,7 +166,7 @@ if ($result) {
|
|||||||
print '<td align="right">' . $langs->trans("Amount") . '</td>';
|
print '<td align="right">' . $langs->trans("Amount") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("Compte") . '</td>';
|
print '<td align="right">' . $langs->trans("Compte") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
|
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
|
print '<td align="center">' . $langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>'.'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$facturefourn_static = new FactureFournisseur($db);
|
$facturefourn_static = new FactureFournisseur($db);
|
||||||
@ -161,6 +177,23 @@ if ($result) {
|
|||||||
while ( $i < min($num_lines, $limit) ) {
|
while ( $i < min($num_lines, $limit) ) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
|
|
||||||
|
// product_type: 0 = service ? 1 = product
|
||||||
|
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
|
||||||
|
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
|
||||||
|
$code_buy_notset = '';
|
||||||
|
|
||||||
|
if (empty($objp->code_buy)) {
|
||||||
|
$code_buy_notset = 'color:red';
|
||||||
|
if ($objp->type == 1) {
|
||||||
|
$objp->code_buy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
} else {
|
||||||
|
$objp->code_buy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
$code_buy_notset = 'color:blue';
|
||||||
|
}
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
// Ref facture
|
// Ref facture
|
||||||
@ -191,7 +224,7 @@ if ($result) {
|
|||||||
print price($objp->price);
|
print price($objp->price);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="right">';
|
print '<td align="center" style="' . $code_buy_notset . '">';
|
||||||
print $objp->code_buy;
|
print $objp->code_buy;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,10 @@ $head[$h][2] = 'misc';
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
dol_fiche_head($head, 'handler', $langs->trans("Menus"));
|
dol_fiche_head($head, 'handler', $langs->trans("Menus"));
|
||||||
|
|
||||||
print $langs->trans("MenusDesc")."<br>\n";
|
print $langs->trans("MenusDesc")."<br>\n";
|
||||||
@ -160,10 +164,6 @@ print "<br>\n";
|
|||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="update">';
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
// Gestionnaires de menu
|
// Gestionnaires de menu
|
||||||
@ -202,14 +202,6 @@ if ($action == 'edit')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
|
||||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -264,7 +256,21 @@ else
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($action != 'edit')
|
if ($action != 'edit')
|
||||||
{
|
{
|
||||||
|
|||||||
162
htdocs/admin/supplierinvoicedet_extrafields.php
Normal file
162
htdocs/admin/supplierinvoicedet_extrafields.php
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/admin/supplierinvoicedet_extrafields.php
|
||||||
|
* \ingroup fourn
|
||||||
|
* \brief Page to setup extra fields of supplierinvoice line
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
if (!$user->admin)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$langs->load("admin");
|
||||||
|
$langs->load("other");
|
||||||
|
$langs->load("bills");
|
||||||
|
$langs->load("orders");
|
||||||
|
$langs->load("suppliers");
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
// List of supported format
|
||||||
|
$tmptype2label=ExtraFields::$type2label;
|
||||||
|
$type2label=array('');
|
||||||
|
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||||
|
|
||||||
|
$action=GETPOST('action', 'alpha');
|
||||||
|
$attrname=GETPOST('attrname', 'alpha');
|
||||||
|
$elementtype='facture_fourn_det'; //Must be the $table_element of the class that manage extrafield
|
||||||
|
|
||||||
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$textobject=$langs->transnoentitiesnoconv("BillsSuppliers");
|
||||||
|
|
||||||
|
llxHeader('',$langs->trans("SuppliersSetup"));
|
||||||
|
|
||||||
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
|
$head = supplierorder_admin_prepare_head();
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'supplierinvoicedet', $langs->trans("Suppliers"), 0, 'company');
|
||||||
|
|
||||||
|
|
||||||
|
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
// Load attribute_label
|
||||||
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
|
|
||||||
|
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Label").'</td>';
|
||||||
|
print '<td>'.$langs->trans("AttributeCode").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Type").'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Unique").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Required").'</td>';
|
||||||
|
print '<td width="80"> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=True;
|
||||||
|
foreach($extrafields->attribute_type as $key => $value)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
||||||
|
print "<td>".$key."</td>\n";
|
||||||
|
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
||||||
|
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
||||||
|
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
|
||||||
|
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
||||||
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||||
|
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||||
|
print "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
if ($action != 'create' && $action != 'edit')
|
||||||
|
{
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||||
|
print "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Creation d'un champ optionnel */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
if ($action == 'create')
|
||||||
|
{
|
||||||
|
print "<br>";
|
||||||
|
print_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Edition d'un champ optionnel */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
|
{
|
||||||
|
print "<br>";
|
||||||
|
print_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
159
htdocs/admin/supplierorderdet_extrafields.php
Normal file
159
htdocs/admin/supplierorderdet_extrafields.php
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/admin/supplierorder_extrafields.php
|
||||||
|
* \ingroup fourn
|
||||||
|
* \brief Page to setup extra fields of supplierorder line
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
if (!$user->admin)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$langs->load("admin");
|
||||||
|
$langs->load("other");
|
||||||
|
$langs->load("orders");
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
// List of supported format
|
||||||
|
$tmptype2label=ExtraFields::$type2label;
|
||||||
|
$type2label=array('');
|
||||||
|
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||||
|
|
||||||
|
$action=GETPOST('action', 'alpha');
|
||||||
|
$attrname=GETPOST('attrname', 'alpha');
|
||||||
|
$elementtype='commande_fournisseurdet'; //Must be the $table_element of the class that manage extrafield
|
||||||
|
|
||||||
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$textobject=$langs->transnoentitiesnoconv("SuppliersOrders");
|
||||||
|
|
||||||
|
llxHeader('',$langs->trans("SuppliersSetup"));
|
||||||
|
|
||||||
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
|
$head = supplierorder_admin_prepare_head();
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'supplierorderdet', $langs->trans("Suppliers"), 0, 'company');
|
||||||
|
|
||||||
|
|
||||||
|
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
// Load attribute_label
|
||||||
|
$extrafields->fetch_name_optionals_label($elementtype);
|
||||||
|
|
||||||
|
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Label").'</td>';
|
||||||
|
print '<td>'.$langs->trans("AttributeCode").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Type").'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Unique").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Required").'</td>';
|
||||||
|
print '<td width="80"> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=True;
|
||||||
|
foreach($extrafields->attribute_type as $key => $value)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
||||||
|
print "<td>".$key."</td>\n";
|
||||||
|
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
||||||
|
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
||||||
|
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
|
||||||
|
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
||||||
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||||
|
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||||
|
print "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
if ($action != 'create' && $action != 'edit')
|
||||||
|
{
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||||
|
print "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Creation d'un champ optionnel */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
if ($action == 'create')
|
||||||
|
{
|
||||||
|
print "<br>";
|
||||||
|
print_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Edition d'un champ optionnel */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
|
{
|
||||||
|
print "<br>";
|
||||||
|
print_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -14,7 +14,6 @@ support/index.php
|
|||||||
support/online.php
|
support/online.php
|
||||||
|
|
||||||
support/default.css
|
support/default.css
|
||||||
support/dolibarr_logo2.png
|
|
||||||
support/headbg.jpg
|
support/headbg.jpg
|
||||||
support/helpcenter.png
|
support/helpcenter.png
|
||||||
support/internet.png
|
support/internet.png
|
||||||
|
|||||||
@ -289,7 +289,8 @@ if ($socid)
|
|||||||
if ($soc->country)
|
if ($soc->country)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||||
$img=picto_from_langcode($soc->country_code);
|
//$img=picto_from_langcode($soc->country_code);
|
||||||
|
$img='';
|
||||||
print ($img?$img.' ':'');
|
print ($img?$img.' ':'');
|
||||||
print $soc->country;
|
print $soc->country;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -881,15 +881,15 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
|
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
|
||||||
if (GETPOST("afaire") == 1) $form->select_date($object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
|
if (GETPOST("afaire") == 1) $form->select_date($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
|
||||||
else if (GETPOST("afaire") == 2) $form->select_date($object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
else if (GETPOST("afaire") == 2) $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
||||||
else $form->select_date($object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
else $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
||||||
if (GETPOST("afaire") == 1) $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
||||||
else if (GETPOST("afaire") == 2) $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
||||||
else $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
|
|||||||
@ -339,7 +339,7 @@ dol_fiche_end();
|
|||||||
|
|
||||||
$showextcals=$listofextcals;
|
$showextcals=$listofextcals;
|
||||||
// Legend
|
// Legend
|
||||||
if ($conf->use_javascript_ajax)
|
if (! empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
$s='';
|
$s='';
|
||||||
$s.='<script type="text/javascript">' . "\n";
|
$s.='<script type="text/javascript">' . "\n";
|
||||||
@ -349,29 +349,27 @@ if ($conf->use_javascript_ajax)
|
|||||||
$s.='jQuery(".family_birthday").toggle();' . "\n";
|
$s.='jQuery(".family_birthday").toggle();' . "\n";
|
||||||
if ($action=="show_week" || $action=="show_month" || empty($action))
|
if ($action=="show_week" || $action=="show_month" || empty($action))
|
||||||
{
|
{
|
||||||
$s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
$s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable", placeholder: "ui-state-highlight", items: "div.movable", receive: function( event, ui ) {';
|
||||||
$s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
|
$s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
|
||||||
}
|
}
|
||||||
$s.='});' . "\n";
|
$s.='});' . "\n";
|
||||||
$s.='</script>' . "\n";
|
$s.='</script>' . "\n";
|
||||||
if (! empty($conf->use_javascript_ajax))
|
|
||||||
|
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' </div>';
|
||||||
|
if (is_array($showextcals) && count($showextcals) > 0)
|
||||||
{
|
{
|
||||||
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' </div>';
|
foreach ($showextcals as $val)
|
||||||
if (is_array($showextcals) && count($showextcals) > 0)
|
|
||||||
{
|
{
|
||||||
foreach ($showextcals as $val)
|
$htmlname = dol_string_nospecial($val['name']);
|
||||||
{
|
$s.='<script type="text/javascript">' . "\n";
|
||||||
$htmlname = dol_string_nospecial($val['name']);
|
$s.='jQuery(document).ready(function () {' . "\n";
|
||||||
$s.='<script type="text/javascript">' . "\n";
|
$s.=' jQuery("#check_' . $htmlname . '").click(function() {';
|
||||||
$s.='jQuery(document).ready(function () {' . "\n";
|
$s.=' /* alert("'.$htmlname.'"); */';
|
||||||
$s.=' jQuery("#check_' . $htmlname . '").click(function() {';
|
$s.=' jQuery(".family_' . $htmlname . '").toggle();';
|
||||||
$s.=' /* alert("'.$htmlname.'"); */';
|
$s.=' });' . "\n";
|
||||||
$s.=' jQuery(".family_' . $htmlname . '").toggle();';
|
$s.='});' . "\n";
|
||||||
$s.=' });' . "\n";
|
$s.='</script>' . "\n";
|
||||||
$s.='});' . "\n";
|
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' </div>';
|
||||||
$s.='</script>' . "\n";
|
|
||||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' </div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' </div>';
|
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' </div>';
|
||||||
@ -1092,11 +1090,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
global $theme_datacolor;
|
global $theme_datacolor;
|
||||||
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
|
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
|
||||||
|
|
||||||
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n";
|
print "\n".'<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">';
|
||||||
|
|
||||||
// Line with title of day
|
// Line with title of day
|
||||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
print '<table class="nobordernopadding" width="100%">'."\n";
|
||||||
|
|
||||||
print '<tr><td align="left" class="nowrap">';
|
print '<tr><td align="left" class="nowrap">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?';
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?';
|
||||||
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
||||||
@ -1116,7 +1115,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print img_picto($langs->trans("NewAction"),'edit_add.png');
|
print img_picto($langs->trans("NewAction"),'edit_add.png');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Line with td contains all div of each events
|
// Line with td contains all div of each events
|
||||||
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="sortable" style="padding-bottom: 2px;">';
|
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="sortable" style="padding-bottom: 2px;">';
|
||||||
@ -1171,11 +1170,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$numicals[dol_string_nospecial($event->icalname)]++;
|
$numicals[dol_string_nospecial($event->icalname)]++;
|
||||||
}
|
}
|
||||||
$color=$event->icalcolor;
|
$color=$event->icalcolor;
|
||||||
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
|
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unmovable');
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'BIRTHDAY')
|
else if ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
$numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1213,32 +1212,35 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
|
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
|
||||||
|
|
||||||
// Defined style to disable drag and drop feature
|
// Defined style to disable drag and drop feature
|
||||||
if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
|
if ($event->type_code =='AC_OTH_AUTO')
|
||||||
|
{
|
||||||
|
$cssclass.= " unmovable";
|
||||||
|
}
|
||||||
|
else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
|
||||||
{
|
{
|
||||||
$tmpyearend = date('Y',$event->date_end_in_calendar);
|
$tmpyearend = date('Y',$event->date_end_in_calendar);
|
||||||
$tmpmonthend = date('m',$event->date_end_in_calendar);
|
$tmpmonthend = date('m',$event->date_end_in_calendar);
|
||||||
$tmpdayend = date('d',$event->date_end_in_calendar);
|
$tmpdayend = date('d',$event->date_end_in_calendar);
|
||||||
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
|
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
|
||||||
{
|
{
|
||||||
$cssclass.= " unsortable";
|
$cssclass.= " unmovable";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($event->type_code =='AC_OTH_AUTO')
|
else $cssclass.= " movable";
|
||||||
{
|
|
||||||
$cssclass.= " unsortable";
|
|
||||||
}
|
|
||||||
|
|
||||||
$h=''; $nowrapontd=1;
|
$h=''; $nowrapontd=1;
|
||||||
if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; }
|
if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; }
|
||||||
if ($action == 'show_week') { $h='height: 100%; '; $nowrapontd=0; }
|
if ($action == 'show_week') { $h='height: 100%; '; $nowrapontd=0; }
|
||||||
|
|
||||||
// Show rect of event
|
// Show rect of event
|
||||||
print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"';
|
print "\n";
|
||||||
|
print '<!-- start event '.$i.' --><div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"';
|
||||||
//print ' style="height: 100px;';
|
//print ' style="height: 100px;';
|
||||||
//print ' position: absolute; top: 40px; width: 50%;';
|
//print ' position: absolute; top: 40px; width: 50%;';
|
||||||
//print '"';
|
//print '"';
|
||||||
print '>';
|
print '>';
|
||||||
print '<ul class="cal_event" style="'.$h.'"><li class="cal_event" style="'.$h.'">';
|
print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event
|
||||||
|
print '<li class="cal_event" style="'.$h.'">';
|
||||||
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
|
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
|
||||||
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
||||||
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
||||||
@ -1369,8 +1371,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1);
|
if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1);
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</li></ul>';
|
print '</li>';
|
||||||
print '</div>';
|
print '</ul>';
|
||||||
|
print '</div><!-- end event '.$i.' -->'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1413,8 +1416,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
|
||||||
print '</div>'."\n";
|
print '</table></div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -265,7 +265,8 @@ if ($id > 0)
|
|||||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||||
if (! empty($object->country_code))
|
if (! empty($object->country_code))
|
||||||
{
|
{
|
||||||
$img=picto_from_langcode($object->country_code);
|
//$img=picto_from_langcode($object->country_code);
|
||||||
|
$img='';
|
||||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||||
else print ($img?$img.' ':'').$object->country;
|
else print ($img?$img.' ':'').$object->country;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,6 +100,7 @@ $hookmanager->initHooks(array('propalcard','globalcard'));
|
|||||||
|
|
||||||
$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -172,7 +173,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider)
|
else if ($action == 'confirm_validate' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$result = $object->valid($user);
|
$result = $object->valid($user);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
@ -1385,8 +1389,8 @@ if ($action == 'create')
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled) && $socid > 0) {
|
if (! empty($conf->projet->enabled) && $socid > 0)
|
||||||
|
{
|
||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
$projectid = 0;
|
$projectid = 0;
|
||||||
@ -1394,9 +1398,9 @@ if ($action == 'create')
|
|||||||
$projectid = ($originid ? $originid : 0);
|
$projectid = ($originid ? $originid : 0);
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top">' . $langs->trans("Project") . '</td><td colspan="2">';
|
print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
|
||||||
|
|
||||||
$numprojet = $formproject->select_projects($soc->id, $projectid);
|
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||||
if ($numprojet == 0) {
|
if ($numprojet == 0) {
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print ' <a href="../projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
|
print ' <a href="../projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
|
||||||
@ -1680,7 +1684,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td>' . $langs->trans('Company') . '</td><td colspan="5">' . $soc->getNomUrl(1) . '</td>';
|
print '<tr><td>' . $langs->trans('Company') . '</td><td colspan="5">' . $soc->getNomUrl(1) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Ligne info remises tiers
|
// Lin for thirdparty discounts
|
||||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="5">';
|
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="5">';
|
||||||
if ($soc->remise_percent)
|
if ($soc->remise_percent)
|
||||||
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
||||||
@ -1877,20 +1881,22 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled)) {
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $langs->trans('Project') . '</td>';
|
print $langs->trans('Project') . '</td>';
|
||||||
if ($user->rights->propal->creer) {
|
if ($user->rights->propal->creer)
|
||||||
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a></td>';
|
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid');
|
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0);
|
||||||
} else {
|
} else {
|
||||||
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none');
|
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
} else {
|
} else {
|
||||||
@ -1899,7 +1905,7 @@ if ($action == 'create')
|
|||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
print '<a href="../projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
print $proj->ref;
|
print $proj->ref;
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2082,19 +2088,21 @@ if ($action == 'create')
|
|||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook))
|
||||||
if ($action != 'statut' && $action != 'editline') {
|
{
|
||||||
|
if ($action != 'statut' && $action != 'editline')
|
||||||
|
{
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) {
|
if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
|
||||||
|
) {
|
||||||
if (count($object->lines) > 0)
|
if (count($object->lines) > 0)
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate">' . $langs->trans('Validate') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate">' . $langs->trans('Validate') . '</a></div>';
|
||||||
// else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
|
// else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
|
||||||
}
|
}
|
||||||
// Create event
|
// Create event
|
||||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
|
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||||
// "workflow" action so should appears somewhere
|
|
||||||
// else on
|
|
||||||
// page.
|
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
|
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1334,7 +1334,8 @@ class Propal extends CommonObject
|
|||||||
$error=0;
|
$error=0;
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
if ($user->rights->propale->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -1443,7 +1444,7 @@ class Propal extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
|
||||||
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
||||||
@ -1472,7 +1473,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function set_echeance($user, $date_fin_validite)
|
function set_echeance($user, $date_fin_validite)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite!=''?"'".$this->db->idate($date_fin_validite)."'":'null');
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite!=''?"'".$this->db->idate($date_fin_validite)."'":'null');
|
||||||
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
||||||
@ -1498,7 +1499,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function set_date_livraison($user, $date_livraison)
|
function set_date_livraison($user, $date_livraison)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
||||||
$sql.= " SET date_livraison = ".($date_livraison!=''?"'".$this->db->idate($date_livraison)."'":'null');
|
$sql.= " SET date_livraison = ".($date_livraison!=''?"'".$this->db->idate($date_livraison)."'":'null');
|
||||||
@ -1527,7 +1528,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function set_availability($user, $id)
|
function set_availability($user, $id)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
||||||
$sql.= " SET fk_availability = '".$id."'";
|
$sql.= " SET fk_availability = '".$id."'";
|
||||||
@ -1556,7 +1557,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function set_demand_reason($user, $id)
|
function set_demand_reason($user, $id)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
||||||
$sql.= " SET fk_input_reason = '".$id."'";
|
$sql.= " SET fk_input_reason = '".$id."'";
|
||||||
@ -1585,7 +1586,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function set_ref_client($user, $ref_client)
|
function set_ref_client($user, $ref_client)
|
||||||
{
|
{
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
|
dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
|
||||||
|
|
||||||
@ -1620,7 +1621,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$remise=trim($remise)?trim($remise):0;
|
$remise=trim($remise)?trim($remise):0;
|
||||||
|
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$remise = price2num($remise);
|
$remise = price2num($remise);
|
||||||
|
|
||||||
@ -1653,7 +1654,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$remise=trim($remise)?trim($remise):0;
|
$remise=trim($remise)?trim($remise):0;
|
||||||
|
|
||||||
if ($user->rights->propale->creer)
|
if (! empty($user->rights->propal->creer))
|
||||||
{
|
{
|
||||||
$remise = price2num($remise);
|
$remise = price2num($remise);
|
||||||
|
|
||||||
|
|||||||
@ -883,7 +883,11 @@ if (empty($reshook))
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->commande->valider) {
|
else if ($action == 'confirm_validate' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
|
||||||
|
)
|
||||||
|
{
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
$qualified_for_stock_change=0;
|
$qualified_for_stock_change=0;
|
||||||
@ -987,7 +991,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider) {
|
else if ($action == 'confirm_cancel' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
|
||||||
|
)
|
||||||
|
{
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
$qualified_for_stock_change=0;
|
$qualified_for_stock_change=0;
|
||||||
@ -1413,11 +1421,12 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled) && $socid > 0) {
|
if (! empty($conf->projet->enabled) && $socid > 0)
|
||||||
|
{
|
||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
||||||
$numprojet = $formproject->select_projects($soc->id, $projectid);
|
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||||
if ($numprojet == 0) {
|
if ($numprojet == 0) {
|
||||||
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
|
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
|
||||||
}
|
}
|
||||||
@ -1966,9 +1975,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
// print "$object->id, $object->socid, $object->fk_project";
|
// print "$object->id, $object->socid, $object->fk_project";
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid');
|
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0);
|
||||||
} else {
|
} else {
|
||||||
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none');
|
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -2121,7 +2130,11 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
// modified by hook
|
// modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Valid
|
// Valid
|
||||||
if ($object->statut == 0 && $object->total_ttc >= 0 && $numlines > 0 && $user->rights->commande->valider) {
|
if ($object->statut == 0 && $object->total_ttc >= 0 && $numlines > 0 &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
|
||||||
|
)
|
||||||
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate">' . $langs->trans('Validate') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate">' . $langs->trans('Validate') . '</a></div>';
|
||||||
}
|
}
|
||||||
// Edit
|
// Edit
|
||||||
|
|||||||
@ -205,7 +205,8 @@ class Commande extends CommonOrder
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $user->rights->commande->valider)
|
if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))))
|
||||||
{
|
{
|
||||||
$this->error='Permission denied';
|
$this->error='Permission denied';
|
||||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||||
@ -361,7 +362,8 @@ class Commande extends CommonOrder
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $user->rights->commande->valider)
|
if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))))
|
||||||
{
|
{
|
||||||
$this->error='Permission denied';
|
$this->error='Permission denied';
|
||||||
return -1;
|
return -1;
|
||||||
@ -494,7 +496,8 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
if ($user->rights->commande->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -363,7 +363,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Classify to validated
|
// Classify to validated
|
||||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->valider)
|
else if ($action == 'confirm_valid' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
@ -436,7 +439,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Go back to draft status (unvalidate)
|
// Go back to draft status (unvalidate)
|
||||||
else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
|
else if ($action == 'confirm_modif' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
@ -2252,7 +2258,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
||||||
$formproject->select_projects($soc->id, $projectid, 'projectid');
|
$formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3346,9 +3352,9 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
$form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid');
|
$form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0);
|
||||||
} else {
|
} else {
|
||||||
$form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'none');
|
$form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -3480,7 +3486,9 @@ if ($action == 'create')
|
|||||||
|
|
||||||
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) {
|
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) {
|
||||||
if (! $objectidnext && $object->is_last_in_cycle()) {
|
if (! $objectidnext && $object->is_last_in_cycle()) {
|
||||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate) {
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->invoice_advance->unvalidate)))
|
||||||
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans('Modify') . '</span></div>';
|
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans('Modify') . '</span></div>';
|
||||||
@ -3510,7 +3518,9 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (! empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) {
|
if ($object->statut == 0 && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (! empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) {
|
||||||
if ($user->rights->facture->valider) {
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
|
||||||
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=valid">' . $langs->trans('Validate') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=valid">' . $langs->trans('Validate') . '</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1691,7 +1691,8 @@ class Facture extends CommonInvoice
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $user->rights->facture->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
|
||||||
{
|
{
|
||||||
$this->error='Permission denied';
|
$this->error='Permission denied';
|
||||||
dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR);
|
||||||
|
|||||||
@ -3145,10 +3145,11 @@ class Form
|
|||||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* @param int $selected Id pre-selected project
|
* @param int $selected Id pre-selected project
|
||||||
* @param string $htmlname Name of select field
|
* @param string $htmlname Name of select field
|
||||||
* @param int $discard_closed Hide all closed projects
|
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
|
||||||
|
* @param int $maxlength Max length
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
|
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -3165,7 +3166,7 @@ class Form
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
$formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
|
$formproject->select_projects($socid,$selected,$htmlname,$maxlength,0,1,$discard_closed);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
print '</tr></table></form>';
|
print '</tr></table></form>';
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a combo list with projects qualified for a third party
|
* Output a combo list with projects qualified for a third party
|
||||||
*
|
*
|
||||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* @param int $selected Id project preselected
|
* @param int $selected Id project preselected
|
||||||
@ -51,10 +51,10 @@ class FormProjets
|
|||||||
* @param int $maxlength Maximum length of label
|
* @param int $maxlength Maximum length of label
|
||||||
* @param int $option_only Return only html options lines without the select tag
|
* @param int $option_only Return only html options lines without the select tag
|
||||||
* @param int $show_empty Add an empty line
|
* @param int $show_empty Add an empty line
|
||||||
* @param int $discard_closed Discard closed projects
|
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
|
||||||
* @return int Nber of project if OK, <0 if KO
|
* @return int Nber of project if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
|
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs;
|
global $user,$conf,$langs;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($discard_closed && $obj->fk_statut == 2)
|
if ($discard_closed == 1 && $obj->fk_statut == 2)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
continue;
|
continue;
|
||||||
@ -114,30 +114,31 @@ class FormProjets
|
|||||||
$labeltoshow=dol_trunc($obj->ref,18);
|
$labeltoshow=dol_trunc($obj->ref,18);
|
||||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
||||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||||
|
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
|
||||||
|
|
||||||
|
$disabled=0;
|
||||||
|
if ($obj->fk_statut == 0)
|
||||||
|
{
|
||||||
|
$disabled=1;
|
||||||
|
$labeltoshow.=' - '.$langs->trans("Draft");
|
||||||
|
}
|
||||||
|
else if ($obj->fk_statut == 2)
|
||||||
|
{
|
||||||
|
if ($discard_close == 2) $disabled=1;
|
||||||
|
$labeltoshow.=' - '.$langs->trans("Closed");
|
||||||
|
}
|
||||||
|
else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
|
||||||
|
{
|
||||||
|
$disabled=1;
|
||||||
|
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
|
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
|
||||||
{
|
{
|
||||||
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.' '.dol_trunc($obj->title,$maxlength).'</option>';
|
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$disabled=0;
|
|
||||||
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
|
|
||||||
if ($obj->fk_statut == 0)
|
|
||||||
{
|
|
||||||
$disabled=1;
|
|
||||||
$labeltoshow.=' - '.$langs->trans("Draft");
|
|
||||||
}
|
|
||||||
else if ($obj->fk_statut == 2)
|
|
||||||
{
|
|
||||||
$disabled=1;
|
|
||||||
$labeltoshow.=' - '.$langs->trans("Closed");
|
|
||||||
}
|
|
||||||
else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
|
|
||||||
{
|
|
||||||
$disabled=1;
|
|
||||||
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($hideunselectables && $disabled)
|
if ($hideunselectables && $disabled)
|
||||||
{
|
{
|
||||||
$resultat='';
|
$resultat='';
|
||||||
@ -163,6 +164,12 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
print $out;
|
print $out;
|
||||||
|
|
||||||
|
// Use select2 selector
|
||||||
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return $num;
|
return $num;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $langs->trans("Project").' ';
|
print $langs->trans("Project").' ';
|
||||||
print '</td><td class="nowrap maxwidthonsmartphone">';
|
print '</td><td class="nowrap maxwidthonsmartphone">';
|
||||||
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 64);
|
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -186,11 +186,23 @@ function supplierorder_admin_prepare_head()
|
|||||||
$head[$h][2] = 'supplierorder';
|
$head[$h][2] = 'supplierorder';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierorderdet_extrafields.php';
|
||||||
|
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||||
|
$head[$h][2] = 'supplierorderdet';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoices");
|
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoices");
|
||||||
$head[$h][2] = 'supplierinvoice';
|
$head[$h][2] = 'supplierinvoice';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_extrafields.php';
|
||||||
|
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||||
|
$head[$h][2] = 'supplierinvoicedet';
|
||||||
|
$h++;
|
||||||
|
|
||||||
complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin','remove');
|
complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin','remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
|
|||||||
@ -488,13 +488,15 @@ function dolEscapeXML($string)
|
|||||||
*
|
*
|
||||||
* @param string $stringtoescape String to escape
|
* @param string $stringtoescape String to escape
|
||||||
* @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
|
* @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
|
||||||
|
* @param string $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
|
||||||
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
|
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
|
||||||
*/
|
*/
|
||||||
function dol_escape_js($stringtoescape, $mode=0)
|
function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
|
||||||
{
|
{
|
||||||
// escape quotes and backslashes, newlines, etc.
|
// escape quotes and backslashes, newlines, etc.
|
||||||
$substitjs=array("'"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n');
|
$substitjs=array("'"=>"\\'","\r"=>'\\r');
|
||||||
//$substitjs['</']='<\/'; // We removed this. Should be useless.
|
//$substitjs['</']='<\/'; // We removed this. Should be useless.
|
||||||
|
if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
|
||||||
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
|
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
|
||||||
else if ($mode == 1) $substitjs["'"]="\\'";
|
else if ($mode == 1) $substitjs["'"]="\\'";
|
||||||
else if ($mode == 2) { $substitjs['"']='\\"'; }
|
else if ($mode == 2) { $substitjs['"']='\\"'; }
|
||||||
@ -1119,7 +1121,7 @@ function dol_getdate($timestamp,$fast=false)
|
|||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
|
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
|
||||||
* @param int $check 0=No check on parameters (Can use day 32, etc...)
|
* @param int $check 0=No check on parameters (Can use day 32, etc...)
|
||||||
* @return timestamp|string Date as a timestamp, '' if error
|
* @return timestamp|string Date as a timestamp, '' or false if error
|
||||||
* @see dol_print_date, dol_stringtotime, dol_getdate
|
* @see dol_print_date, dol_stringtotime, dol_getdate
|
||||||
*/
|
*/
|
||||||
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||||
@ -3515,7 +3517,7 @@ function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
|
|||||||
// we use the buyer VAT.
|
// we use the buyer VAT.
|
||||||
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC))
|
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC))
|
||||||
{
|
{
|
||||||
if (! $seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
|
if ($seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
|
||||||
{
|
{
|
||||||
//print 'VATRULE 0';
|
//print 'VATRULE 0';
|
||||||
return get_product_vat_for_country($idprod,$thirdparty_buyer,$idprodfournprice);
|
return get_product_vat_for_country($idprod,$thirdparty_buyer,$idprodfournprice);
|
||||||
|
|||||||
@ -64,8 +64,12 @@ function shipping_prepare_head($object)
|
|||||||
$head[$h][2] = 'contact';
|
$head[$h][2] = 'contact';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$nbNote = 0;
|
||||||
|
if (!empty($object->note_private)) $nbNote++;
|
||||||
|
if (!empty($object->note_public)) $nbNote++;
|
||||||
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
|
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
|
||||||
$head[$h][1] = $langs->trans("Notes");
|
$head[$h][1] = $langs->trans("Notes");
|
||||||
|
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
|
||||||
$head[$h][2] = 'note';
|
$head[$h][2] = 'note';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
|
|||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->fournisseur->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax|salaries', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read', '', 2, 50, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax|salaries', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read', '', 2, 50, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
|
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
|
||||||
@ -53,8 +53,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__);
|
||||||
|
-- Home - Module Tools
|
||||||
|
-- Added by ???
|
||||||
-- Home - Menu users and groups
|
-- Home - Menu users and groups
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&action=create', 'NewUser', 2, 'users', '$user->rights->user->user->creer || $user->admin', '', 2, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&action=create', 'NewUser', 2, 'users', '$user->rights->user->user->creer || $user->admin', '', 2, 0, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/index.php?leftmenu=users', 'Groups', 1, 'users', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin', '', 2, 1, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/index.php?leftmenu=users', 'Groups', 1, 'users', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin', '', 2, 1, __ENTITY__);
|
||||||
|
|||||||
@ -149,7 +149,7 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
|
|||||||
if ($showmode == 1)
|
if ($showmode == 1)
|
||||||
{
|
{
|
||||||
print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
|
print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
|
||||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
|
print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
|
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
|
||||||
print '<span class="mainmenuaspan">';
|
print '<span class="mainmenuaspan">';
|
||||||
|
|||||||
@ -557,13 +557,18 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
|
|
||||||
// Date Expedition
|
// Date Expedition
|
||||||
$Yoff = $Yoff+7;
|
$Yoff = $Yoff+7;
|
||||||
$pdf->SetXY($blSocX-80,$blSocY+20);
|
$pdf->SetXY($blSocX-80,$blSocY+17);
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
|
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
|
||||||
|
|
||||||
|
$pdf->SetXY($blSocX-80,$blSocY+20);
|
||||||
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L');
|
||||||
|
|
||||||
// Deliverer
|
// Deliverer
|
||||||
$pdf->SetXY($blSocX-80,$blSocY+23);
|
$pdf->SetXY($blSocX-80,$blSocY+24);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
@ -577,13 +582,8 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
// Get code using getLabelFromKey
|
// Get code using getLabelFromKey
|
||||||
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
|
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
|
||||||
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
||||||
|
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$label=$outputlangs->transnoentities("Deliverer");
|
|
||||||
}
|
|
||||||
|
|
||||||
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -191,11 +191,17 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
if (! empty($object->note_public) || (! empty($object->tracking_number) && ! empty($object->shipping_method_id)))
|
if (! empty($object->note_public) || ! empty($object->tracking_number))
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top = 88;
|
||||||
$tab_top_alt = $tab_top;
|
$tab_top_alt = $tab_top;
|
||||||
|
|
||||||
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
|
$tab_top_alt = $pdf->GetY();
|
||||||
|
//$tab_top_alt += 1;
|
||||||
|
|
||||||
// Tracking number
|
// Tracking number
|
||||||
if (! empty($object->tracking_number))
|
if (! empty($object->tracking_number))
|
||||||
{
|
{
|
||||||
@ -209,14 +215,14 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
||||||
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, 7, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
$tab_top_alt += 7;
|
$tab_top_alt = $pdf->GetY();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche notes
|
// Notes
|
||||||
if (! empty($object->note_public))
|
if (! empty($object->note_public))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
@ -19,14 +19,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file accountingex/core/modules/modAccounting.class.php
|
* \file htdocs/core/modules/modAccounting.class.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Module to activate Accounting Expert module
|
* \brief Module to activate Accounting Expert module
|
||||||
*/
|
*/
|
||||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class modAccountingExpert
|
* \class modAccounting
|
||||||
* \brief Description and activation class for module accounting expert
|
* \brief Description and activation class for module accounting expert
|
||||||
*/
|
*/
|
||||||
class modAccounting extends DolibarrModules
|
class modAccounting extends DolibarrModules
|
||||||
@ -68,7 +68,7 @@ class modAccounting extends DolibarrModules
|
|||||||
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
|
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
|
||||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||||
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
|
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
|
||||||
$this->phpmin = array(5, 2); // Minimum version of PHP required by module
|
$this->phpmin = array(5, 3); // Minimum version of PHP required by module
|
||||||
$this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module
|
$this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module
|
||||||
$this->langfiles = array("accountancy");
|
$this->langfiles = array("accountancy");
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class modAccounting extends DolibarrModules
|
|||||||
"With this constants on, bank account number is always required"
|
"With this constants on, bank account number is always required"
|
||||||
);
|
);
|
||||||
$this->const[1] = array(
|
$this->const[1] = array(
|
||||||
"ACCOUNTING_SEPARATORCSV",
|
"ACCOUNTING_EXPORT_SEPARATORCSV",
|
||||||
"string",
|
"string",
|
||||||
","
|
","
|
||||||
);
|
);
|
||||||
@ -112,60 +112,85 @@ class modAccounting extends DolibarrModules
|
|||||||
"SOC"
|
"SOC"
|
||||||
);
|
);
|
||||||
$this->const[6] = array(
|
$this->const[6] = array(
|
||||||
"ACCOUNTING_CASH_JOURNAL",
|
|
||||||
"chaine",
|
|
||||||
"CAI"
|
|
||||||
);
|
|
||||||
$this->const[7] = array(
|
|
||||||
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
|
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"OD"
|
"OD"
|
||||||
);
|
);
|
||||||
$this->const[8] = array(
|
$this->const[7] = array(
|
||||||
"ACCOUNTING_BANK_JOURNAL",
|
|
||||||
"chaine",
|
|
||||||
"BQ"
|
|
||||||
); // Deprecated Move into llx_bank_account
|
|
||||||
$this->const[9] = array(
|
|
||||||
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
|
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
|
||||||
"chaine",
|
"chaine",
|
||||||
"58"
|
"58"
|
||||||
);
|
);
|
||||||
$this->const[10] = array(
|
$this->const[8] = array(
|
||||||
"CHARTOFACCOUNTS",
|
"CHARTOFACCOUNTS",
|
||||||
"chaine",
|
"chaine",
|
||||||
"2"
|
"2"
|
||||||
);
|
);
|
||||||
$this->const[11] = array(
|
$this->const[9] = array(
|
||||||
"ACCOUNTING_MODELCSV",
|
"ACCOUNTING_EXPORT_MODELCSV",
|
||||||
"chaine",
|
"chaine",
|
||||||
"0"
|
"0"
|
||||||
);
|
);
|
||||||
$this->const[12] = array(
|
$this->const[10] = array(
|
||||||
"ACCOUNTING_LENGTH_GACCOUNT",
|
"ACCOUNTING_LENGTH_GACCOUNT",
|
||||||
"chaine",
|
"chaine",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
$this->const[13] = array(
|
$this->const[11] = array(
|
||||||
"ACCOUNTING_LENGTH_AACCOUNT",
|
"ACCOUNTING_LENGTH_AACCOUNT",
|
||||||
"chaine",
|
"chaine",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
$this->const[14] = array(
|
$this->const[12] = array(
|
||||||
"ACCOUNTING_LIMIT_LIST_VENTILATION",
|
"ACCOUNTING_LIMIT_LIST_VENTILATION",
|
||||||
"chaine",
|
"chaine",
|
||||||
"50"
|
"50"
|
||||||
);
|
);
|
||||||
$this->const[15] = array(
|
$this->const[13] = array(
|
||||||
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
|
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
|
||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
);
|
);
|
||||||
$this->const[16] = array(
|
$this->const[14] = array(
|
||||||
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
|
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
|
||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
);
|
);
|
||||||
|
$this->const[15] = array (
|
||||||
|
"ACCOUNTING_GROUPBYACCOUNT",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
$this->const[16] = array (
|
||||||
|
"ACCOUNTING_EXPORT_DATE",
|
||||||
|
"chaine",
|
||||||
|
"%d%m%Y"
|
||||||
|
);
|
||||||
|
$this->const[17] = array (
|
||||||
|
"ACCOUNTING_EXPORT_PIECE",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
$this->const[18] = array (
|
||||||
|
"ACCOUNTING_EXPORT_GLOBAL_ACCOUNT",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
$this->const[19] = array (
|
||||||
|
"ACCOUNTING_EXPORT_LABEL",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
$this->const[20] = array (
|
||||||
|
"ACCOUNTING_EXPORT_AMOUNT",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
$this->const[21] = array (
|
||||||
|
"ACCOUNTING_EXPORT_DEVISE",
|
||||||
|
"yesno",
|
||||||
|
"1"
|
||||||
|
);
|
||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
$this->tabs = array();
|
$this->tabs = array();
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
|
|||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||||
$this->description = "Gestion des adhérents d'une association";
|
$this->description = "Management of members of a foundation or association";
|
||||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
$this->special = 0;
|
$this->special = 0;
|
||||||
@ -137,7 +137,7 @@ class modAdherent extends DolibarrModules
|
|||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 75;
|
$this->rights[$r][0] = 75;
|
||||||
$this->rights[$r][1] = 'Setup types and attributes of members';
|
$this->rights[$r][1] = 'Setup types of membership';
|
||||||
$this->rights[$r][2] = 'w';
|
$this->rights[$r][2] = 'w';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'configurer';
|
$this->rights[$r][4] = 'configurer';
|
||||||
|
|||||||
@ -128,7 +128,8 @@ class modCommande extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider les commandes clients';
|
$this->rights[$r][1] = 'Valider les commandes clients';
|
||||||
$this->rights[$r][2] = 'd';
|
$this->rights[$r][2] = 'd';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'valider';
|
$this->rights[$r][4] = 'order_advance';
|
||||||
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 86;
|
$this->rights[$r][0] = 86;
|
||||||
|
|||||||
@ -151,7 +151,8 @@ class modExpedition extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider les expeditions';
|
$this->rights[$r][1] = 'Valider les expeditions';
|
||||||
$this->rights[$r][2] = 'd';
|
$this->rights[$r][2] = 'd';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'valider';
|
$this->rights[$r][4] = 'shipping_advance';
|
||||||
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 105; // id de la permission
|
$this->rights[$r][0] = 105; // id de la permission
|
||||||
@ -197,8 +198,8 @@ class modExpedition extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider les bons de livraison';
|
$this->rights[$r][1] = 'Valider les bons de livraison';
|
||||||
$this->rights[$r][2] = 'd';
|
$this->rights[$r][2] = 'd';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'livraison';
|
$this->rights[$r][4] = 'livraison_advance';
|
||||||
$this->rights[$r][5] = 'valider';
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 1109;
|
$this->rights[$r][0] = 1109;
|
||||||
|
|||||||
@ -137,7 +137,8 @@ class modFacture extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider les factures';
|
$this->rights[$r][1] = 'Valider les factures';
|
||||||
$this->rights[$r][2] = 'a';
|
$this->rights[$r][2] = 'a';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'valider';
|
$this->rights[$r][4] = 'invoice_advance';
|
||||||
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 15;
|
$this->rights[$r][0] = 15;
|
||||||
|
|||||||
@ -150,8 +150,8 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider une commande fournisseur';
|
$this->rights[$r][1] = 'Valider une commande fournisseur';
|
||||||
$this->rights[$r][2] = 'w';
|
$this->rights[$r][2] = 'w';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'commande';
|
$this->rights[$r][4] = 'supplier_order_advance';
|
||||||
$this->rights[$r][5] = 'valider';
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 1185;
|
$this->rights[$r][0] = 1185;
|
||||||
@ -206,8 +206,8 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider une facture fournisseur';
|
$this->rights[$r][1] = 'Valider une facture fournisseur';
|
||||||
$this->rights[$r][2] = 'w';
|
$this->rights[$r][2] = 'w';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'facture';
|
$this->rights[$r][4] = 'supplier_invoice_advance';
|
||||||
$this->rights[$r][5] = 'valider';
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 1234;
|
$this->rights[$r][0] = 1234;
|
||||||
|
|||||||
@ -130,7 +130,8 @@ class modPropale extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Valider les propositions commerciales'; // libelle de la permission
|
$this->rights[$r][1] = 'Valider les propositions commerciales'; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'valider';
|
$this->rights[$r][4] = 'propal_advance';
|
||||||
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 25; // id de la permission
|
$this->rights[$r][0] = 25; // id de la permission
|
||||||
|
|||||||
@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/modules_commandefo
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class mod_commande_fournisseur_orchidee
|
* Classe du modele de numerotation de reference de commande fournisseur Orchidee
|
||||||
\brief Classe du modele de numerotation de reference de commande fournisseur Orchidee
|
*/
|
||||||
*/
|
|
||||||
class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
||||||
{
|
{
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||||
|
|||||||
@ -256,7 +256,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider)
|
else if ($action == 'confirm_valid' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
@ -304,7 +307,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'reopen' && $user->rights->expedition->valider)
|
else if ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate)))
|
||||||
{
|
{
|
||||||
$result = $object->setStatut(0);
|
$result = $object->setStatut(0);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1354,7 +1357,8 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
if ($object->statut == 0 && $num_prod > 0)
|
if ($object->statut == 0 && $num_prod > 0)
|
||||||
{
|
{
|
||||||
if ($user->rights->expedition->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||||
}
|
}
|
||||||
@ -1365,7 +1369,7 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO add alternative status
|
// TODO add alternative status
|
||||||
/* if ($object->statut == 1 && $user->rights->expedition->valider)
|
/* if ($object->statut == 1 && $user->rights->expedition->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
@ -530,7 +530,8 @@ class Expedition extends CommonObject
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $user->rights->expedition->valider)
|
if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate))))
|
||||||
{
|
{
|
||||||
$this->error='Permission denied';
|
$this->error='Permission denied';
|
||||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||||
@ -1524,7 +1525,7 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get tracking url status
|
* Forge an set tracking url
|
||||||
*
|
*
|
||||||
* @param string $value Value
|
* @param string $value Value
|
||||||
* @return void
|
* @return void
|
||||||
|
|||||||
@ -157,6 +157,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
$colwidth=20;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -167,7 +167,8 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||||
$img=picto_from_langcode($object->country_code);
|
//$img=picto_from_langcode($object->country_code);
|
||||||
|
$img='';
|
||||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||||
else print ($img?$img.' ':'').$object->country;
|
else print ($img?$img.' ':'').$object->country;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -334,7 +334,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::valid");
|
dol_syslog(get_class($this)."::valid");
|
||||||
$result = 0;
|
$result = 0;
|
||||||
if ($user->rights->fournisseur->commande->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -601,7 +602,6 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error = $obj->error;
|
$this->error = $obj->error;
|
||||||
dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,13 +130,13 @@ if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// mode de reglement
|
// mode de reglement
|
||||||
else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// bank account
|
// bank account
|
||||||
else if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
||||||
}
|
}
|
||||||
@ -154,17 +154,17 @@ if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->cree
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set project
|
// Set project
|
||||||
else if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$object->setProject($projectid);
|
$object->setProject($projectid);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$result = $object->set_remise($user, $_POST['remise_percent']);
|
$result = $object->set_remise($user, $_POST['remise_percent']);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
|
if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
|
||||||
{
|
{
|
||||||
if (in_array($object->statut, array(1, 2, 5, 6, 7, 9)))
|
if (in_array($object->statut, array(1, 2, 5, 6, 7, 9)))
|
||||||
{
|
{
|
||||||
@ -191,7 +191,7 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
|
|||||||
/*
|
/*
|
||||||
* Add a line into product
|
* Add a line into product
|
||||||
*/
|
*/
|
||||||
else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -402,7 +402,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
/*
|
/*
|
||||||
* Mise a jour d'une ligne dans la commande
|
* Mise a jour d'une ligne dans la commande
|
||||||
*/
|
*/
|
||||||
else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel'))
|
if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel'))
|
||||||
{
|
{
|
||||||
if ($_POST["elrowid"])
|
if ($_POST["elrowid"])
|
||||||
{
|
{
|
||||||
@ -473,7 +473,7 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
|
|
||||||
$result = $object->deleteline(GETPOST('lineid'));
|
$result = $object->deleteline(GETPOST('lineid'));
|
||||||
@ -506,7 +506,10 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider)
|
if ($action == 'confirm_valid' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$object->date_commande=dol_now();
|
$object->date_commande=dol_now();
|
||||||
$result = $object->valid($user);
|
$result = $object->valid($user);
|
||||||
@ -542,7 +545,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
|
if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
|
||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse', 'int');
|
$idwarehouse=GETPOST('idwarehouse', 'int');
|
||||||
|
|
||||||
@ -593,7 +596,7 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
|
if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
|
||||||
{
|
{
|
||||||
$result = $object->refuse($user);
|
$result = $object->refuse($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -607,7 +610,7 @@ else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->four
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
||||||
{
|
{
|
||||||
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -625,7 +628,7 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer)
|
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer)
|
||||||
{
|
{
|
||||||
$result=$object->delete($user);
|
$result=$object->delete($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -640,7 +643,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->four
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Action clone object
|
// Action clone object
|
||||||
else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
|
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
|
||||||
{
|
{
|
||||||
@ -666,7 +669,7 @@ else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fourn
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Receive
|
// Receive
|
||||||
else if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner)
|
if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($_POST["type"])
|
if ($_POST["type"])
|
||||||
@ -695,7 +698,7 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
||||||
{
|
{
|
||||||
$result = $object->cancel($user);
|
$result = $object->cancel($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -710,7 +713,7 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->four
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Line ordering
|
// Line ordering
|
||||||
else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'up' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$object->line_up($_GET['rowid']);
|
$object->line_up($_GET['rowid']);
|
||||||
|
|
||||||
@ -726,7 +729,7 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
|
|||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'down' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$object->line_down($_GET['rowid']);
|
$object->line_down($_GET['rowid']);
|
||||||
|
|
||||||
@ -743,7 +746,7 @@ else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post
|
if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post
|
||||||
{
|
{
|
||||||
// Build document
|
// Build document
|
||||||
|
|
||||||
@ -765,7 +768,7 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) /
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete file in doc form
|
// Delete file in doc form
|
||||||
else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer)
|
if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
@ -776,7 +779,7 @@ else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisse
|
|||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
@ -818,7 +821,7 @@ elseif ($action == 'update_extras')
|
|||||||
/*
|
/*
|
||||||
* Create an order
|
* Create an order
|
||||||
*/
|
*/
|
||||||
else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'add' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@ -1364,17 +1367,24 @@ elseif (! empty($object->id))
|
|||||||
if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($object->thirdparty);
|
if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($object->thirdparty);
|
||||||
else $newref = $object->ref;
|
else $newref = $object->ref;
|
||||||
|
|
||||||
$text=$langs->trans('ConfirmValidateOrder',$newref);
|
if ($newref < 0)
|
||||||
if (! empty($conf->notification->enabled))
|
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$notify=new Notify($db);
|
$action='';
|
||||||
$text.='<br>';
|
|
||||||
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text=$langs->trans('ConfirmValidateOrder',$newref);
|
||||||
|
if (! empty($conf->notification->enabled))
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||||
|
$notify=new Notify($db);
|
||||||
|
$text.='<br>';
|
||||||
|
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
|
||||||
|
}
|
||||||
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1605,11 +1615,11 @@ elseif (! empty($object->id))
|
|||||||
//print "$object->id, $object->socid, $object->fk_project";
|
//print "$object->id, $object->socid, $object->fk_project";
|
||||||
if ($action == 'classify')
|
if ($action == 'classify')
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid');
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid', 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none');
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -2212,7 +2222,8 @@ elseif (! empty($object->id))
|
|||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && $num > 0)
|
if ($object->statut == 0 && $num > 0)
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->commande->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"';
|
||||||
print '>'.$langs->trans('Validate').'</a>';
|
print '>'.$langs->trans('Validate').'</a>';
|
||||||
|
|||||||
@ -120,7 +120,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider)
|
elseif ($action == 'confirm_valid' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse');
|
$idwarehouse=GETPOST('idwarehouse');
|
||||||
|
|
||||||
@ -1393,12 +1396,13 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled)) {
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
||||||
$formproject->select_projects($soc->id, $projectid, 'projectid');
|
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1'), $projectid, 'projectid', 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1937,11 +1941,11 @@ else
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'classify')
|
if ($action == 'classify')
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid');
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid', 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none');
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -2255,7 +2259,8 @@ else
|
|||||||
{
|
{
|
||||||
if (count($object->lines))
|
if (count($object->lines))
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->facture->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"';
|
||||||
print '>'.$langs->trans('Validate').'</a>';
|
print '>'.$langs->trans('Validate').'</a>';
|
||||||
|
|||||||
@ -83,7 +83,10 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider)
|
if ($action == 'confirm_valide' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -312,7 +315,8 @@ if ($result > 0)
|
|||||||
{
|
{
|
||||||
if ($user->societe_id == 0 && $object->statut == 0 && $action == '')
|
if ($user->societe_id == 0 && $object->statut == 0 && $action == '')
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->facture->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=valide">'.$langs->trans('Valid').'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=valide">'.$langs->trans('Valid').'</a>';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -454,7 +454,7 @@ else
|
|||||||
if ($allowupgrade)
|
if ($allowupgrade)
|
||||||
{
|
{
|
||||||
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
|
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
|
||||||
$choice .= '<a class="button" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&selectlang='.$setuplang.'&versionfrom='.$versionfrom.'&versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
|
$choice .= '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&selectlang='.$setuplang.'&versionfrom='.$versionfrom.'&versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -523,6 +523,10 @@ $("div#AShowChoices a").click(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".runupgrade").click(function() {
|
||||||
|
return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
|
||||||
|
});
|
||||||
|
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
pFooter(true); // Never display next button
|
pFooter(true); // Never display next button
|
||||||
|
|||||||
@ -106,15 +106,20 @@ UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_AC
|
|||||||
UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT';
|
UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT';
|
||||||
|
|
||||||
-- Compatibility with module Accounting Expert
|
-- Compatibility with module Accounting Expert
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DATE' WHERE name = 'ACCOUNTINGEX_EXP_DATE';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_PIECE' WHERE name = 'ACCOUNTINGEX_EXP_PIECE';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT' WHERE name = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_LABEL' WHERE name = 'ACCOUNTINGEX_EXP_LABEL';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_AMOUNT' WHERE name = 'ACCOUNTINGEX_EXP_AMOUNT';
|
||||||
|
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DEVISE' WHERE name = 'ACCOUNTINGEX_EXP_DEVISE';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE';
|
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL';
|
UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL';
|
UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL';
|
UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_CASH_JOURNAL' WHERE name = 'ACCOUNTINGEX_CASH_JOURNAL';
|
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL';
|
UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH';
|
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
|
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT';
|
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT';
|
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT';
|
||||||
UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION';
|
UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION';
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
ALTER TABLE llx_commande_fournisseurdet_extrafields ADD INDEX idx_commande_fournisseurdet_extrafields (fk_object);
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
-- ===================================================================
|
||||||
|
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
-- Copyright (C) 2013 Florian HENRY <florian.henry@open-concept.pro>
|
||||||
|
-- Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ===================================================================
|
||||||
|
|
||||||
|
create table llx_commande_fournisseurdet_extrafields
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
tms timestamp,
|
||||||
|
fk_object integer NOT NULL,
|
||||||
|
import_key varchar(14)
|
||||||
|
) ENGINE=innodb;
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
-- ===================================================================
|
||||||
|
-- Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ===================================================================
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_facture_fourn_det_extrafields ADD INDEX idx_facture_fourn_det_extrafields (fk_object);
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
-- ========================================================================
|
||||||
|
-- Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ========================================================================
|
||||||
|
|
||||||
|
create table llx_facture_fourn_det_extrafields
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
tms timestamp,
|
||||||
|
fk_object integer NOT NULL,
|
||||||
|
import_key varchar(14) -- import key
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
@ -574,7 +574,7 @@ Permission67=Export interventions
|
|||||||
Permission71=Read members
|
Permission71=Read members
|
||||||
Permission72=Create/modify members
|
Permission72=Create/modify members
|
||||||
Permission74=Delete members
|
Permission74=Delete members
|
||||||
Permission75=Setup types and attributes for members
|
Permission75=Setup types of membership
|
||||||
Permission76=Export datas
|
Permission76=Export datas
|
||||||
Permission78=Read subscriptions
|
Permission78=Read subscriptions
|
||||||
Permission79=Create/modify subscriptions
|
Permission79=Create/modify subscriptions
|
||||||
@ -597,8 +597,8 @@ Permission106=Export sendings
|
|||||||
Permission109=Delete sendings
|
Permission109=Delete sendings
|
||||||
Permission111=Read financial accounts
|
Permission111=Read financial accounts
|
||||||
Permission112=Create/modify/delete and compare transactions
|
Permission112=Create/modify/delete and compare transactions
|
||||||
Permission113=Setup financiel accounts (create, manage categories)
|
Permission113=Setup financial accounts (create, manage categories)
|
||||||
Permission114=Consolidate transactions
|
Permission114=Reconciliate transactions
|
||||||
Permission115=Export transactions and account statements
|
Permission115=Export transactions and account statements
|
||||||
Permission116=Transfers between accounts
|
Permission116=Transfers between accounts
|
||||||
Permission117=Manage cheques dispatching
|
Permission117=Manage cheques dispatching
|
||||||
@ -1059,7 +1059,7 @@ BrowserIsOK=You are using the web browser %s. This browser is ok for security an
|
|||||||
BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari.
|
BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari.
|
||||||
XDebugInstalled=XDebug is loaded.
|
XDebugInstalled=XDebug is loaded.
|
||||||
XCacheInstalled=XCache is loaded.
|
XCacheInstalled=XCache is loaded.
|
||||||
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink
|
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink. Third parties will appears with name "CC12345 - SC45678 - The big company coorp", instead of "The big company coorp".
|
||||||
FieldEdition=Edition of field %s
|
FieldEdition=Edition of field %s
|
||||||
FixTZ=TimeZone fix
|
FixTZ=TimeZone fix
|
||||||
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
|
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
|
||||||
@ -1405,9 +1405,9 @@ FixedEmailTarget=Fixed email target
|
|||||||
SendingsSetup=Sending module setup
|
SendingsSetup=Sending module setup
|
||||||
SendingsReceiptModel=Sending receipt model
|
SendingsReceiptModel=Sending receipt model
|
||||||
SendingsNumberingModules=Sendings numbering modules
|
SendingsNumberingModules=Sendings numbering modules
|
||||||
SendingsAbility=Support sendings sheets for customer deliveries
|
SendingsAbility=Support shipment sheets for customer deliveries
|
||||||
NoNeedForDeliveryReceipts=In most cases, sendings receipts are used both as sheets for customer deliveries (list of products to send) and sheets that is recevied and signed by customer. So product deliveries receipts is a duplicated feature and is rarely activated.
|
NoNeedForDeliveryReceipts=In most cases, sendings receipts are used both as sheets for customer deliveries (list of products to send) and sheets that is recevied and signed by customer. So product deliveries receipts is a duplicated feature and is rarely activated.
|
||||||
FreeLegalTextOnShippings=Free text on shippings
|
FreeLegalTextOnShippings=Free text on shipments
|
||||||
##### Deliveries #####
|
##### Deliveries #####
|
||||||
DeliveryOrderNumberingModules=Products deliveries receipt numbering module
|
DeliveryOrderNumberingModules=Products deliveries receipt numbering module
|
||||||
DeliveryOrderModel=Products deliveries receipt model
|
DeliveryOrderModel=Products deliveries receipt model
|
||||||
|
|||||||
@ -58,8 +58,8 @@ OrderSentByEMail=Customer order %s sent by EMail
|
|||||||
InvoiceSentByEMail=Customer invoice %s sent by EMail
|
InvoiceSentByEMail=Customer invoice %s sent by EMail
|
||||||
SupplierOrderSentByEMail=Supplier order %s sent by EMail
|
SupplierOrderSentByEMail=Supplier order %s sent by EMail
|
||||||
SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail
|
SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail
|
||||||
ShippingSentByEMail=Shipping %s sent by EMail
|
ShippingSentByEMail=Shipment %s sent by EMail
|
||||||
ShippingValidated= Shipping %s validated
|
ShippingValidated= Shipment %s validated
|
||||||
NewCompanyToDolibarr= Third party created
|
NewCompanyToDolibarr= Third party created
|
||||||
DateActionPlannedStart= Planned start date
|
DateActionPlannedStart= Planned start date
|
||||||
DateActionPlannedEnd= Planned end date
|
DateActionPlannedEnd= Planned end date
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
# Dolibarr language file - Source file is en_US - bills
|
# Dolibarr language file - Source file is en_US - bills
|
||||||
Bill=Invoice
|
Bill=Invoice
|
||||||
Bills=Invoices
|
Bills=Invoices
|
||||||
BillsCustomers=Customer's invoices
|
BillsCustomers=Customers invoices
|
||||||
BillsCustomer=Customer's invoice
|
BillsCustomer=Customers invoice
|
||||||
BillsSuppliers=Supplier's invoices
|
BillsSuppliers=Suppliers invoices
|
||||||
BillsCustomersUnpaid=Unpaid customer's invoices
|
BillsCustomersUnpaid=Unpaid customers invoices
|
||||||
BillsCustomersUnpaidForCompany=Unpaid customer's invoices for %s
|
BillsCustomersUnpaidForCompany=Unpaid customer's invoices for %s
|
||||||
BillsSuppliersUnpaid=Unpaid supplier's invoices
|
BillsSuppliersUnpaid=Unpaid supplier's invoices
|
||||||
BillsSuppliersUnpaidForCompany=Unpaid supplier's invoices for %s
|
BillsSuppliersUnpaidForCompany=Unpaid supplier's invoices for %s
|
||||||
BillsLate=Late payments
|
BillsLate=Late payments
|
||||||
BillsStatistics=Customer's invoices statistics
|
BillsStatistics=Customers invoices statistics
|
||||||
BillsStatisticsSuppliers=Supplier's invoices statistics
|
BillsStatisticsSuppliers=Suppliers invoices statistics
|
||||||
DisabledBecauseNotErasable=Disabled because can not be erased
|
DisabledBecauseNotErasable=Disabled because can not be erased
|
||||||
InvoiceStandard=Standard invoice
|
InvoiceStandard=Standard invoice
|
||||||
InvoiceStandardAsk=Standard invoice
|
InvoiceStandardAsk=Standard invoice
|
||||||
|
|||||||
@ -155,6 +155,7 @@ MigrationFinished=Migration finished
|
|||||||
LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others.
|
LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others.
|
||||||
ActivateModule=Activate module %s
|
ActivateModule=Activate module %s
|
||||||
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode)
|
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode)
|
||||||
|
WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process...
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# upgrade
|
# upgrade
|
||||||
|
|||||||
@ -16,13 +16,13 @@ SupplierOrder=Supplier order
|
|||||||
SuppliersOrders=Suppliers orders
|
SuppliersOrders=Suppliers orders
|
||||||
SuppliersOrdersRunning=Current suppliers orders
|
SuppliersOrdersRunning=Current suppliers orders
|
||||||
CustomerOrder=Customer order
|
CustomerOrder=Customer order
|
||||||
CustomersOrders=Customer's orders
|
CustomersOrders=Customers orders
|
||||||
CustomersOrdersRunning=Current customer's orders
|
CustomersOrdersRunning=Current customer's orders
|
||||||
CustomersOrdersAndOrdersLines=Customer orders and order's lines
|
CustomersOrdersAndOrdersLines=Customer orders and order's lines
|
||||||
OrdersToValid=Customer's orders to validate
|
OrdersToValid=Customers orders to validate
|
||||||
OrdersToBill=Customer's orders delivered
|
OrdersToBill=Customers orders delivered
|
||||||
OrdersInProcess=Customer's orders in process
|
OrdersInProcess=Customers orders in process
|
||||||
OrdersToProcess=Customer's orders to process
|
OrdersToProcess=Customers orders to process
|
||||||
SuppliersOrdersToProcess=Supplier's orders to process
|
SuppliersOrdersToProcess=Supplier's orders to process
|
||||||
StatusOrderCanceledShort=Canceled
|
StatusOrderCanceledShort=Canceled
|
||||||
StatusOrderDraftShort=Draft
|
StatusOrderDraftShort=Draft
|
||||||
|
|||||||
@ -5,7 +5,7 @@ Sendings=Shipments
|
|||||||
Shipment=Shipment
|
Shipment=Shipment
|
||||||
Shipments=Shipments
|
Shipments=Shipments
|
||||||
ShowSending=Show Sending
|
ShowSending=Show Sending
|
||||||
Receivings=Receivings
|
Receivings=Receipts
|
||||||
SendingsArea=Shipments area
|
SendingsArea=Shipments area
|
||||||
ListOfSendings=List of shipments
|
ListOfSendings=List of shipments
|
||||||
SendingMethod=Shipping method
|
SendingMethod=Shipping method
|
||||||
@ -15,7 +15,7 @@ SearchASending=Search for shipment
|
|||||||
StatisticsOfSendings=Statistics for shipments
|
StatisticsOfSendings=Statistics for shipments
|
||||||
NbOfSendings=Number of shipments
|
NbOfSendings=Number of shipments
|
||||||
NumberOfShipmentsByMonth=Number of shipments by month
|
NumberOfShipmentsByMonth=Number of shipments by month
|
||||||
SendingCard=Shipping card
|
SendingCard=Shipment card
|
||||||
NewSending=New shipment
|
NewSending=New shipment
|
||||||
CreateASending=Create a shipment
|
CreateASending=Create a shipment
|
||||||
CreateSending=Create shipment
|
CreateSending=Create shipment
|
||||||
@ -38,7 +38,7 @@ StatusSendingCanceledShort=Canceled
|
|||||||
StatusSendingDraftShort=Draft
|
StatusSendingDraftShort=Draft
|
||||||
StatusSendingValidatedShort=Validated
|
StatusSendingValidatedShort=Validated
|
||||||
StatusSendingProcessedShort=Processed
|
StatusSendingProcessedShort=Processed
|
||||||
SendingSheet=Sending sheet
|
SendingSheet=Shipment sheet
|
||||||
Carriers=Carriers
|
Carriers=Carriers
|
||||||
Carrier=Carrier
|
Carrier=Carrier
|
||||||
CarriersArea=Carriers area
|
CarriersArea=Carriers area
|
||||||
@ -59,7 +59,7 @@ SendShippingRef=Submission of shipment %s
|
|||||||
ActionsOnShipping=Events on shipment
|
ActionsOnShipping=Events on shipment
|
||||||
LinkToTrackYourPackage=Link to track your package
|
LinkToTrackYourPackage=Link to track your package
|
||||||
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
|
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
|
||||||
RelatedShippings=Related shippings
|
RelatedShippings=Related shipments
|
||||||
ShipmentLine=Shipment line
|
ShipmentLine=Shipment line
|
||||||
CarrierList=List of transporters
|
CarrierList=List of transporters
|
||||||
SendingRunning=Product from customer order already sent
|
SendingRunning=Product from customer order already sent
|
||||||
|
|||||||
@ -116,7 +116,7 @@ MassMovement=Mass movement
|
|||||||
MassStockMovement=Mass stock movement
|
MassStockMovement=Mass stock movement
|
||||||
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s".
|
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s".
|
||||||
RecordMovement=Record transfert
|
RecordMovement=Record transfert
|
||||||
ReceivingForSameOrder=Receivings for this order
|
ReceivingForSameOrder=Receipts for this order
|
||||||
StockMovementRecorded=Stock movements recorded
|
StockMovementRecorded=Stock movements recorded
|
||||||
RuleForStockAvailability=Rules on stock requirements
|
RuleForStockAvailability=Rules on stock requirements
|
||||||
StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice
|
StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice
|
||||||
|
|||||||
@ -119,7 +119,10 @@ if ($action == 'add')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->livraison->valider)
|
else if ($action == 'confirm_valid' && $confirm == 'yes' &&
|
||||||
|
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison_advance->validate)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$result = $object->valid($user);
|
$result = $object->valid($user);
|
||||||
|
|
||||||
|
|||||||
@ -341,7 +341,8 @@ class Livraison extends CommonObject
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if ($user->rights->expedition->livraison->valider)
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison->creer))
|
||||||
|
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison_advance->validate)))
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->LIVRAISON_ADDON_NUMBER))
|
if (! empty($conf->global->LIVRAISON_ADDON_NUMBER))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -441,7 +441,16 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
// Real stock
|
// Real stock
|
||||||
$product->load_stock();
|
$product->load_stock();
|
||||||
print '<tr><td>'.$langs->trans("PhysicalStock").'</td>';
|
$text_stock_options = '';
|
||||||
|
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'<br>':'');
|
||||||
|
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
|
||||||
|
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
|
||||||
|
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'<br>':'');
|
||||||
|
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
|
||||||
|
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
|
||||||
|
print '<tr><td>';
|
||||||
|
print $form->textwithtooltip($langs->trans("PhysicalStock"),$text_stock_options,2,1,img_picto('', 'info'),'',0);
|
||||||
|
print '</td>';
|
||||||
print '<td>'.$product->stock_reel;
|
print '<td>'.$product->stock_reel;
|
||||||
if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));
|
if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -457,14 +466,7 @@ if ($id > 0 || $ref)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
$text_stock_options = '';
|
print $langs->trans("StockDiffPhysicTeoric");
|
||||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'<br>':'');
|
|
||||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
|
|
||||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
|
|
||||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'<br>':'');
|
|
||||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
|
|
||||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
|
|
||||||
print $form->textwithtooltip($langs->trans("StockDiffPhysicTeoric"),$text_stock_options,2,1,img_picto('', 'info'),'',0);;
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
|
|||||||
@ -398,6 +398,8 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
|
print dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$defaultref='';
|
$defaultref='';
|
||||||
@ -431,7 +433,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="12" type="text" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$defaultref).'"></td></tr>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="12" type="text" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$defaultref).'"></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="30" type="text" name="title" value="'.$_POST["title"].'"></td></tr>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="40" type="text" name="title" value="'.$_POST["title"].'"></td></tr>';
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
@ -476,7 +478,9 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||||
if (! empty($backtopage))
|
if (! empty($backtopage))
|
||||||
{
|
{
|
||||||
@ -503,9 +507,6 @@ else
|
|||||||
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
|
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
|
||||||
|
|
||||||
|
|
||||||
$head=project_prepare_head($object);
|
|
||||||
dol_fiche_head($head, 'project', $langs->trans("Project"),0,($object->public?'projectpub':'project'));
|
|
||||||
|
|
||||||
// Confirmation validation
|
// Confirmation validation
|
||||||
if ($action == 'validate')
|
if ($action == 'validate')
|
||||||
{
|
{
|
||||||
@ -548,14 +549,20 @@ else
|
|||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240);
|
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
|
print '<input type="hidden" name="comefromclone" value="'.$comefromclone.'">';
|
||||||
|
|
||||||
|
|
||||||
|
$head=project_prepare_head($object);
|
||||||
|
dol_fiche_head($head, 'project', $langs->trans("Project"),0,($object->public?'projectpub':'project'));
|
||||||
|
|
||||||
if ($action == 'edit' && $userWrite > 0)
|
if ($action == 'edit' && $userWrite > 0)
|
||||||
{
|
{
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="update">';
|
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
|
||||||
print '<input type="hidden" name="comefromclone" value="'.$comefromclone.'">';
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -564,7 +571,7 @@ else
|
|||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td>';
|
print '<tr><td>'.$langs->trans("Label").'</td>';
|
||||||
print '<td><input size="30" name="title" value="'.$object->title.'"></td></tr>';
|
print '<td><input size="40" name="title" value="'.$object->title.'"></td></tr>';
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
@ -610,12 +617,6 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div align="center"><br>';
|
|
||||||
print '<input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'"> ';
|
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -679,6 +680,17 @@ else
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
if ($action == 'edit' && $userWrite > 0)
|
||||||
|
{
|
||||||
|
print '<div align="center">';
|
||||||
|
print '<input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'"> ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Boutons actions
|
* Boutons actions
|
||||||
*/
|
*/
|
||||||
@ -691,11 +703,11 @@ else
|
|||||||
{
|
{
|
||||||
if ($userWrite > 0)
|
if ($userWrite > 0)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=validate">'.$langs->trans("Valid").'</a>';
|
print '<a class="butAction" href="card.php?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Valid').'</a>';
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Validate').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,7 @@ if (! empty($conf->facture->enabled)) $langs->load("bills");
|
|||||||
if (! empty($conf->commande->enabled)) $langs->load("orders");
|
if (! empty($conf->commande->enabled)) $langs->load("orders");
|
||||||
if (! empty($conf->propal->enabled)) $langs->load("propal");
|
if (! empty($conf->propal->enabled)) $langs->load("propal");
|
||||||
if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
|
if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
|
||||||
|
if (! empty($conf->deplacement->enabled)) $langs->load("trips");
|
||||||
|
|
||||||
$projectid=GETPOST('id','int');
|
$projectid=GETPOST('id','int');
|
||||||
$ref=GETPOST('ref','alpha');
|
$ref=GETPOST('ref','alpha');
|
||||||
@ -164,21 +165,21 @@ dol_fiche_end();
|
|||||||
|
|
||||||
$listofreferent=array(
|
$listofreferent=array(
|
||||||
'propal'=>array(
|
'propal'=>array(
|
||||||
'name'=>"Proposalq",
|
'name'=>"Proposals",
|
||||||
'title'=>"ListProposalsAssociatedProject",
|
'title'=>"ListProposalsAssociatedProject",
|
||||||
'class'=>'Propal',
|
'class'=>'Propal',
|
||||||
'table'=>'propal',
|
'table'=>'propal',
|
||||||
'datefieldname'=>'datep',
|
'datefieldname'=>'datep',
|
||||||
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
|
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
|
||||||
'order'=>array(
|
'order'=>array(
|
||||||
'name'=>"CustomerOrderq",
|
'name'=>"CustomersOrders",
|
||||||
'title'=>"ListOrdersAssociatedProject",
|
'title'=>"ListOrdersAssociatedProject",
|
||||||
'class'=>'Commande',
|
'class'=>'Commande',
|
||||||
'table'=>'commande',
|
'table'=>'commande',
|
||||||
'datefieldname'=>'date_commande',
|
'datefieldname'=>'date_commande',
|
||||||
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
|
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
|
||||||
'invoice'=>array(
|
'invoice'=>array(
|
||||||
'name'=>"CustomerInvoiceq",
|
'name'=>"CustomersInvoices",
|
||||||
'title'=>"ListInvoicesAssociatedProject",
|
'title'=>"ListInvoicesAssociatedProject",
|
||||||
'class'=>'Facture',
|
'class'=>'Facture',
|
||||||
'margin'=>'add',
|
'margin'=>'add',
|
||||||
@ -193,7 +194,7 @@ $listofreferent=array(
|
|||||||
'datefieldname'=>'datec',
|
'datefieldname'=>'datec',
|
||||||
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
|
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
|
||||||
'order_supplier'=>array(
|
'order_supplier'=>array(
|
||||||
'name'=>"SuplierOrders",
|
'name'=>"SuppliersOrders",
|
||||||
'title'=>"ListSupplierOrdersAssociatedProject",
|
'title'=>"ListSupplierOrdersAssociatedProject",
|
||||||
'class'=>'CommandeFournisseur',
|
'class'=>'CommandeFournisseur',
|
||||||
'table'=>'commande_fournisseur',
|
'table'=>'commande_fournisseur',
|
||||||
@ -223,7 +224,7 @@ $listofreferent=array(
|
|||||||
'disableamount'=>1,
|
'disableamount'=>1,
|
||||||
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
|
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
|
||||||
'trip'=>array(
|
'trip'=>array(
|
||||||
'name'=>"TripAndExpenses",
|
'name'=>"TripsAndExpenses",
|
||||||
'title'=>"ListTripAssociatedProject",
|
'title'=>"ListTripAssociatedProject",
|
||||||
'class'=>'Deplacement',
|
'class'=>'Deplacement',
|
||||||
'table'=>'deplacement',
|
'table'=>'deplacement',
|
||||||
|
|||||||
@ -395,6 +395,7 @@ print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
|
|||||||
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=true;
|
||||||
foreach ($dirsociete as $dirroot)
|
foreach ($dirsociete as $dirroot)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($dirroot,0);
|
$dir = dol_buildpath($dirroot,0);
|
||||||
@ -488,6 +489,7 @@ print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
|||||||
print '<td align="center" width="60">'.$langs->trans("Preview").'</td>';
|
print '<td align="center" width="60">'.$langs->trans("Preview").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=true;
|
||||||
foreach ($dirsociete as $dirroot)
|
foreach ($dirsociete as $dirroot)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($dirroot.'doc/',0);
|
$dir = dol_buildpath($dirroot.'doc/',0);
|
||||||
|
|||||||
@ -121,7 +121,8 @@ if ($socid)
|
|||||||
// Country
|
// Country
|
||||||
if ($object->country) {
|
if ($object->country) {
|
||||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||||
$img=picto_from_langcode($object->country_code);
|
//$img=picto_from_langcode($object->country_code);
|
||||||
|
$img='';
|
||||||
print ($img?$img.' ':'');
|
print ($img?$img.' ':'');
|
||||||
print $object->country;
|
print $object->country;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -2671,7 +2671,7 @@ class Societe extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Define if third party is treated as company of not when nature is unknown
|
// Define if third party is treated as company (or not) when nature is unknown
|
||||||
$isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default
|
$isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default
|
||||||
if (! empty($this->tva_intra)) $isacompany=1;
|
if (! empty($this->tva_intra)) $isacompany=1;
|
||||||
else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0;
|
else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0;
|
||||||
|
|||||||
@ -428,6 +428,9 @@ th .button {
|
|||||||
background-color: #777;
|
background-color: #777;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
.movable {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
.borderrightlight
|
.borderrightlight
|
||||||
{
|
{
|
||||||
|
|||||||
@ -639,10 +639,8 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
if (isset($this->rights->propale))
|
if (isset($this->rights->propale) && ! isset($this->rights->propal)) $this->rights->propal = $this->rights->propale;
|
||||||
{
|
if (isset($this->rights->propal) && ! isset($this->rights->propale)) $this->rights->propale = $this->rights->propal;
|
||||||
$this->rights->propal = $this->rights->propale;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $moduletag)
|
if (! $moduletag)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -646,6 +646,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->savlangs=$langs;
|
$this->savlangs=$langs;
|
||||||
$this->savdb=$db;
|
$this->savdb=$db;
|
||||||
|
|
||||||
|
// Sellers
|
||||||
$companyfrnovat=new Societe($db);
|
$companyfrnovat=new Societe($db);
|
||||||
$companyfrnovat->country_code='FR';
|
$companyfrnovat->country_code='FR';
|
||||||
$companyfrnovat->tva_assuj=0;
|
$companyfrnovat->tva_assuj=0;
|
||||||
@ -653,53 +654,88 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$companyfr=new Societe($db);
|
$companyfr=new Societe($db);
|
||||||
$companyfr->country_code='FR';
|
$companyfr->country_code='FR';
|
||||||
$companyfr->tva_assuj=1;
|
$companyfr->tva_assuj=1;
|
||||||
|
$companyfr->tva_intra='FR9999';
|
||||||
|
|
||||||
|
// Buyers
|
||||||
$companymc=new Societe($db);
|
$companymc=new Societe($db);
|
||||||
$companymc->country_code='MC';
|
$companymc->country_code='MC';
|
||||||
$companymc->tva_assuj=1;
|
$companymc->tva_assuj=1;
|
||||||
|
$companyfr->tva_intra='MC9999';
|
||||||
|
|
||||||
$companyit=new Societe($db);
|
$companyit=new Societe($db);
|
||||||
$companyit->country_code='IT';
|
$companyit->country_code='IT';
|
||||||
$companyit->tva_assuj=1;
|
$companyit->tva_assuj=1;
|
||||||
$companyit->tva_intra='IT99999';
|
$companyit->tva_intra='IT99999';
|
||||||
|
|
||||||
$notcompanyit=new Societe($db);
|
$companyde=new Societe($db);
|
||||||
$notcompanyit->country_code='IT';
|
$companyde->country_code='DE';
|
||||||
$notcompanyit->tva_assuj=1;
|
$companyde->tva_assuj=1;
|
||||||
$notcompanyit->tva_intra='';
|
$companyde->tva_intra='DE99999';
|
||||||
$notcompanyit->typent_code='TE_PRIVATE';
|
|
||||||
|
$notcompanyde=new Societe($db);
|
||||||
|
$notcompanyde->country_code='DE';
|
||||||
|
$notcompanyde->tva_assuj=0;
|
||||||
|
$notcompanyde->tva_intra='';
|
||||||
|
$notcompanyde->typent_code='TE_PRIVATE';
|
||||||
|
|
||||||
$companyus=new Societe($db);
|
$companyus=new Societe($db);
|
||||||
$companyus->country_code='US';
|
$companyus->country_code='US';
|
||||||
$companyus->tva_assuj=1;
|
$companyus->tva_assuj=1;
|
||||||
$companyus->tva_intra='';
|
$companyus->tva_intra='';
|
||||||
|
|
||||||
// Test RULE 0 (FR-IT)
|
|
||||||
|
// Test RULE 0 (FR-DE)
|
||||||
// Not tested
|
// Not tested
|
||||||
|
|
||||||
// Test RULE 1
|
// Test RULE 1
|
||||||
$vat=get_default_tva($companyfrnovat,$companymc,0);
|
$vat=get_default_tva($companyfrnovat,$companymc,0);
|
||||||
$this->assertEquals(0,$vat);
|
$this->assertEquals(0,$vat,'RULE 1');
|
||||||
|
|
||||||
// Test RULE 2 (FR-FR)
|
// Test RULE 2 (FR-FR)
|
||||||
$vat=get_default_tva($companyfr,$companyfr,0);
|
$vat=get_default_tva($companyfr,$companyfr,0);
|
||||||
$this->assertEquals(20,$vat);
|
$this->assertEquals(20,$vat,'RULE 2');
|
||||||
|
|
||||||
// Test RULE 2 (FR-MC)
|
// Test RULE 2 (FR-MC)
|
||||||
$vat=get_default_tva($companyfr,$companymc,0);
|
$vat=get_default_tva($companyfr,$companymc,0);
|
||||||
$this->assertEquals(20,$vat);
|
$this->assertEquals(20,$vat,'RULE 2');
|
||||||
|
|
||||||
// Test RULE 3 (FR-IT)
|
// Test RULE 3 (FR-DE company)
|
||||||
$vat=get_default_tva($companyfr,$companyit,0);
|
$vat=get_default_tva($companyfr,$companyit,0);
|
||||||
$this->assertEquals(0,$vat);
|
$this->assertEquals(0,$vat,'RULE 3');
|
||||||
|
|
||||||
// Test RULE 4 (FR-IT)
|
// Test RULE 4 (FR-DE not a company)
|
||||||
$vat=get_default_tva($companyfr,$notcompanyit,0);
|
$vat=get_default_tva($companyfr,$notcompanyde,0);
|
||||||
$this->assertEquals(20,$vat);
|
$this->assertEquals(20,$vat,'RULE 4');
|
||||||
|
|
||||||
// Test RULE 5 (FR-US)
|
// Test RULE 5 (FR-US)
|
||||||
$vat=get_default_tva($companyfr,$companyus,0);
|
$vat=get_default_tva($companyfr,$companyus,0);
|
||||||
$this->assertEquals(0,$vat);
|
$this->assertEquals(0,$vat,'RULE 5');
|
||||||
|
|
||||||
|
|
||||||
|
// We do same tests but with option SERVICE_ARE_ECOMMERCE_200238EC on.
|
||||||
|
$conf->global->SERVICE_ARE_ECOMMERCE_200238EC = 1;
|
||||||
|
|
||||||
|
|
||||||
|
// Test RULE 1 (FR-US)
|
||||||
|
$vat=get_default_tva($companyfr,$companyus,0);
|
||||||
|
$this->assertEquals(0,$vat,'RULE 1 ECOMMERCE_200238EC');
|
||||||
|
|
||||||
|
// Test RULE 2 (FR-FR)
|
||||||
|
$vat=get_default_tva($companyfr,$companyfr,0);
|
||||||
|
$this->assertEquals(20,$vat,'RULE 2 ECOMMERCE_200238EC');
|
||||||
|
|
||||||
|
// Test RULE 3 (FR-DE company)
|
||||||
|
$vat=get_default_tva($companyfr,$companyde,0);
|
||||||
|
$this->assertEquals(0,$vat,'RULE 3 ECOMMERCE_200238EC');
|
||||||
|
|
||||||
|
// Test RULE 4 (FR-DE not a company)
|
||||||
|
$vat=get_default_tva($companyfr,$notcompanyde,0);
|
||||||
|
$this->assertEquals(19,$vat,'RULE 4 ECOMMERCE_200238EC');
|
||||||
|
|
||||||
|
// Test RULE 5 (FR-US)
|
||||||
|
$vat=get_default_tva($companyfr,$companyus,0);
|
||||||
|
$this->assertEquals(0,$vat,'RULE 5 ECOMMERCE_200238EC');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user