Merge branch 'develop' into patch-17
This commit is contained in:
commit
fa2ccf6c44
16
.github/CONTRIBUTING.md
vendored
16
.github/CONTRIBUTING.md
vendored
@ -101,28 +101,30 @@ Long description (Can span accross multiple lines).
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### Pull Requests
|
### Pull Requests
|
||||||
When submitting a pull request, use same rule as [Commits](#commits) for the message.
|
Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and
|
||||||
|
a process to follow to optimize the chance to have PRs merged efficiently...
|
||||||
|
|
||||||
If your pull request only contains one commit, GitHub will be smart enough to fill it for you.
|
When submitting a pull request, use same rule as [Commits](#commits) for the message.
|
||||||
|
If your pull request only contains 1 commit, GitHub will be smart enough to fill it for you.
|
||||||
Otherwise, please be a bit verbose about what you're providing.
|
Otherwise, please be a bit verbose about what you're providing.
|
||||||
|
|
||||||
Your Pull Request (PR) must pass the Continuous Integration checks.
|
Your Pull Request (PR) must pass the Continuous Integration checks and code quality checks.
|
||||||
Also, some code changes need a prior approbation:
|
Also, some code changes need a prior approbation:
|
||||||
|
|
||||||
* if you want to include a new external library (into htdocs/includes directory), please ask before to the project manager (@eldy) to see if such a library can be accepted.
|
* if you want to include a new external library (into htdocs/includes directory), please ask before to the project manager (@eldy) to see if such a library can be accepted.
|
||||||
|
|
||||||
* if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project manager (@eldy) if the new data model you plan to add can be accepted as you suggest.
|
* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@eldy) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest.
|
||||||
|
|
||||||
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR.
|
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case).
|
||||||
|
|
||||||
If the label of PR start with "WIP" (Work In Progress), it will not be analyzed (until you change the label of PR).
|
If the label of PR start with "WIP" (Work In Progress), it will not be analyzed (until you change the label of PR).
|
||||||
|
|
||||||
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
|
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
|
||||||
|
|
||||||
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
|
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
|
||||||
In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the flag ask you. The majority of PR are waiting an action of the developer/author.
|
In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag ask you. The majority of open PR are waiting an action of the author of the PR.
|
||||||
|
|
||||||
Statistics on Dolibarr project shows that around 95% of submitted PR are reviewed and tagged. This is one of the most important ratio of answered PR in Open Source world. Don't expect the core team to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
|
Statistics on Dolibarr project shows that around 95% of submitted PR are reviewed and tagged. Average answer delay is also one of the best among Open source project (just few days before having the Answer Tag set). This is one of the most important ratio of answered PR in Open Source world for a major project. Don't expect the core team to reach the 100%. A so high ratio is very rare on a so popular project and with the increasing popularity of Dolibarr, this ratio will probably decrease in future to a more common level.
|
||||||
|
|
||||||
|
|
||||||
### Resources
|
### Resources
|
||||||
|
|||||||
24
.github/workflows/stale-issues-safe.yml
vendored
Normal file
24
.github/workflows/stale-issues-safe.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# See syntax file on https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||||
|
name: "Close stale issues (bugs and feature requests)"
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 21 * * *"
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: Dolibarr/stale@staleunstale
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
stale-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 15 days (you should still be able to re-open it if required).'
|
||||||
|
stale-label: 'Issue Stale (automatic label)'
|
||||||
|
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE)'
|
||||||
|
days-before-stale: 365
|
||||||
|
days-before-close: 15
|
||||||
|
operations-per-run: 100
|
||||||
|
dry-run: false
|
||||||
|
|
||||||
@ -12,12 +12,12 @@ jobs:
|
|||||||
- uses: Dolibarr/stale@master
|
- uses: Dolibarr/stale@master
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. Without comment, this issue will be closed automatically by stale bot in 15 days.'
|
stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 15 days (you should still be able to re-open it if required).'
|
||||||
stale-issue-label: 'Issue Stale (automatic label)'
|
stale-issue-label: 'Issue Stale (automatic label)'
|
||||||
exempt-issue-label: 'Priority High / Blocking'
|
exempt-issue-label: 'Priority High / Blocking'
|
||||||
days-before-stale: 365
|
days-before-stale: 365
|
||||||
days-before-close: 15
|
days-before-close: -1
|
||||||
operations-per-run: 50
|
operations-per-run: 100
|
||||||
#stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. If this PR is still mergeable (no conflict, nor Continuous Integration errors), please comment to confirm this merge is still expected. Without comment, this issue will be closed automatically by stale bot in 15 days.'
|
#stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. If this PR is still mergeable (no conflict, nor Continuous Integration errors), please comment to confirm this merge is still expected. Without comment, this issue will be closed automatically by stale bot in 15 days.'
|
||||||
stale-pr-label: 'PR Stale (automatic label)'
|
stale-pr-label: 'PR Stale (automatic label)'
|
||||||
stale-pr-message:
|
stale-pr-message:
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -40,3 +40,4 @@ htdocs/includes/sebastian/
|
|||||||
htdocs/includes/squizlabs/
|
htdocs/includes/squizlabs/
|
||||||
htdocs/includes/symfony/
|
htdocs/includes/symfony/
|
||||||
htdocs/includes/webmozart/
|
htdocs/includes/webmozart/
|
||||||
|
htdocs/.well-known/apple-developer-merchantid-domain-association
|
||||||
|
|||||||
@ -17,7 +17,7 @@ CKEditor 4.12.1 LGPL-2.1+ Yes
|
|||||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||||
Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||||
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||||
Mobiledetect 2.8.33 MIT License Yes Detect mobile devices browsers
|
Mobiledetect 2.8.34 MIT License Yes Detect mobile devices browsers
|
||||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
ParseDown 1.6 MIT License Yes Markdown parser
|
ParseDown 1.6 MIT License Yes Markdown parser
|
||||||
@ -32,15 +32,16 @@ PSR/simple-cache ? Library for cache (used by PHPSp
|
|||||||
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
||||||
Sabre 3.2.2 BSD Yes DAV support
|
Sabre 3.2.2 BSD Yes DAV support
|
||||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||||
Stripe 6.41 MIT licence Yes Library for Stripe module
|
Stripe 6.43.1 MIT licence Yes Library for Stripe module
|
||||||
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
|
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
|
||||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
Ace 1.4.6 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||||
|
Chart 2.9.3 MIT License Yes JS library for graph
|
||||||
jQuery 3.4.1 MIT License Yes JS library
|
jQuery 3.4.1 MIT License Yes JS library
|
||||||
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
||||||
jQuery select2 4.0.5 GPL and Apache License Yes JS library plugin for sexier multiselect
|
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect
|
||||||
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
|
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
|
||||||
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
|
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
|
||||||
jQuery Flot 0.8.3 MIT License Yes JS library to build graph
|
jQuery Flot 0.8.3 MIT License Yes JS library to build graph
|
||||||
|
|||||||
72
ChangeLog
72
ChangeLog
@ -8,7 +8,10 @@ For Users:
|
|||||||
NEW: Module MO (Manufacturing Order) is available as stable module.
|
NEW: Module MO (Manufacturing Order) is available as stable module.
|
||||||
|
|
||||||
For Developers or integrators:
|
For Developers or integrators:
|
||||||
|
* A new way to navigate between pages in list is available. To use it, you must
|
||||||
|
- replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
- remove input field in form '<input type="hidden" name="page" value="'.$page.'">';'
|
||||||
|
- add parameter $pagenavastextinput to value 1 when calling print_barre_liste
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
@ -20,7 +23,72 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
the HTML into content (in such a case, sanitize data later)
|
the HTML into content (in such a case, sanitize data later)
|
||||||
* Removed hidden constant MAIN_EXTRAFIELDS_IN_ONE_TD that was useless.
|
* Removed hidden constant MAIN_EXTRAFIELDS_IN_ONE_TD that was useless.
|
||||||
* Reference of object including a "/" are no more allowed. It is never used by default but to support setup that introduced it, the "/" will be replaced
|
* Reference of object including a "/" are no more allowed. It is never used by default but to support setup that introduced it, the "/" will be replaced
|
||||||
by a "_" automatically when a reference is generated.
|
by a "_" automatically when a reference (with a custom numbering mask that use it) is generated.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 11.0.2 compared to 11.0.1 *****
|
||||||
|
FIX: #10309
|
||||||
|
FIX: #13110
|
||||||
|
FIX: #13118
|
||||||
|
FIX: #13124
|
||||||
|
FIX: #13131
|
||||||
|
FIX: #13135
|
||||||
|
FIX: #13146 #13198
|
||||||
|
FIX: #13175
|
||||||
|
FIX: #13182
|
||||||
|
FIX: #13183
|
||||||
|
FIX: #13184
|
||||||
|
FIX: #13263
|
||||||
|
FIX: #13267
|
||||||
|
FIX: an external user can not approve
|
||||||
|
FIX: API Get list of documents for supplier_invoice
|
||||||
|
FIX: API to push an expense report
|
||||||
|
FIX: API upload/download doc for expensereport
|
||||||
|
FIX: Avoid to download the export if we just press enter to refresh form
|
||||||
|
FIX: Bad link to template invoices
|
||||||
|
FIX: Bad sort link in accounting report
|
||||||
|
FIX: Bad translation for productlot EatBy and SellBy
|
||||||
|
FIX: better method to check user rights AND usergroup rights !
|
||||||
|
FIX: CA by product list filter
|
||||||
|
FIX: CSS
|
||||||
|
FIX: Disable js if no javascript
|
||||||
|
FIX: duplicate class name into some log lines
|
||||||
|
FIX: etrafield with visibilty=5 were not in read only.
|
||||||
|
FIX: excess paid from situation invoices not counted when calculating remain to pay.
|
||||||
|
FIX: Force FEC export to txt format.
|
||||||
|
FIX: Free input for email no more visible.
|
||||||
|
FIX: Keep assigned users in session when loading projects and tasks
|
||||||
|
FIX: List of viewed projects too large in task widget.
|
||||||
|
FIX: Menu truncated. Add tooltip to have all content.
|
||||||
|
FIX: Missing field "billed" in export.
|
||||||
|
FIX: missing "statut" for getNomUrl() function
|
||||||
|
FIX: modFournisseur is required by modSupplierProposal
|
||||||
|
FIX: Multicompany compatibility
|
||||||
|
FIX: must be == and not =
|
||||||
|
FIX: option for topbar search and bookmarks
|
||||||
|
FIX: option MAIN_OPTIMIZEFORTEXTBROWSER
|
||||||
|
FIX: some responsive troubles
|
||||||
|
FIX: round MT in accountancy books
|
||||||
|
FIX: search with '0'
|
||||||
|
FIX: sort link
|
||||||
|
FIX: SQL Overload in default contact trigger.
|
||||||
|
FIX: SQl syntax error.
|
||||||
|
FIX: Submit of documents for supplier invoices.
|
||||||
|
FIX: timezone must be tzserver and not tzuser as on contract card
|
||||||
|
FIX: token in barcode tools page missing
|
||||||
|
FIX: Bad name of trigger PROPAL_SUPPLIER_TRIGGER, should be PROPOSAL_SUPPLIER_TRIGGER
|
||||||
|
FIX: Type of contact for event does not exists and not supported
|
||||||
|
FIX: Type of contact not saved when creating a contact
|
||||||
|
FIX: typo on ckeck method
|
||||||
|
FIX: undefined function measuringUnitString in product list
|
||||||
|
FIX: Usage of project not available in export.
|
||||||
|
FIX: wrong test
|
||||||
|
FIX: z-index for moretabsList with constant MAIN_MAXTABS_IN_CARD
|
||||||
|
FIX: Use GETPOST instead of POST
|
||||||
|
FIX: HTML Injection
|
||||||
|
FIX: Visualization rights correction on last modified contacts box.
|
||||||
|
FIX: Vulnerability in module from modulebuilder.
|
||||||
|
FIX: Vulnerability reported by code16
|
||||||
|
|
||||||
***** ChangeLog for 11.0.1 compared to 11.0.0 *****
|
***** ChangeLog for 11.0.1 compared to 11.0.0 *****
|
||||||
FIX: advanced target emailing sql and ergonomy.
|
FIX: advanced target emailing sql and ergonomy.
|
||||||
|
|||||||
@ -28,11 +28,12 @@
|
|||||||
"ext-curl" : "*",
|
"ext-curl" : "*",
|
||||||
"ckeditor/ckeditor" : "4.12.1",
|
"ckeditor/ckeditor" : "4.12.1",
|
||||||
"mike42/escpos-php" : "2.2",
|
"mike42/escpos-php" : "2.2",
|
||||||
"mobiledetect/mobiledetectlib" : "2.8.33",
|
"mobiledetect/mobiledetectlib" : "2.8.34",
|
||||||
"phpoffice/phpexcel" : "1.8.1",
|
"phpoffice/phpexcel" : "1.8.1",
|
||||||
"restler/framework" : "3.0.0-RC6",
|
"restler/framework" : "3.0.0-RC6",
|
||||||
"tecnickcom/tcpdf" : "^6.2",
|
"tecnickcom/tcpdf" : "6.3.2",
|
||||||
"luracast/restler" : "^3.0"
|
"nnnick/chartjs" : "^2.9",
|
||||||
|
"stripe/stripe-php" : "6.43.1"
|
||||||
},
|
},
|
||||||
"require-dev" : {
|
"require-dev" : {
|
||||||
"jakub-onderka/php-parallel-lint" : "^0",
|
"jakub-onderka/php-parallel-lint" : "^0",
|
||||||
|
|||||||
152
composer.lock
generated
152
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "16c94fd4f22ac17820d85ee57b0616e1",
|
"content-hash": "17e906996157e8a94564f686a6096dc5",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "ckeditor/ckeditor",
|
"name": "ckeditor/ckeditor",
|
||||||
@ -49,24 +49,31 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mike42/escpos-php",
|
"name": "mike42/escpos-php",
|
||||||
"version": "v1.2.1",
|
"version": "v2.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mike42/escpos-php.git",
|
"url": "https://github.com/mike42/escpos-php.git",
|
||||||
"reference": "cfea4c4fc95516ac953e1e5b623f854632afa2ee"
|
"reference": "e5496cf819b048b11877117bd14a9cea4fb17c03"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/mike42/escpos-php/zipball/cfea4c4fc95516ac953e1e5b623f854632afa2ee",
|
"url": "https://api.github.com/repos/mike42/escpos-php/zipball/e5496cf819b048b11877117bd14a9cea4fb17c03",
|
||||||
"reference": "cfea4c4fc95516ac953e1e5b623f854632afa2ee",
|
"reference": "e5496cf819b048b11877117bd14a9cea4fb17c03",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0"
|
"ext-mbstring": "*",
|
||||||
|
"php": ">=5.4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "4.5.*",
|
"guzzlehttp/guzzle": "^5.3",
|
||||||
"squizlabs/php_codesniffer": "2.*"
|
"phpunit/phpunit": "^4.8",
|
||||||
|
"squizlabs/php_codesniffer": "^3.2"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-gd": "Used for image printing if present.",
|
||||||
|
"ext-imagick": "Will be used for image printing if present. Required for PDF printing or use of custom fonts.",
|
||||||
|
"guzzlehttp/guzzle": "Allows the use of the ApiConnector to send print jobs over HTTP."
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -79,28 +86,12 @@
|
|||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
|
||||||
"name": "Roni Saha",
|
|
||||||
"email": "roni.cse@gmail.com"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Michael Billington",
|
"name": "Michael Billington",
|
||||||
"email": "michael.billington@gmail.com"
|
"email": "michael.billington@gmail.com"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gergely Radics",
|
|
||||||
"email": "gerifield@ustream.tv"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Warren Doyle",
|
|
||||||
"email": "w.doyle@fuelled.co"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vharo",
|
|
||||||
"email": "vharo@geepok.com"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Thermal receipt printer library, for use with ESC/POS compatible printers",
|
"description": "PHP receipt printer library for use with ESC/POS-compatible thermal and impact printers",
|
||||||
"homepage": "https://github.com/mike42/escpos-php",
|
"homepage": "https://github.com/mike42/escpos-php",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ESC-POS",
|
"ESC-POS",
|
||||||
@ -109,20 +100,20 @@
|
|||||||
"print",
|
"print",
|
||||||
"receipt"
|
"receipt"
|
||||||
],
|
],
|
||||||
"time": "2016-04-25T01:14:07+00:00"
|
"time": "2019-10-05T05:59:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mobiledetect/mobiledetectlib",
|
"name": "mobiledetect/mobiledetectlib",
|
||||||
"version": "2.8.33",
|
"version": "2.8.34",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/serbanghita/Mobile-Detect.git",
|
"url": "https://github.com/serbanghita/Mobile-Detect.git",
|
||||||
"reference": "cd385290f9a0d609d2eddd165a1e44ec1bf12102"
|
"reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/cd385290f9a0d609d2eddd165a1e44ec1bf12102",
|
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/6f8113f57a508494ca36acbcfa2dc2d923c7ed5b",
|
||||||
"reference": "cd385290f9a0d609d2eddd165a1e44ec1bf12102",
|
"reference": "6f8113f57a508494ca36acbcfa2dc2d923c7ed5b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -161,7 +152,48 @@
|
|||||||
"mobile detector",
|
"mobile detector",
|
||||||
"php mobile detect"
|
"php mobile detect"
|
||||||
],
|
],
|
||||||
"time": "2018-09-01T15:05:15+00:00"
|
"time": "2019-09-18T18:44:20+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nnnick/chartjs",
|
||||||
|
"version": "v2.9.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/chartjs/Chart.js.git",
|
||||||
|
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/06f73dc3590084b2c464bf08189c7aee2b6b92d2",
|
||||||
|
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"release/2.0": "v2.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "NICK DOWNIE",
|
||||||
|
"email": "hello@nickdownie.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Simple HTML5 charts using the canvas element.",
|
||||||
|
"homepage": "https://www.chartjs.org/",
|
||||||
|
"keywords": [
|
||||||
|
"JS",
|
||||||
|
"chart"
|
||||||
|
],
|
||||||
|
"time": "2019-11-14T18:37:30+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpoffice/phpexcel",
|
"name": "phpoffice/phpexcel",
|
||||||
@ -282,6 +314,62 @@
|
|||||||
],
|
],
|
||||||
"time": "2019-05-12T15:15:11+00:00"
|
"time": "2019-05-12T15:15:11+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "stripe/stripe-php",
|
||||||
|
"version": "v6.43.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/stripe/stripe-php.git",
|
||||||
|
"reference": "42fcdaf99c44bb26937223f8eae1f263491d5ab8"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/42fcdaf99c44bb26937223f8eae1f263491d5ab8",
|
||||||
|
"reference": "42fcdaf99c44bb26937223f8eae1f263491d5ab8",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-curl": "*",
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"php": ">=5.4.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"php-coveralls/php-coveralls": "1.*",
|
||||||
|
"phpunit/phpunit": "~4.0",
|
||||||
|
"squizlabs/php_codesniffer": "~2.0",
|
||||||
|
"symfony/process": "~2.8"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Stripe\\": "lib/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Stripe and contributors",
|
||||||
|
"homepage": "https://github.com/stripe/stripe-php/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Stripe PHP Library",
|
||||||
|
"homepage": "https://stripe.com/",
|
||||||
|
"keywords": [
|
||||||
|
"api",
|
||||||
|
"payment processing",
|
||||||
|
"stripe"
|
||||||
|
],
|
||||||
|
"time": "2019-08-29T16:56:12+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "tecnickcom/tcpdf",
|
"name": "tecnickcom/tcpdf",
|
||||||
"version": "6.3.2",
|
"version": "6.3.2",
|
||||||
@ -1815,7 +1903,7 @@
|
|||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=5.3.0",
|
"php": ">=5.5.0",
|
||||||
"ext-curl": "*"
|
"ext-curl": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": []
|
"platform-dev": []
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -70,9 +70,12 @@ $arrayfields = array(
|
|||||||
'aa.labelshort'=>array('label'=>$langs->trans("LabelToShow"), 'checked'=>1),
|
'aa.labelshort'=>array('label'=>$langs->trans("LabelToShow"), 'checked'=>1),
|
||||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
||||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||||
|
'aa.reconciliable'=>array('label'=>$langs->trans("Reconciliable"), 'checked'=>1),
|
||||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['aa.reconciliable']);
|
||||||
|
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
|
|
||||||
|
|
||||||
@ -157,7 +160,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'disable') {
|
if ($action == 'disable') {
|
||||||
if ($accounting->fetch($id)) {
|
if ($accounting->fetch($id)) {
|
||||||
$result = $accounting->account_desactivate($id);
|
$mode = GETPOST('mode', 'int');
|
||||||
|
$result = $accounting->account_desactivate($id, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = 'update';
|
$action = 'update';
|
||||||
@ -166,7 +170,8 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
} elseif ($action == 'enable') {
|
} elseif ($action == 'enable') {
|
||||||
if ($accounting->fetch($id)) {
|
if ($accounting->fetch($id)) {
|
||||||
$result = $accounting->account_activate($id);
|
$mode = GETPOST('mode', 'int');
|
||||||
|
$result = $accounting->account_activate($id, $mode);
|
||||||
}
|
}
|
||||||
$action = 'update';
|
$action = 'update';
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -192,7 +197,7 @@ if ($action == 'delete') {
|
|||||||
|
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent , aa.label, aa.labelshort, aa.active, ";
|
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent , aa.label, aa.labelshort, aa.reconciliable, aa.active, ";
|
||||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".$conf->entity;
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".$conf->entity;
|
||||||
@ -352,6 +357,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconciliable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
||||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
||||||
@ -365,6 +371,7 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['aa.labelshort']['checked'])) print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
|
if (!empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
|
||||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help']);
|
if (!empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help']);
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconciliable']['checked'])) print_liste_field_titre($arrayfields['aa.reconciliable']['label'], $_SERVER["PHP_SELF"], 'aa.reconciliable', '', $param, '', $sortfield, $sortorder); }
|
||||||
if (!empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -441,16 +448,36 @@ if ($resql)
|
|||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activated or not
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
if (!empty($arrayfields['aa.active']['checked']))
|
// Activated or not reconciliation on accounting account
|
||||||
{
|
if (!empty($arrayfields['aa.reconciliable']['checked'])) {
|
||||||
print '<td>';
|
print '<td class="center">';
|
||||||
if (empty($obj->active)) {
|
if (empty($obj->reconciliable)) {
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable">';
|
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable&mode=1">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable">';
|
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable&mode=1">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activated or not
|
||||||
|
if (!empty($arrayfields['aa.active']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="center">';
|
||||||
|
if (empty($obj->active)) {
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=0">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=0">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $active = 1;
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
||||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ $active = 1;
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
||||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* 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) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* 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>
|
||||||
@ -54,19 +54,27 @@ $list_account_main = array (
|
|||||||
|
|
||||||
$list_account = array();
|
$list_account = array();
|
||||||
$list_account[] = '---Product---';
|
$list_account[] = '---Product---';
|
||||||
$list_account[] = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT';
|
|
||||||
$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT';
|
||||||
if ($mysoc->isInEEC()) {
|
if ($mysoc->isInEEC()) {
|
||||||
$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT';
|
||||||
}
|
}
|
||||||
$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT';
|
||||||
|
$list_account[] = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT';
|
||||||
|
if ($mysoc->isInEEC()) {
|
||||||
|
$list_account[] = 'ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT';
|
||||||
|
}
|
||||||
|
$list_account[] = 'ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT';
|
||||||
$list_account[] = '---Service---';
|
$list_account[] = '---Service---';
|
||||||
$list_account[] = 'ACCOUNTING_SERVICE_BUY_ACCOUNT';
|
|
||||||
$list_account[] = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT';
|
||||||
if ($mysoc->isInEEC()) {
|
if ($mysoc->isInEEC()) {
|
||||||
$list_account[] = 'ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT';
|
||||||
}
|
}
|
||||||
$list_account[] = 'ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT';
|
||||||
|
$list_account[] = 'ACCOUNTING_SERVICE_BUY_ACCOUNT';
|
||||||
|
if ($mysoc->isInEEC()) {
|
||||||
|
$list_account[] = 'ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT';
|
||||||
|
}
|
||||||
|
$list_account[] = 'ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT';
|
||||||
$list_account[] = '---Other---';
|
$list_account[] = '---Other---';
|
||||||
$list_account[] = 'ACCOUNTING_VAT_BUY_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_VAT_BUY_ACCOUNT';
|
||||||
$list_account[] = 'ACCOUNTING_VAT_SOLD_ACCOUNT';
|
$list_account[] = 'ACCOUNTING_VAT_SOLD_ACCOUNT';
|
||||||
|
|||||||
@ -31,7 +31,7 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -57,7 +57,7 @@ $active = 1;
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -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-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
@ -72,7 +72,7 @@ if (empty($accounting_product_mode)) $accounting_product_mode='ACCOUNTANCY_SELL'
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -117,7 +117,9 @@ if ($action == 'update') {
|
|||||||
'ACCOUNTANCY_SELL',
|
'ACCOUNTANCY_SELL',
|
||||||
'ACCOUNTANCY_SELL_INTRA',
|
'ACCOUNTANCY_SELL_INTRA',
|
||||||
'ACCOUNTANCY_SELL_EXPORT',
|
'ACCOUNTANCY_SELL_EXPORT',
|
||||||
'ACCOUNTANCY_BUY'
|
'ACCOUNTANCY_BUY',
|
||||||
|
'ACCOUNTANCY_BUY_INTRA',
|
||||||
|
'ACCOUNTANCY_BUY_EXPORT'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (in_array($accounting_product_mode, $accounting_product_modes)) {
|
if (in_array($accounting_product_mode, $accounting_product_modes)) {
|
||||||
@ -159,6 +161,12 @@ if ($action == 'update') {
|
|||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
$sql .= " SET accountancy_code_buy = ".$accounting->account_number;
|
$sql .= " SET accountancy_code_buy = ".$accounting->account_number;
|
||||||
}
|
}
|
||||||
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
$sql .= " SET accountancy_code_buy_intra = ".$accounting->account_number;
|
||||||
|
}
|
||||||
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
$sql .= " SET accountancy_code_buy_export = ".$accounting->account_number;
|
||||||
|
}
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
$sql .= " SET accountancy_code_sell = ".$accounting->account_number;
|
$sql .= " SET accountancy_code_sell = ".$accounting->account_number;
|
||||||
}
|
}
|
||||||
@ -204,7 +212,11 @@ $form = new FormAccounting($db);
|
|||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
// TODO: we should need to check if result is already exists accountaccount rowid.....
|
// TODO: we should need to check if result is already exists accountaccount rowid.....
|
||||||
$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
|
$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
|
||||||
|
$aarowid_servbuy_intra = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT, 1);
|
||||||
|
$aarowid_servbuy_export = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT, 1);
|
||||||
$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
|
$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
|
||||||
|
$aarowid_prodbuy_intra = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT, 1);
|
||||||
|
$aarowid_prodbuy_export = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT, 1);
|
||||||
$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
||||||
$aarowid_servsell_intra = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT, 1);
|
$aarowid_servsell_intra = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT, 1);
|
||||||
$aarowid_servsell_export = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT, 1);
|
$aarowid_servsell_export = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT, 1);
|
||||||
@ -213,7 +225,11 @@ $aarowid_prodsell_intra = $accounting->fetch('', $conf->global->ACCOUNTING_P
|
|||||||
$aarowid_prodsell_export = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT, 1);
|
$aarowid_prodsell_export = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT, 1);
|
||||||
|
|
||||||
$aacompta_servbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$aacompta_servbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$aacompta_servbuy_intra = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$aacompta_servbuy_export = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$aacompta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$aacompta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$aacompta_prodbuy_intra = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$aacompta_prodbuy_export = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$aacompta_servsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
$aacompta_servsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$aacompta_servsell_intra = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
$aacompta_servsell_intra = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$aacompta_servsell_export = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
$aacompta_servsell_export = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
@ -228,7 +244,8 @@ $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'p
|
|||||||
if (empty($pcgvercode)) $pcgvercode = $pcgverid;
|
if (empty($pcgvercode)) $pcgvercode = $pcgverid;
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy,";
|
$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy,";
|
||||||
$sql.= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,";
|
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
|
||||||
|
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
|
||||||
$sql .= " p.tms, p.fk_product_type as product_type,";
|
$sql .= " p.tms, p.fk_product_type as product_type,";
|
||||||
$sql .= " aa.rowid as aaid";
|
$sql .= " aa.rowid as aaid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||||
@ -236,6 +253,14 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON";
|
|||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
$sql .= " p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
|
$sql .= " p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
|
||||||
}
|
}
|
||||||
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA')
|
||||||
|
{
|
||||||
|
$sql .= " p.accountancy_code_buy_intra = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
|
||||||
|
}
|
||||||
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT')
|
||||||
|
{
|
||||||
|
$sql .= " p.accountancy_code_buy_export = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
|
||||||
|
}
|
||||||
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL')
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL')
|
||||||
{
|
{
|
||||||
$sql .= " p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
|
$sql .= " p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
|
||||||
@ -253,6 +278,14 @@ if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
|||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_buy", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_buy", $search_current_account);
|
||||||
}
|
}
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
if (strlen(trim($search_current_account))) {
|
||||||
|
$sql .= natural_search("p.accountancy_code_buy_intra", $search_current_account);
|
||||||
|
}
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
if (strlen(trim($search_current_account))) {
|
||||||
|
$sql .= natural_search("p.accountancy_code_buy_export", $search_current_account);
|
||||||
|
}
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_sell", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_sell", $search_current_account);
|
||||||
@ -356,6 +389,13 @@ if ($result)
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"'.($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuy').'</td>';
|
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"'.($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuy').'</td>';
|
||||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||||
|
if ($mysoc->isInEEC())
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyIntra').'</td>';
|
||||||
|
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||||
|
}
|
||||||
|
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyExport').'</td>';
|
||||||
|
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Refresh').'" name="changetype"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Refresh').'" name="changetype"></div>';
|
||||||
@ -386,7 +426,7 @@ if ($result)
|
|||||||
print '<td class="liste_titre center">'.$form->selectyesno('search_onsell', $search_onsell, 1, false, 1).'</td>';
|
print '<td class="liste_titre center">'.$form->selectyesno('search_onsell', $search_onsell, 1, false, 1).'</td>';
|
||||||
}
|
}
|
||||||
// On buy
|
// On buy
|
||||||
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY' || $accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
print '<td class="liste_titre center">'.$form->selectyesno('search_onpurchase', $search_onpurchase, 1, false, 1).'</td>';
|
print '<td class="liste_titre center">'.$form->selectyesno('search_onpurchase', $search_onpurchase, 1, false, 1).'</td>';
|
||||||
}
|
}
|
||||||
// Current account
|
// Current account
|
||||||
@ -416,9 +456,15 @@ if ($result)
|
|||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_sell_export";
|
$fieldtosortaccount = "p.accountancy_code_sell_export";
|
||||||
} else {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_buy";
|
$fieldtosortaccount = "p.accountancy_code_buy";
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
$fieldtosortaccount = "p.accountancy_code_buy_intra";
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
$fieldtosortaccount = "p.accountancy_code_buy_export";
|
||||||
}
|
}
|
||||||
print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AssignDedicatedAccountingAccount");
|
print_liste_field_titre("AssignDedicatedAccountingAccount");
|
||||||
@ -457,22 +503,22 @@ if ($result)
|
|||||||
$compta_prodsell_id = $aarowid_prodsell_export;
|
$compta_prodsell_id = $aarowid_prodsell_export;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_servsell;
|
$compta_prodsell_id = $aarowid_prodsell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell;
|
$compta_prodsell_id = $aarowid_servsell;
|
||||||
}
|
}
|
||||||
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell_intra;
|
$compta_prodsell_id = $aarowid_servsell_intra;
|
||||||
}
|
}
|
||||||
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell_export;
|
$compta_prodsell_id = $aarowid_servsell_export;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
@ -482,12 +528,41 @@ if ($result)
|
|||||||
|
|
||||||
// Purchases
|
// Purchases
|
||||||
if ($obj->product_type == 0) {
|
if ($obj->product_type == 0) {
|
||||||
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodbuy_id = $aarowid_prodbuy;
|
$compta_prodbuy_id = $aarowid_prodbuy;
|
||||||
} else {
|
}
|
||||||
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$compta_prodbuy_id = $aarowid_prodbuy_intra;
|
||||||
|
}
|
||||||
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$compta_prodbuy_id = $aarowid_prodbuy_export;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$compta_prodbuy_id = $aarowid_prodbuy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodbuy_id = $aarowid_servbuy;
|
$compta_prodbuy_id = $aarowid_servbuy;
|
||||||
}
|
}
|
||||||
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$compta_prodbuy_id = $aarowid_servbuy_intra;
|
||||||
|
}
|
||||||
|
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$compta_prodbuy_id = $aarowid_servbuy_export;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$compta_prodbuy = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
|
$compta_prodbuy_id = $aarowid_servbuy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -509,7 +584,7 @@ if ($result)
|
|||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')
|
||||||
print '<td class="center">'.$product_static->getLibStatut(3, 0).'</td>';
|
print '<td class="center">'.$product_static->getLibStatut(3, 0).'</td>';
|
||||||
|
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY')
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY' || $accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT')
|
||||||
print '<td class="center">'.$product_static->getLibStatut(3, 1).'</td>';
|
print '<td class="center">'.$product_static->getLibStatut(3, 1).'</td>';
|
||||||
|
|
||||||
// Current accounting account
|
// Current accounting account
|
||||||
@ -517,6 +592,12 @@ if ($result)
|
|||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
print length_accountg($obj->accountancy_code_buy);
|
print length_accountg($obj->accountancy_code_buy);
|
||||||
if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
print length_accountg($obj->accountancy_code_buy_intra);
|
||||||
|
if ($obj->accountancy_code_buy_intra && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
print length_accountg($obj->accountancy_code_buy_export);
|
||||||
|
if ($obj->accountancy_code_buy_export && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
print length_accountg($obj->accountancy_code_sell);
|
print length_accountg($obj->accountancy_code_sell);
|
||||||
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
@ -540,6 +621,26 @@ if ($result)
|
|||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
|
// Accounting account buy intra (In EEC)
|
||||||
|
print '<td class="left">';
|
||||||
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
|
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy_intra;
|
||||||
|
$codesell = length_accountg($obj->accountancy_code_buy_intra);
|
||||||
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
|
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||||
|
print '</td>';
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
|
// Accounting account buy export (Out of EEC)
|
||||||
|
print '<td class="left">';
|
||||||
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
|
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy_export;
|
||||||
|
$codesell = length_accountg($obj->accountancy_code_buy_export);
|
||||||
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
|
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
||||||
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
// Accounting account sell
|
// Accounting account sell
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
|
|||||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("accountancy"));
|
$langs->loadLangs(array("accountancy"));
|
||||||
|
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -47,7 +47,7 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -271,7 +271,7 @@ if ($action != 'export_csv')
|
|||||||
$sql .= " AND t.doc_date < '".$db->idate($search_date_start)."' GROUP BY t.numero_compte";
|
$sql .= " AND t.doc_date < '".$db->idate($search_date_start)."' GROUP BY t.numero_compte";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$nrows = $resql->num_rows;
|
$nrows = $resql->num_rows;
|
||||||
$opening_balances = Array();
|
$opening_balances = array();
|
||||||
for ($i = 0; $i < $nrows; $i++) {
|
for ($i = 0; $i < $nrows; $i++) {
|
||||||
$arr = $resql->fetch_array();
|
$arr = $resql->fetch_array();
|
||||||
$opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance'];
|
$opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance'];
|
||||||
|
|||||||
@ -93,7 +93,7 @@ $search_not_reconciled = GETPOST('search_reconciled_option', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
if (empty($page) || $page < 0) { $page = 0; }
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $search_credit = GETPOST('search_credit', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
if (empty($page) || $page < 0) { $page = 0; }
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int
|
|||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == - 1) {
|
if (empty($page) || $page == - 1) {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
} // If $page is not defined, or '' or -1
|
} // If $page is not defined, or '' or -1
|
||||||
|
|||||||
@ -46,7 +46,7 @@ $socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int
|
|||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == - 1) {
|
if (empty($page) || $page == - 1) {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
} // If $page is not defined, or '' or -1
|
} // If $page is not defined, or '' or -1
|
||||||
|
|||||||
@ -54,6 +54,7 @@ class AccountancyExport
|
|||||||
public static $EXPORT_TYPE_QUADRATUS = 60;
|
public static $EXPORT_TYPE_QUADRATUS = 60;
|
||||||
public static $EXPORT_TYPE_OPENCONCERTO = 100;
|
public static $EXPORT_TYPE_OPENCONCERTO = 100;
|
||||||
public static $EXPORT_TYPE_LDCOMPTA = 110;
|
public static $EXPORT_TYPE_LDCOMPTA = 110;
|
||||||
|
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
||||||
public static $EXPORT_TYPE_FEC = 1000;
|
public static $EXPORT_TYPE_FEC = 1000;
|
||||||
|
|
||||||
|
|
||||||
@ -110,6 +111,7 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
||||||
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
|
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
|
||||||
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
||||||
|
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
||||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||||
);
|
);
|
||||||
@ -140,6 +142,7 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
||||||
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
|
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
|
||||||
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
||||||
|
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
|
||||||
self::$EXPORT_TYPE_FEC => 'fec',
|
self::$EXPORT_TYPE_FEC => 'fec',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -201,6 +204,10 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_LDCOMPTA => array(
|
self::$EXPORT_TYPE_LDCOMPTA => array(
|
||||||
'label' => $langs->trans('Modelcsv_LDCompta'),
|
'label' => $langs->trans('Modelcsv_LDCompta'),
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||||
|
),
|
||||||
|
self::$EXPORT_TYPE_LDCOMPTA10 => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_LDCompta10'),
|
||||||
|
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||||
),
|
),
|
||||||
self::$EXPORT_TYPE_FEC => array(
|
self::$EXPORT_TYPE_FEC => array(
|
||||||
'label' => $langs->trans('Modelcsv_FEC'),
|
'label' => $langs->trans('Modelcsv_FEC'),
|
||||||
@ -280,6 +287,9 @@ class AccountancyExport
|
|||||||
case self::$EXPORT_TYPE_LDCOMPTA :
|
case self::$EXPORT_TYPE_LDCOMPTA :
|
||||||
$this->exportLDCompta($TData);
|
$this->exportLDCompta($TData);
|
||||||
break;
|
break;
|
||||||
|
case self::$EXPORT_TYPE_LDCOMPTA10 :
|
||||||
|
$this->exportLDCompta10($TData);
|
||||||
|
break;
|
||||||
case self::$EXPORT_TYPE_FEC :
|
case self::$EXPORT_TYPE_FEC :
|
||||||
$this->exportFEC($TData);
|
$this->exportFEC($TData);
|
||||||
break;
|
break;
|
||||||
@ -921,7 +931,7 @@ class AccountancyExport
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : LD Compta version 9 & higher
|
* Export format : LD Compta version 9 & higher
|
||||||
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
|
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf
|
||||||
*
|
*
|
||||||
* @param array $objectLines data
|
* @param array $objectLines data
|
||||||
*
|
*
|
||||||
@ -1051,6 +1061,261 @@ class AccountancyExport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export format : LD Compta version 10 & higher
|
||||||
|
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
|
||||||
|
*
|
||||||
|
* @param array $objectLines data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function exportLDCompta10($objectLines)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
|
$separator = ';';
|
||||||
|
$end_line = "\r\n";
|
||||||
|
$last_codeinvoice = '';
|
||||||
|
|
||||||
|
foreach ($objectLines as $line) {
|
||||||
|
// TYPE C
|
||||||
|
if($last_codeinvoice != $line->doc_ref){
|
||||||
|
//recherche societe en fonction de son code client
|
||||||
|
$sql = "SELECT code_client, fk_forme_juridique, nom, address, zip, town, fk_pays, phone, siret FROM ".MAIN_DB_PREFIX."societe WHERE code_client = '".$line->thirdparty_code ."'";
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
|
if($resql && $this->db->num_rows($resql)>0)
|
||||||
|
{
|
||||||
|
$soc = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
|
$address = str_replace(array("\t", "\n", "\r"), " ", $soc->address);
|
||||||
|
|
||||||
|
$type_enregistrement = 'C';
|
||||||
|
print $type_enregistrement.$separator;
|
||||||
|
//NOCL
|
||||||
|
print $soc->code_client.$separator;
|
||||||
|
//NMCM
|
||||||
|
print $separator;
|
||||||
|
//LIBI
|
||||||
|
print $separator;
|
||||||
|
//TITR
|
||||||
|
print getFormeJuridiqueLabel($soc->fk_forme_juridique).$separator;
|
||||||
|
//RSSO
|
||||||
|
print $soc->nom.$separator;
|
||||||
|
//CAD1
|
||||||
|
print substr($address, 0, 40).$separator;
|
||||||
|
//CAD2
|
||||||
|
print substr($address, 41, 40).$separator;
|
||||||
|
//CAD3
|
||||||
|
print substr($address, 82, 40).$separator;
|
||||||
|
//COPO
|
||||||
|
print $soc->zip.$separator;
|
||||||
|
//BUDI
|
||||||
|
print substr($soc->town, 0, 40).$separator;
|
||||||
|
//CPAY
|
||||||
|
print $separator;
|
||||||
|
//PAYS
|
||||||
|
print substr(getCountry($soc->fk_pays), 0, 40).$separator;
|
||||||
|
//NTEL
|
||||||
|
print $soc->phone.$separator;
|
||||||
|
//TLEX
|
||||||
|
print $separator;
|
||||||
|
//TLPO
|
||||||
|
print $separator;
|
||||||
|
//TLCY
|
||||||
|
print $separator;
|
||||||
|
//NINT
|
||||||
|
print $separator;
|
||||||
|
//COMM
|
||||||
|
print $separator;
|
||||||
|
//SIRE
|
||||||
|
print $soc->siret.$separator;
|
||||||
|
//RIBP
|
||||||
|
print $separator;
|
||||||
|
//DOBQ
|
||||||
|
print $separator;
|
||||||
|
//IBBQ
|
||||||
|
print $separator;
|
||||||
|
//COBQ
|
||||||
|
print $separator;
|
||||||
|
//GUBQ
|
||||||
|
print $separator;
|
||||||
|
//CPBQ
|
||||||
|
print $separator;
|
||||||
|
//CLBQ
|
||||||
|
print $separator;
|
||||||
|
//BIBQ
|
||||||
|
print $separator;
|
||||||
|
//MOPM
|
||||||
|
print $separator;
|
||||||
|
//DJPM
|
||||||
|
print $separator;
|
||||||
|
//DMPM
|
||||||
|
print $separator;
|
||||||
|
//REFM
|
||||||
|
print $separator;
|
||||||
|
//SLVA
|
||||||
|
print $separator;
|
||||||
|
//PLCR
|
||||||
|
print $separator;
|
||||||
|
//ECFI
|
||||||
|
print $separator;
|
||||||
|
//CREP
|
||||||
|
print $separator;
|
||||||
|
//NREP
|
||||||
|
print $separator;
|
||||||
|
//TREP
|
||||||
|
print $separator;
|
||||||
|
//MREP
|
||||||
|
print $separator;
|
||||||
|
//GRRE
|
||||||
|
print $separator;
|
||||||
|
//LTTA
|
||||||
|
print $separator;
|
||||||
|
//CACT
|
||||||
|
print $separator;
|
||||||
|
//CODV
|
||||||
|
print $separator;
|
||||||
|
//GRTR
|
||||||
|
print $separator;
|
||||||
|
//NOFP
|
||||||
|
print $separator;
|
||||||
|
//BQAF
|
||||||
|
print $separator;
|
||||||
|
//BONP
|
||||||
|
print $separator;
|
||||||
|
//CESC
|
||||||
|
print $separator;
|
||||||
|
|
||||||
|
print $end_line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||||
|
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||||
|
$date_lim_reglement = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||||
|
|
||||||
|
// TYPE E
|
||||||
|
$type_enregistrement = 'E'; // For write movement
|
||||||
|
print $type_enregistrement.$separator;
|
||||||
|
// JNAL
|
||||||
|
print substr($line->code_journal, 0, 2).$separator;
|
||||||
|
// NECR
|
||||||
|
print $line->id.$separator;
|
||||||
|
// NPIE
|
||||||
|
print $line->piece_num.$separator;
|
||||||
|
// DATP
|
||||||
|
print $date_document.$separator;
|
||||||
|
// LIBE
|
||||||
|
print dol_trunc($line->label_operation, 25, 'right', 'UTF-8', 1).$separator;
|
||||||
|
// DATH
|
||||||
|
print $date_lim_reglement.$separator;
|
||||||
|
// CNPI
|
||||||
|
if ($line->doc_type == 'supplier_invoice') {
|
||||||
|
if ($line->montant < 0) {
|
||||||
|
$nature_piece = 'AF';
|
||||||
|
} else {
|
||||||
|
$nature_piece = 'FF';
|
||||||
|
}
|
||||||
|
} elseif ($line->doc_type == 'customer_invoice') {
|
||||||
|
if ($line->montant < 0) {
|
||||||
|
$nature_piece = 'AC';
|
||||||
|
} else {
|
||||||
|
$nature_piece = 'FC';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$nature_piece = '';
|
||||||
|
}
|
||||||
|
print $nature_piece.$separator;
|
||||||
|
// RACI
|
||||||
|
// if (! empty($line->subledger_account)) {
|
||||||
|
// if ($line->doc_type == 'supplier_invoice') {
|
||||||
|
// $racine_subledger_account = '40';
|
||||||
|
// } elseif ($line->doc_type == 'customer_invoice') {
|
||||||
|
// $racine_subledger_account = '41';
|
||||||
|
// } else {
|
||||||
|
// $racine_subledger_account = '';
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
$racine_subledger_account = ''; // for records of type E leave this field blank
|
||||||
|
// }
|
||||||
|
|
||||||
|
print $racine_subledger_account . $separator; // deprecated CPTG & CPTA use instead
|
||||||
|
// MONT
|
||||||
|
print price(abs($line->montant), 0, '', 1, 2).$separator;
|
||||||
|
// CODC
|
||||||
|
print $line->sens.$separator;
|
||||||
|
// CPTG
|
||||||
|
print length_accountg($line->numero_compte).$separator;
|
||||||
|
// DATE
|
||||||
|
print $date_document.$separator;
|
||||||
|
// CLET
|
||||||
|
print $line->lettering_code.$separator;
|
||||||
|
// DATL
|
||||||
|
print $line->date_lettering.$separator;
|
||||||
|
// CPTA
|
||||||
|
if (!empty($line->subledger_account)) {
|
||||||
|
print length_accounta($line->subledger_account).$separator;
|
||||||
|
} else {
|
||||||
|
print $separator;
|
||||||
|
}
|
||||||
|
// CNAT
|
||||||
|
if ($line->doc_type == 'supplier_invoice' && !empty($line->subledger_account)) {
|
||||||
|
print 'F'.$separator;
|
||||||
|
} elseif ($line->doc_type == 'customer_invoice' && !empty($line->subledger_account)) {
|
||||||
|
print 'C'.$separator;
|
||||||
|
} else {
|
||||||
|
print $separator;
|
||||||
|
}
|
||||||
|
// SECT
|
||||||
|
print $separator;
|
||||||
|
// CTRE
|
||||||
|
print $separator;
|
||||||
|
// NORL
|
||||||
|
print $separator;
|
||||||
|
// DATV
|
||||||
|
print $separator;
|
||||||
|
// REFD
|
||||||
|
print $line->doc_ref.$separator;
|
||||||
|
// NECA
|
||||||
|
print '0'.$separator;
|
||||||
|
// CSEC
|
||||||
|
print $separator;
|
||||||
|
// CAFF
|
||||||
|
print $separator;
|
||||||
|
// CDES
|
||||||
|
print $separator;
|
||||||
|
// QTUE
|
||||||
|
print '0'.$separator;
|
||||||
|
// MTDV
|
||||||
|
print $separator;
|
||||||
|
// CODV
|
||||||
|
print '0'.$separator;
|
||||||
|
// TXDV
|
||||||
|
print $separator;
|
||||||
|
// MOPM
|
||||||
|
print $separator;
|
||||||
|
// BONP
|
||||||
|
print $separator;
|
||||||
|
// BQAF
|
||||||
|
print $separator;
|
||||||
|
// ECES
|
||||||
|
print $separator;
|
||||||
|
// TXTL
|
||||||
|
print $separator;
|
||||||
|
// ECRM
|
||||||
|
print $separator;
|
||||||
|
// DATK
|
||||||
|
print $separator;
|
||||||
|
// HEUK
|
||||||
|
print $separator;
|
||||||
|
|
||||||
|
print $end_line;
|
||||||
|
|
||||||
|
$last_codeinvoice = $line->doc_ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : Charlemagne
|
* Export format : Charlemagne
|
||||||
*
|
*
|
||||||
|
|||||||
@ -135,6 +135,11 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $active;
|
public $active;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int reconciliable
|
||||||
|
*/
|
||||||
|
public $reconciliable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -162,7 +167,7 @@ class AccountingAccount extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if ($rowid || $account_number) {
|
if ($rowid || $account_number) {
|
||||||
$sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active";
|
$sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconciliable";
|
||||||
$sql .= ", ca.label as category_label";
|
$sql .= ", ca.label as category_label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as ca ON a.fk_accounting_category = ca.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as ca ON a.fk_accounting_category = ca.rowid";
|
||||||
@ -203,6 +208,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$this->fk_user_modif = $obj->fk_user_modif;
|
$this->fk_user_modif = $obj->fk_user_modif;
|
||||||
$this->active = $obj->active;
|
$this->active = $obj->active;
|
||||||
$this->status = $obj->active;
|
$this->status = $obj->active;
|
||||||
|
$this->reconciliable = $obj->reconciliable;
|
||||||
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
} else {
|
} else {
|
||||||
@ -261,6 +267,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= ", fk_accounting_category";
|
$sql .= ", fk_accounting_category";
|
||||||
$sql .= ", fk_user_author";
|
$sql .= ", fk_user_author";
|
||||||
$sql .= ", active";
|
$sql .= ", active";
|
||||||
|
$sql .= ", reconciliable";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= " '" . $this->db->idate($now) . "'";
|
$sql .= " '" . $this->db->idate($now) . "'";
|
||||||
$sql .= ", " . $conf->entity;
|
$sql .= ", " . $conf->entity;
|
||||||
@ -273,6 +280,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
$sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||||
$sql .= ", " . $user->id;
|
$sql .= ", " . $user->id;
|
||||||
$sql .= ", " . (int) $this->active;
|
$sql .= ", " . (int) $this->active;
|
||||||
|
$sql .= ", " . (int) $this->reconciliable;
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -340,6 +348,7 @@ class AccountingAccount extends CommonObject
|
|||||||
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||||
$sql .= " , fk_user_modif = " . $user->id;
|
$sql .= " , fk_user_modif = " . $user->id;
|
||||||
$sql .= " , active = " . (int) $this->active;
|
$sql .= " , active = " . (int) $this->active;
|
||||||
|
$sql .= " , reconciliable = " . (int) $this->reconciliable;
|
||||||
$sql .= " WHERE rowid = " . $this->id;
|
$sql .= " WHERE rowid = " . $this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
||||||
@ -565,21 +574,31 @@ class AccountingAccount extends CommonObject
|
|||||||
* Account deactivated
|
* Account deactivated
|
||||||
*
|
*
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
|
* @param int $mode 0=field active, 1=field active_customer_list, 2=field_active_supplier_list
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function account_desactivate($id)
|
public function account_desactivate($id, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
|
|
||||||
|
if ($mode == 0)
|
||||||
|
{
|
||||||
|
$fieldtouse = 'active';
|
||||||
|
}
|
||||||
|
elseif ($mode == 1)
|
||||||
|
{
|
||||||
|
$fieldtouse = 'reconciliable';
|
||||||
|
}
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||||
$sql .= "SET active = '0'";
|
$sql .= "SET " . $fieldtouse . " = '0'";
|
||||||
$sql .= " WHERE rowid = " . $this->db->escape($id);
|
$sql .= " WHERE rowid = " . $this->db->escape($id);
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::desactivate sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::account_desactivate " . $fieldtouse . " sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -600,18 +619,28 @@ class AccountingAccount extends CommonObject
|
|||||||
* Account activated
|
* Account activated
|
||||||
*
|
*
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
|
* @param int $mode 0=field active, 1=field reconciliable, 2=field active_customer_list, 3=field_active_supplier_list
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function account_activate($id)
|
public function account_activate($id, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
if ($mode == 0)
|
||||||
|
{
|
||||||
|
$fieldtouse = 'active';
|
||||||
|
}
|
||||||
|
elseif ($mode == 1)
|
||||||
|
{
|
||||||
|
$fieldtouse = 'reconciliable';
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||||
$sql .= "SET active = '1'";
|
$sql .= "SET " . $fieldtouse . " = '1'";
|
||||||
$sql .= " WHERE rowid = " . $this->db->escape($id);
|
$sql .= " WHERE rowid = " . $this->db->escape($id);
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::activate sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::account_activate " . $fieldtouse . " sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|||||||
@ -122,8 +122,8 @@ if ($action == 'validatehistory') {
|
|||||||
// Customer Invoice lines (must be same request than into page list.php for manual binding)
|
// Customer Invoice lines (must be same request than into page list.php for manual binding)
|
||||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
||||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,";
|
||||||
$sql .= " p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.tva_intra";
|
||||||
@ -154,14 +154,22 @@ if ($action == 'validatehistory') {
|
|||||||
|
|
||||||
$isBuyerInEEC = isInEEC($objp);
|
$isBuyerInEEC = isInEEC($objp);
|
||||||
|
|
||||||
// Search suggested account for product/service
|
// Search suggested account for product/service (similar code exists in page list.php to make manual binding)
|
||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$objp->aarowid_suggest = $objp->aarowid;
|
||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT
|
||||||
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid;
|
||||||
|
$suggestedaccountingaccountfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||||
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
|
$objp->aarowid_suggest = 0; // There is a doubt, no automatic binding
|
||||||
|
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
$objp->code_sell_p = $objp->code_sell_intra;
|
$objp->code_sell_p = $objp->code_sell_intra;
|
||||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||||
$suggestedaccountingaccountfor = 'eec';
|
$suggestedaccountingaccountfor = 'eec';
|
||||||
|
|||||||
@ -60,7 +60,7 @@ $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) $page = 0;
|
if (empty($page) || $page < 0) $page = 0;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|||||||
@ -69,7 +69,7 @@ $btn_ventil = GETPOST('ventil', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
if (empty($page) || $page < 0) { $page = 0; }
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -206,8 +206,10 @@ if (empty($chartaccountcode))
|
|||||||
// Customer Invoice lines
|
// Customer Invoice lines
|
||||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
||||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,";
|
||||||
$sql .= " p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||||
|
$sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_export,";
|
||||||
|
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||||
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.tva_intra";
|
||||||
@ -399,7 +401,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||||
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
|
||||||
$checkpicto = '';
|
$checkpicto = '';
|
||||||
if ($massactionbutton) $checkpicto = $form->showCheckAddButtons('checkforselect', 1);
|
if ($massactionbutton) $checkpicto = $form->showCheckAddButtons('checkforselect', 1);
|
||||||
@ -423,6 +425,14 @@ if ($result) {
|
|||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
$product_static->type = $objp->type;
|
$product_static->type = $objp->type;
|
||||||
$product_static->label = $objp->product_label;
|
$product_static->label = $objp->product_label;
|
||||||
|
$product_static->status = $objp->status;
|
||||||
|
$product_static->status_buy = $objp->status_buy;
|
||||||
|
$product_static->accountancy_code_sell = $objp->code_sell;
|
||||||
|
$product_static->accountancy_code_sell_intra = $objp->code_sell_intra;
|
||||||
|
$product_static->accountancy_code_sell_export = $objp->code_sell_export;
|
||||||
|
$product_static->accountancy_code_buy = $objp->code_buy;
|
||||||
|
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
||||||
|
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
||||||
|
|
||||||
$facture_static->ref = $objp->ref;
|
$facture_static->ref = $objp->ref;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
@ -433,13 +443,20 @@ if ($result) {
|
|||||||
|
|
||||||
$isBuyerInEEC = isInEEC($objp);
|
$isBuyerInEEC = isInEEC($objp);
|
||||||
|
|
||||||
|
// Search suggested default account for product/service
|
||||||
$suggestedaccountingaccountbydefaultfor = '';
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
if ($objp->type_l == 1) {
|
if ($objp->type_l == 1) {
|
||||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||||
$suggestedaccountingaccountbydefaultfor = '';
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT
|
||||||
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||||
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||||
} else { // Foreign sale
|
} else { // Foreign sale
|
||||||
@ -452,7 +469,13 @@ if ($result) {
|
|||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
$suggestedaccountingaccountbydefaultfor = '';
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT
|
||||||
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||||
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
|
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
|
||||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||||
} else {
|
} else {
|
||||||
@ -463,14 +486,22 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
if ($objp->code_sell_l == -1) $objp->code_sell_l = '';
|
if ($objp->code_sell_l == -1) $objp->code_sell_l = '';
|
||||||
|
|
||||||
// Search suggested account for product/service
|
// Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
$objp->code_sell_p = $objp->code_sell;
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$objp->aarowid_suggest = $objp->aarowid;
|
||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT
|
||||||
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid;
|
||||||
|
$suggestedaccountingaccountfor = 'eecwithvat';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||||
|
$objp->code_sell_p = $objp->code_sell;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ?
|
||||||
|
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
||||||
|
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
$objp->code_sell_p = $objp->code_sell_intra;
|
$objp->code_sell_p = $objp->code_sell_intra;
|
||||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||||
$suggestedaccountingaccountfor = 'eec';
|
$suggestedaccountingaccountfor = 'eec';
|
||||||
@ -487,6 +518,7 @@ if ($result) {
|
|||||||
$code_sell_p_notset = 'color:orange';
|
$code_sell_p_notset = 'color:orange';
|
||||||
}
|
}
|
||||||
if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) $code_sell_p_notset = 'color:red';
|
if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) $code_sell_p_notset = 'color:red';
|
||||||
|
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) $code_sell_p_notset = 'color:orange';
|
||||||
|
|
||||||
// $objp->code_sell_l is now default code of product/service
|
// $objp->code_sell_l is now default code of product/service
|
||||||
// $objp->code_sell_p is now code of product/service
|
// $objp->code_sell_p is now code of product/service
|
||||||
@ -503,9 +535,10 @@ if ($result) {
|
|||||||
|
|
||||||
// Ref Product
|
// Ref Product
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($product_static->id > 0)
|
if ($product_static->id > 0) {
|
||||||
print $product_static->getNomUrl(1);
|
print $product_static->getNomUrl(1);
|
||||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
}
|
||||||
|
if ($objp->product_label) print '<br><span class="opacitymedium">'.$objp->product_label.'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflowonsmartphone">';
|
print '<td class="tdoverflowonsmartphone">';
|
||||||
@ -535,7 +568,7 @@ if ($result) {
|
|||||||
|
|
||||||
// Current account
|
// Current account
|
||||||
print '<td class="center" style="'.$code_sell_p_notset.'">';
|
print '<td class="center" style="'.$code_sell_p_notset.'">';
|
||||||
$s = (($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
||||||
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
||||||
@ -544,9 +577,11 @@ if ($result) {
|
|||||||
if ($objp->product_id > 0)
|
if ($objp->product_id > 0)
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$s = (($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
||||||
|
elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT");
|
||||||
|
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber");
|
||||||
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
||||||
$s .= (empty($objp->code_sell_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_sell_p));
|
$s .= (empty($objp->code_sell_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_sell_p));
|
||||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||||
@ -582,6 +617,7 @@ if ($result) {
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
//var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest);
|
//var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest);
|
||||||
$ischecked = $objp->aarowid_suggest;
|
$ischecked = $objp->aarowid_suggest;
|
||||||
|
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $ischecked = 0;
|
||||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="'.$objp->rowid."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="'.$objp->rowid."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ $search_year = GETPOST("search_year", "int");
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) $page = 0;
|
if (empty($page) || $page < 0) $page = 0;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $search_year = GETPOST("search_year", "int");
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
if (empty($page) || $page < 0) { $page = 0; }
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -313,8 +313,8 @@ if ($result) {
|
|||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||||
print_liste_field_titre("IntoAccount", '', '', '', '', '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', '');
|
||||||
$checkpicto = '';
|
$checkpicto = '';
|
||||||
if ($massactionbutton) $checkpicto = $form->showCheckAddButtons('checkforselect', 1);
|
if ($massactionbutton) $checkpicto = $form->showCheckAddButtons('checkforselect', 1);
|
||||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
@ -366,12 +366,12 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Current account
|
// Current account
|
||||||
print '<td class="center">';
|
print '<td>';
|
||||||
print length_accountg(html_entity_decode($objp->code_buy));
|
print length_accountg(html_entity_decode($objp->code_buy));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Suggested accounting account
|
// Suggested accounting account
|
||||||
print '<td class="center">';
|
print '<td>';
|
||||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ if ($conf->accounting->enabled)
|
|||||||
|
|
||||||
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||||
|
|
||||||
$helpisexpanded = empty($resultboxes['boxactivated']); // If there is no widget, the tooltip help is expanded by default.
|
$helpisexpanded = empty($resultboxes['boxactivated']) || (empty($resultboxes['boxlista']) && empty($resultboxes['boxlistb'])); // If there is no widget, the tooltip help is expanded by default.
|
||||||
$showtutorial = '';
|
$showtutorial = '';
|
||||||
|
|
||||||
if (!$helpisexpanded)
|
if (!$helpisexpanded)
|
||||||
@ -222,10 +222,6 @@ if ($conf->accounting->enabled)
|
|||||||
$boxlist .= '<div class="twocolumns">';
|
$boxlist .= '<div class="twocolumns">';
|
||||||
|
|
||||||
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
||||||
if (!empty($nbworkboardcount))
|
|
||||||
{
|
|
||||||
$boxlist .= $boxwork;
|
|
||||||
}
|
|
||||||
|
|
||||||
$boxlist .= $resultboxes['boxlista'];
|
$boxlist .= $resultboxes['boxlista'];
|
||||||
|
|
||||||
@ -233,7 +229,6 @@ if ($conf->accounting->enabled)
|
|||||||
|
|
||||||
$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
|
$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
|
||||||
|
|
||||||
$boxlist .= $boxstat;
|
|
||||||
$boxlist .= $resultboxes['boxlistb'];
|
$boxlist .= $resultboxes['boxlistb'];
|
||||||
|
|
||||||
$boxlist .= '</div>';
|
$boxlist .= '</div>';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* 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) 2013-2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014 Juanjo Menent <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
|
||||||
@ -119,8 +119,9 @@ if ($action == 'validatehistory') {
|
|||||||
// Supplier Invoice Lines (must be same request than into page list.php for manual binding)
|
// Supplier Invoice Lines (must be same request than into page list.php for manual binding)
|
||||||
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
|
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
|
||||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
|
||||||
$sql .= " aa.rowid as aarowid,";
|
$sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_export, p.tva_tx as tva_tx_prod,";
|
||||||
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.tva_intra";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
@ -129,6 +130,8 @@ if ($action == 'validatehistory') {
|
|||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||||
$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."accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$chartaccountcode."' AND aa.entity = ".$conf->entity;
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$chartaccountcode."' AND aa.entity = ".$conf->entity;
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$chartaccountcode."' AND aa2.entity = ".$conf->entity;
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$chartaccountcode."' AND aa3.entity = ".$conf->entity;
|
||||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||||
$sql .= " AND l.product_type <= 2";
|
$sql .= " AND l.product_type <= 2";
|
||||||
|
|
||||||
@ -157,16 +160,12 @@ if ($action == 'validatehistory') {
|
|||||||
$suggestedaccountingaccountfor = '';
|
$suggestedaccountingaccountfor = '';
|
||||||
} else {
|
} else {
|
||||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
//$objp->code_buy_p = $objp->code_buy_intra;
|
$objp->code_buy_p = $objp->code_buy_intra;
|
||||||
$objp->code_buy_p = $objp->code_buy;
|
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||||
//$objp->aarowid_suggest = $objp->aarowid_intra;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
|
||||||
$suggestedaccountingaccountfor = 'eec';
|
$suggestedaccountingaccountfor = 'eec';
|
||||||
} else { // Foreign sale
|
} else { // Foreign sale
|
||||||
//$objp->code_buy_p = $objp->code_buy_export;
|
$objp->code_buy_p = $objp->code_buy_export;
|
||||||
$objp->code_buy_p = $objp->code_buy;
|
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||||
//$objp->aarowid_suggest = $objp->aarowid_export;
|
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
|
||||||
$suggestedaccountingaccountfor = 'export';
|
$suggestedaccountingaccountfor = 'export';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) $page = 0;
|
if (empty($page) || $page < 0) $page = 0;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -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-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 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>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
|
||||||
@ -69,7 +69,7 @@ $btn_ventil = GETPOST('ventil', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
if (empty($page) || $page < 0) { $page = 0; }
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -210,8 +210,11 @@ if (empty($chartaccountcode))
|
|||||||
// Supplier Invoice Lines
|
// Supplier Invoice Lines
|
||||||
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
|
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
|
||||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,";
|
||||||
$sql .= " aa.rowid as aarowid,";
|
$sql .= " p.accountancy_code_sell as code_sell, p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||||
|
$sql .= " p.accountancy_code_buy as code_buy, p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_export,";
|
||||||
|
$sql .= " p.tosell as status, p.tobuy as status_buy,";
|
||||||
|
$sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||||
$sql .= " co.code as country_code, co.label as country_label,";
|
$sql .= " co.code as country_code, co.label as country_label,";
|
||||||
$sql .= " s.tva_intra";
|
$sql .= " s.tva_intra";
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
@ -222,7 +225,9 @@ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||||
$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."accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$chartaccountcode."' AND aa.entity = ".$conf->entity;
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$chartaccountcode."' AND aa.entity = ".$conf->entity;
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$chartaccountcode."' AND aa2.entity = ".$conf->entity;
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$chartaccountcode."' AND aa3.entity = ".$conf->entity;
|
||||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||||
$sql .= " AND l.product_type <= 2";
|
$sql .= " AND l.product_type <= 2";
|
||||||
// Add search filter like
|
// Add search filter like
|
||||||
@ -396,7 +401,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
|
||||||
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center ');
|
||||||
$checkpicto = '';
|
$checkpicto = '';
|
||||||
if ($massactionbutton) $checkpicto = $form->showCheckAddButtons('checkforselect', 1);
|
if ($massactionbutton) $checkpicto = $form->showCheckAddButtons('checkforselect', 1);
|
||||||
@ -414,40 +419,86 @@ if ($result) {
|
|||||||
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
|
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
|
||||||
$objp->code_buy_l = '';
|
$objp->code_buy_l = '';
|
||||||
$objp->code_buy_p = '';
|
$objp->code_buy_p = '';
|
||||||
$objp->aarowid_suggest = '';
|
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
$product_static->type = $objp->type;
|
$product_static->type = $objp->type;
|
||||||
$product_static->label = $objp->product_label;
|
$product_static->label = $objp->product_label;
|
||||||
|
$product_static->status = $objp->status;
|
||||||
|
$product_static->status_buy = $objp->status_buy;
|
||||||
|
$product_static->accountancy_code_sell = $objp->code_sell;
|
||||||
|
$product_static->accountancy_code_sell_intra = $objp->code_sell_intra;
|
||||||
|
$product_static->accountancy_code_sell_export = $objp->code_sell_export;
|
||||||
|
$product_static->accountancy_code_buy = $objp->code_buy;
|
||||||
|
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
||||||
|
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
||||||
|
|
||||||
$facturefourn_static->ref = $objp->ref;
|
$facturefourn_static->ref = $objp->ref;
|
||||||
$facturefourn_static->id = $objp->facid;
|
$facturefourn_static->id = $objp->facid;
|
||||||
$facturefourn_static->type = $objp->type;
|
$facturefourn_static->type = $objp->type;
|
||||||
|
|
||||||
$code_buy_p_notset = '';
|
$code_buy_p_notset = '';
|
||||||
$objp->aarowid_suggest = $objp->aarowid;
|
$objp->aarowid_suggest = ''; // Will be set later
|
||||||
|
|
||||||
|
$isBuyerInEEC = isInEEC($objp);
|
||||||
|
|
||||||
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
if ($objp->type_l == 1) {
|
if ($objp->type_l == 1) {
|
||||||
|
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : '');
|
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : '');
|
||||||
if ($objp->aarowid == '')
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
$objp->aarowid_suggest = $aarowid_s;
|
} else {
|
||||||
} elseif ($objp->type_l == 0) {
|
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : '');
|
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT : '');
|
||||||
if ($objp->aarowid == '')
|
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||||
$objp->aarowid_suggest = $aarowid_p;
|
} else { // Foreign sale
|
||||||
|
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||||
}
|
}
|
||||||
if ($objp->code_buy_l == -1) $objp->code_buy_l = '';
|
}
|
||||||
|
} elseif ($objp->type_l == 0) {
|
||||||
|
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
|
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = '';
|
||||||
|
} else {
|
||||||
|
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
|
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||||
|
} else {
|
||||||
|
$objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT : '');
|
||||||
|
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($objp->code_sell_l == -1) $objp->code_sell_l = '';
|
||||||
|
|
||||||
if (!empty($objp->code_buy)) {
|
// Search suggested account for product/service
|
||||||
$objp->code_buy_p = $objp->code_buy; // Code on product
|
$suggestedaccountingaccountfor = '';
|
||||||
|
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||||
|
$objp->code_buy_p = $objp->code_buy;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid;
|
||||||
|
$suggestedaccountingaccountfor = '';
|
||||||
|
} else {
|
||||||
|
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||||
|
$objp->code_buy_p = $objp->code_buy_intra;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||||
|
$suggestedaccountingaccountfor = 'eec';
|
||||||
|
} else { // Foreign sale
|
||||||
|
$objp->code_buy_p = $objp->code_buy_export;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||||
|
$suggestedaccountingaccountfor = 'export';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($objp->code_buy_p)) {
|
||||||
|
// Value was defined previously
|
||||||
} else {
|
} else {
|
||||||
$code_buy_p_notset = 'color:orange';
|
$code_buy_p_notset = 'color:orange';
|
||||||
}
|
}
|
||||||
if (empty($objp->code_buy_l) && empty($objp->code_buy_p)) $code_buy_p_notset = 'color:red';
|
if (empty($objp->code_buy_l) && empty($objp->code_buy_p)) $code_buy_p_notset = 'color:red';
|
||||||
|
|
||||||
// $objp->code_buy_p is now code of product/service
|
|
||||||
// $objp->code_buy_l is now default code of product/service
|
// $objp->code_buy_l is now default code of product/service
|
||||||
|
// $objp->code_buy_p is now code of product/service
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -467,7 +518,7 @@ if ($result) {
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if ($product_static->id > 0)
|
if ($product_static->id > 0)
|
||||||
print $product_static->getNomUrl(1);
|
print $product_static->getNomUrl(1);
|
||||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
if ($objp->product_label) print '<br><span class="opacitymedium">'.$objp->product_label.'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
@ -498,8 +549,8 @@ if ($result) {
|
|||||||
print '<td>'.$objp->tva_intra.'</td>';
|
print '<td>'.$objp->tva_intra.'</td>';
|
||||||
|
|
||||||
// Current account
|
// Current account
|
||||||
print '<td class="center" style="'.$code_buy_p_notset.'">';
|
print '<td style="'.$code_buy_p_notset.'">';
|
||||||
$s = (($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
||||||
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
||||||
@ -508,7 +559,7 @@ if ($result) {
|
|||||||
if ($objp->product_id > 0)
|
if ($objp->product_id > 0)
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$s = (($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': </span>';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
||||||
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
||||||
@ -520,6 +571,21 @@ if ($result) {
|
|||||||
// Suggested accounting account
|
// Suggested accounting account
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$suggestedid = $objp->aarowid_suggest;
|
$suggestedid = $objp->aarowid_suggest;
|
||||||
|
if (empty($suggestedid) && empty($objp->code_buy_p) && !empty($objp->code_buy_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC))
|
||||||
|
{
|
||||||
|
if (empty($accountingaccount_codetotid_cache[$objp->code_buy_l]))
|
||||||
|
{
|
||||||
|
$tmpaccount = new AccountingAccount($db);
|
||||||
|
$tmpaccount->fetch(0, $objp->code_buy_l, 1);
|
||||||
|
if ($tmpaccount->id > 0) {
|
||||||
|
$suggestedid = $tmpaccount->id;
|
||||||
|
}
|
||||||
|
$accountingaccount_codetotid_cache[$objp->code_buy_l] = $tmpaccount->id;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$suggestedid = $accountingaccount_codetotid_cache[$objp->code_buy_l];
|
||||||
|
}
|
||||||
|
}
|
||||||
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -540,6 +606,9 @@ if ($result) {
|
|||||||
} else {
|
} else {
|
||||||
print $db->error();
|
print $db->error();
|
||||||
}
|
}
|
||||||
|
if ($db->type == 'mysqli') {
|
||||||
|
$db->query("SET SQL_BIG_SELECTS=0"); // Enable MAX_JOIN_SIZE limitation
|
||||||
|
}
|
||||||
|
|
||||||
// Add code to auto check the box when we select an account
|
// Add code to auto check the box when we select an account
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('rowid', 'int');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -1356,7 +1356,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.fk_adherent, c.subscription, c.note, c.fk_bank,";
|
$sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note, c.fk_bank,";
|
||||||
$sql .= " c.tms as datem,";
|
$sql .= " c.tms as datem,";
|
||||||
$sql .= " c.datec as datec,";
|
$sql .= " c.datec as datec,";
|
||||||
$sql .= " c.dateadh as dateh,";
|
$sql .= " c.dateadh as dateh,";
|
||||||
@ -1386,6 +1386,7 @@ class Adherent extends CommonObject
|
|||||||
$subscription = new Subscription($this->db);
|
$subscription = new Subscription($this->db);
|
||||||
$subscription->id = $obj->rowid;
|
$subscription->id = $obj->rowid;
|
||||||
$subscription->fk_adherent = $obj->fk_adherent;
|
$subscription->fk_adherent = $obj->fk_adherent;
|
||||||
|
$subscription->fk_type = $obj->fk_type;
|
||||||
$subscription->amount = $obj->subscription;
|
$subscription->amount = $obj->subscription;
|
||||||
$subscription->note = $obj->note;
|
$subscription->note = $obj->note;
|
||||||
$subscription->fk_bank = $obj->fk_bank;
|
$subscription->fk_bank = $obj->fk_bank;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $result=restrictedArea($user, 'adherent', $id);
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page ;
|
$offset = $conf->liste_limit * $page ;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -176,11 +176,9 @@ if ($conf->use_javascript_ajax)
|
|||||||
$SommeD = 0;
|
$SommeD = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$dataval = array();
|
$dataval = array();
|
||||||
$datalabels = array();
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
foreach ($AdherentType as $key => $adhtype)
|
||||||
{
|
{
|
||||||
$datalabels[] = array($i, $adhtype->getNomUrl(0, dol_size(16)));
|
|
||||||
$dataval['draft'][] = array($i, isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0);
|
$dataval['draft'][] = array($i, isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0);
|
||||||
$dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0);
|
$dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0);
|
||||||
$dataval['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0);
|
$dataval['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0);
|
||||||
@ -198,13 +196,16 @@ if ($conf->use_javascript_ajax)
|
|||||||
$dataseries[] = array($langs->trans("MembersStatusResiliated"), round($SommeD));
|
$dataseries[] = array($langs->trans("MembersStatusResiliated"), round($SommeD));
|
||||||
$dataseries[] = array($langs->trans("MembersStatusToValid"), round($SommeA));
|
$dataseries[] = array($langs->trans("MembersStatusToValid"), round($SommeA));
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
$dolgraph->setShowLegend(1);
|
$dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus6, '-'.$badgeStatus0));
|
||||||
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
$dolgraph->setWidth('100%');
|
$dolgraph->setHeight('200');
|
||||||
$dolgraph->draw('idgraphstatus');
|
$dolgraph->draw('idgraphstatus');
|
||||||
print $dolgraph->show($total ? 0 : 1);
|
print $dolgraph->show($total ? 0 : 1);
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if ($statut < -1) $statut = '';
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -49,7 +49,7 @@ $typeid = GETPOST('typeid', 'int');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -54,7 +54,7 @@ $date_select = GETPOST("date_select", 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -50,7 +50,7 @@ $status = GETPOST('status', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $constnote=GETPOST('constnote', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'createform'; // 'cre
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -70,7 +70,7 @@ $active = 1;
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -767,7 +767,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
|
|
||||||
if ($keycode == 'sortorder') // For column name 'sortorder', we use the field name 'position'
|
if ($keycode == 'sortorder') // For column name 'sortorder', we use the field name 'position'
|
||||||
{
|
{
|
||||||
$sql .= "'".(int) GETPOST('position', 'int');
|
$sql .= "'".(int) GETPOST('position', 'int')."'";
|
||||||
}
|
}
|
||||||
elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = ''
|
elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = ''
|
||||||
elseif ($keycode == 'content') {
|
elseif ($keycode == 'content') {
|
||||||
|
|||||||
@ -53,7 +53,7 @@ $id = GETPOST('id', 'int');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -156,7 +156,6 @@ if ($action == 'update')
|
|||||||
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
//dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
|
||||||
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $id = GETPOST('id', 'int');
|
|||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -71,7 +71,7 @@ $active = 1;
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -197,6 +197,7 @@ dol_fiche_end();
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("TicketNumberingModules"));
|
print load_fiche_titre($langs->trans("TicketNumberingModules"));
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||||
@ -287,7 +288,9 @@ foreach ($dirmodels as $reldir) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
if (!$conf->use_javascript_ajax) {
|
if (!$conf->use_javascript_ajax) {
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
||||||
|
|||||||
@ -167,7 +167,7 @@ $head = ticketAdminPrepareHead();
|
|||||||
|
|
||||||
dol_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
|
dol_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a href="'.dol_buildpath('/public/ticket/index.php', 1).'" target="_blank" >'.dol_buildpath('/public/ticket/index.php', 2).'</a>';
|
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.dol_buildpath('/public/ticket/index.php', 1).'" target="_blank" >'.dol_buildpath('/public/ticket/index.php', 2).'</a>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
@ -176,14 +176,14 @@ $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
|
|||||||
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||||
{
|
{
|
||||||
// Button off, click to enable
|
// Button off, click to enable
|
||||||
$enabledisablehtml .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&value=1'.$param.'">';
|
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&value=1'.$param.'">';
|
||||||
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
|
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
$enabledisablehtml .= '</a>';
|
$enabledisablehtml .= '</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Button on, click to disable
|
// Button on, click to disable
|
||||||
$enabledisablehtml .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&value=0'.$param.'">';
|
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&value=0'.$param.'">';
|
||||||
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
|
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
$enabledisablehtml .= '</a>';
|
$enabledisablehtml .= '</a>';
|
||||||
}
|
}
|
||||||
@ -200,6 +200,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
|||||||
print '<input type="hidden" name="action" value="setvarother">';
|
print '<input type="hidden" name="action" value="setvarother">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
@ -279,7 +280,9 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
if (!$conf->use_javascript_ajax) {
|
if (!$conf->use_javascript_ajax) {
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -288,6 +291,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
|||||||
// Admin var of module
|
// Admin var of module
|
||||||
print load_fiche_titre($langs->trans("TicketParamMail"));
|
print load_fiche_titre($langs->trans("TicketParamMail"));
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
|
||||||
@ -369,13 +373,14 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
|||||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||||
print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
|
print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$conf->global->TICKET_URL_PUBLIC_INTERFACE.'" size="40" ></td>';
|
print '<input type="text" class="minwidth500" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$conf->global->TICKET_URL_PUBLIC_INTERFACE.'"></td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ $action = GETPOST('action', 'alpha');
|
|||||||
|
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (!$sortorder) $sortorder = "DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (!$sortfield) $sortfield = "date";
|
if (!$sortfield) $sortfield = "date";
|
||||||
if (empty($page) || $page == -1) { $page = 0; }
|
if (empty($page) || $page == -1) { $page = 0; }
|
||||||
|
|||||||
@ -39,7 +39,7 @@ $file=GETPOST('filename_template', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);
|
|||||||
|
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortfield) $sortfield="date";
|
if (! $sortfield) $sortfield="date";
|
||||||
if ($page < 0) { $page = 0; }
|
if ($page < 0) { $page = 0; }
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $langs->loadLangs(array("companies", "admin", "users", "other"));
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if ($user->socid > 0)
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page ;
|
$offset = $conf->liste_limit * $page ;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ $mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'overwrite';
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ $status = 1;
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $status = 1;
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -49,7 +49,7 @@ $id = GETPOST('id', 'int');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $type = GETPOST('type', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if (($search_start == -1 || empty($search_start)) && ! GETPOSTISSET('search_star
|
|||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -60,7 +60,7 @@ $search_agenda_label = GETPOST('search_agenda_label');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $id = GETPOST('id', 'int');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ function printDropdownBookmarksList()
|
|||||||
global $conf, $user, $db, $langs;
|
global $conf, $user, $db, $langs;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
||||||
|
|
||||||
$langs->load("bookmarks");
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
@ -60,6 +61,7 @@ function printDropdownBookmarksList()
|
|||||||
|
|
||||||
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||||
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
||||||
|
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||||
$searchForm .= '</form>';
|
$searchForm .= '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $optioncss = GETPOST('optioncss', 'alpha');
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -305,6 +305,7 @@ switch ($action)
|
|||||||
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
|
$payment->note=$langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
|
||||||
$payment->paiementid=$invoice->mode_reglement_id;
|
$payment->paiementid=$invoice->mode_reglement_id;
|
||||||
$payment->num_paiement='';
|
$payment->num_paiement='';
|
||||||
|
$payment->num_payment='';
|
||||||
|
|
||||||
$paiement_id = $payment->create($user);
|
$paiement_id = $payment->create($user);
|
||||||
if ($paiement_id > 0)
|
if ($paiement_id > 0)
|
||||||
|
|||||||
@ -1912,7 +1912,7 @@ class Categorie extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return label of contact status
|
* Return label of contact status
|
||||||
*
|
*
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
|
||||||
* @return string Label of contact status
|
* @return string Label of contact status
|
||||||
*/
|
*/
|
||||||
public function getLibStatut($mode)
|
public function getLibStatut($mode)
|
||||||
@ -1968,8 +1968,9 @@ class Categorie extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public static function getFilterJoinQuery($type, $rowIdName)
|
public static function getFilterJoinQuery($type, $rowIdName)
|
||||||
{
|
{
|
||||||
return " LEFT JOIN ".MAIN_DB_PREFIX."categorie_".$type." as cp"
|
if ($type == 'bank_account') $type = 'account';
|
||||||
. " ON ".$rowIdName." = cp.fk_".$type;
|
|
||||||
|
return " LEFT JOIN ".MAIN_DB_PREFIX."categorie_".$type." as cp ON ".$rowIdName." = cp.fk_".$type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1982,6 +1983,8 @@ class Categorie extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public static function getFilterSelectQuery($type, $rowIdName, $searchList)
|
public static function getFilterSelectQuery($type, $rowIdName, $searchList)
|
||||||
{
|
{
|
||||||
|
if ($type == 'bank_account') $type = 'account';
|
||||||
|
|
||||||
if (empty($searchList) && !is_array($searchList))
|
if (empty($searchList) && !is_array($searchList))
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@ -55,7 +55,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -64,7 +64,7 @@ if ($id > 0)
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", "int");
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|||||||
@ -94,7 +94,7 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if ($page == -1 || $page == null) { $page = 0; }
|
if ($page == -1 || $page == null) { $page = 0; }
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
if (!$sortorder)
|
if (!$sortorder)
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", "int");
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ $showbirthday = 0;
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", "int");
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $year=GETPOST('year');
|
|||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if ($page == -1 || $page == null) { $page = 0 ; }
|
if ($page == -1 || $page == null) { $page = 0 ; }
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
|
|||||||
@ -67,7 +67,7 @@ $mode = GETPOST("mode");
|
|||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -751,7 +751,7 @@ if ($object->id > 0)
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||||
$sql .= " AND s.rowid = ".$object->id;
|
$sql .= " AND s.rowid = ".$object->id;
|
||||||
$sql .= " AND c.entity = ".$conf->entity;
|
$sql .= " AND c.entity IN (".getEntity('commande').')';
|
||||||
$sql .= " ORDER BY c.date_commande DESC";
|
$sql .= " ORDER BY c.date_commande DESC";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -905,7 +905,7 @@ if ($object->id > 0)
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||||
$sql .= " AND s.rowid = ".$object->id;
|
$sql .= " AND s.rowid = ".$object->id;
|
||||||
$sql .= " AND c.entity = ".$conf->entity;
|
$sql .= " AND c.entity IN (".getEntity('contract').")";
|
||||||
$sql .= " ORDER BY c.datec DESC";
|
$sql .= " ORDER BY c.datec DESC";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -975,7 +975,7 @@ if ($object->id > 0)
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
||||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||||
$sql .= " AND s.rowid = ".$object->id;
|
$sql .= " AND s.rowid = ".$object->id;
|
||||||
$sql .= " AND f.entity = ".$conf->entity;
|
$sql .= " AND f.entity IN (".getEntity('intervention').")";
|
||||||
$sql .= " ORDER BY f.tms DESC";
|
$sql .= " ORDER BY f.tms DESC";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -1044,7 +1044,7 @@ if ($object->id > 0)
|
|||||||
$sql .= ', s.nom, s.rowid as socid';
|
$sql .= ', s.nom, s.rowid as socid';
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
||||||
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
|
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
|
||||||
$sql .= " AND f.entity = ".$conf->entity;
|
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||||
$sql .= ' GROUP BY f.rowid, f.titre, f.total, f.tva, f.total_ttc,';
|
$sql .= ' GROUP BY f.rowid, f.titre, f.total, f.tva, f.total_ttc,';
|
||||||
$sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,';
|
$sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,';
|
||||||
$sql .= ' f.suspended, f.date_when,';
|
$sql .= ' f.suspended, f.date_when,';
|
||||||
|
|||||||
@ -31,7 +31,7 @@ $langs->load("companies");
|
|||||||
|
|
||||||
$sortfield=GETPOST('sortfield', 'alpha');
|
$sortfield=GETPOST('sortfield', 'alpha');
|
||||||
$sortorder=GETPOST('sortorder', 'alpha');
|
$sortorder=GETPOST('sortorder', 'alpha');
|
||||||
$page=GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="p.name";
|
if (! $sortfield) $sortfield="p.name";
|
||||||
if ($page < 0) { $page = 0; }
|
if ($page < 0) { $page = 0; }
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if (!$user->rights->mailing->lire || $user->socid > 0)
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (!$user->rights->mailing->lire || $user->socid > 0) accessforbidden();
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -34,7 +34,7 @@ $result = restrictedArea($user, 'mailing');
|
|||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -1893,7 +1893,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
//Form to close proposal (signed or not)
|
//Form to close proposal (signed or not)
|
||||||
$formquestion = array(
|
$formquestion = array(
|
||||||
array('type' => 'select', 'name' => 'statut', 'label' => $langs->trans("CloseAs"), 'values' => array(2=>$object->LibStatut(Propal::STATUS_SIGNED), 3=>$object->LibStatut(Propal::STATUS_NOTSIGNED))),
|
array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array(2=>$object->LibStatut(Propal::STATUS_SIGNED), 3=>$object->LibStatut(Propal::STATUS_NOTSIGNED))),
|
||||||
array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '') // Field to complete private note (not replace)
|
array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '') // Field to complete private note (not replace)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class Proposals extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function get($id, $contact_list = 1)
|
public function get($id, $contact_list = 1)
|
||||||
{
|
{
|
||||||
return $this->_fetch($id, '', '', '', $contact_list);
|
return $this->_fetch($id, '', '', $contact_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,7 +83,7 @@ class Proposals extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function getByRef($ref, $contact_list = 1)
|
public function getByRef($ref, $contact_list = 1)
|
||||||
{
|
{
|
||||||
return $this->_fetch('', $ref, '', '', $contact_list);
|
return $this->_fetch('', $ref, '', $contact_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,7 +101,7 @@ class Proposals extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function getByRefExt($ref_ext, $contact_list = 1)
|
public function getByRefExt($ref_ext, $contact_list = 1)
|
||||||
{
|
{
|
||||||
return $this->_fetch('', '', $ref_ext, '', $contact_list);
|
return $this->_fetch('', '', $ref_ext, $contact_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,19 +112,18 @@ class Proposals extends DolibarrApi
|
|||||||
* @param int $id ID of order
|
* @param int $id ID of order
|
||||||
* @param string $ref Ref of object
|
* @param string $ref Ref of object
|
||||||
* @param string $ref_ext External reference of object
|
* @param string $ref_ext External reference of object
|
||||||
* @param string $ref_int Internal reference of other objec
|
|
||||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||||
* @return array|mixed data without useless information
|
* @return array|mixed data without useless information
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
private function _fetch($id, $ref = '', $ref_ext = '', $ref_int = '', $contact_list = 1)
|
private function _fetch($id, $ref = '', $ref_ext = '', $contact_list = 1)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->propal->lire) {
|
if (!DolibarrApiAccess::$user->rights->propal->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->propal->fetch($id, $ref, $ref_ext, $ref_int);
|
$result = $this->propal->fetch($id, $ref, $ref_ext);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
throw new RestException(404, 'Commercial Proposal not found');
|
throw new RestException(404, 'Commercial Proposal not found');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -223,6 +223,90 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
public $oldcopy;
|
public $oldcopy;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
|
* 'label' the translation key.
|
||||||
|
* 'enabled' is a condition when the field must be managed.
|
||||||
|
* 'position' is the sort order of field.
|
||||||
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||||
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||||
|
* 'noteditable' says if field is not editable (1 or 0)
|
||||||
|
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||||
|
* 'index' if we want an index in database.
|
||||||
|
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||||
|
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||||
|
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||||
|
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||||
|
* 'help' is a string visible as a tooltip on field
|
||||||
|
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||||
|
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||||
|
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||||
|
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||||
|
*
|
||||||
|
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
|
/**
|
||||||
|
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||||
|
*/
|
||||||
|
public $fields = array(
|
||||||
|
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||||
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
|
||||||
|
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20),
|
||||||
|
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
|
||||||
|
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40),
|
||||||
|
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>45), // deprecated
|
||||||
|
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>23),
|
||||||
|
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>24),
|
||||||
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
|
||||||
|
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||||
|
'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
||||||
|
'fin_validite' =>array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||||
|
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
||||||
|
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||||
|
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
|
||||||
|
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>85),
|
||||||
|
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||||
|
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
||||||
|
'price' =>array('type'=>'double', 'label'=>'Price', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
||||||
|
'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||||
|
'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||||
|
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||||
|
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1),
|
||||||
|
'tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
|
||||||
|
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1),
|
||||||
|
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1),
|
||||||
|
'total' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1),
|
||||||
|
'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
|
||||||
|
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>155),
|
||||||
|
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
|
||||||
|
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
|
||||||
|
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170),
|
||||||
|
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>175),
|
||||||
|
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>180),
|
||||||
|
'date_livraison' =>array('type'=>'date', 'label'=>'DateDeliveryPlanned', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||||
|
'fk_shipping_method' =>array('type'=>'integer', 'label'=>'ShippingMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||||
|
'fk_availability' =>array('type'=>'integer', 'label'=>'Availability', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
|
||||||
|
'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>0, 'position'=>200), // deprecated
|
||||||
|
'fk_input_reason' =>array('type'=>'integer', 'label'=>'InputReason', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
|
||||||
|
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
|
||||||
|
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>220),
|
||||||
|
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>225),
|
||||||
|
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>230),
|
||||||
|
'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>235),
|
||||||
|
'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>240, 'isameasure'=>1),
|
||||||
|
'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>245, 'isameasure'=>1),
|
||||||
|
'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>250, 'isameasure'=>1),
|
||||||
|
'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>255, 'isameasure'=>1),
|
||||||
|
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>260),
|
||||||
|
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||||
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||||
|
);
|
||||||
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draft status
|
* Draft status
|
||||||
*/
|
*/
|
||||||
@ -440,8 +524,8 @@ class Propal extends CommonObject
|
|||||||
* @param int $date_end End date of the line
|
* @param int $date_end End date of the line
|
||||||
* @param array $array_options extrafields array
|
* @param array $array_options extrafields array
|
||||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||||
* @param string $origin 'order', ...
|
* @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'....
|
||||||
* @param int $origin_id Id of origin object
|
* @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id
|
||||||
* @param double $pu_ht_devise Unit price in currency
|
* @param double $pu_ht_devise Unit price in currency
|
||||||
* @param int $fk_remise_except Id discount if line is from a discount
|
* @param int $fk_remise_except Id discount if line is from a discount
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
@ -1099,6 +1183,14 @@ class Propal extends CommonObject
|
|||||||
$vatrate = $line->tva_tx;
|
$vatrate = $line->tva_tx;
|
||||||
if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')';
|
if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')';
|
||||||
|
|
||||||
|
if(!empty($conf->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) {
|
||||||
|
$originid=$line->origin_id;
|
||||||
|
$origintype=$line->origin;
|
||||||
|
} else {
|
||||||
|
$originid=$line->id;
|
||||||
|
$origintype=$this->element;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->addline(
|
$result = $this->addline(
|
||||||
$line->desc,
|
$line->desc,
|
||||||
$line->subprice,
|
$line->subprice,
|
||||||
@ -1122,8 +1214,8 @@ class Propal extends CommonObject
|
|||||||
$line->date_end,
|
$line->date_end,
|
||||||
$line->array_options,
|
$line->array_options,
|
||||||
$line->fk_unit,
|
$line->fk_unit,
|
||||||
$this->element,
|
$origintype,
|
||||||
$line->id
|
$originid
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1369,9 +1461,10 @@ class Propal extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $rowid id of object to load
|
* @param int $rowid id of object to load
|
||||||
* @param string $ref Ref of proposal
|
* @param string $ref Ref of proposal
|
||||||
|
* @param string $ref_ext Ref ext of proposal
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
public function fetch($rowid, $ref = '')
|
public function fetch($rowid, $ref = '', $ref_ext = '')
|
||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
||||||
$sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
|
$sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
|
||||||
@ -3249,8 +3342,8 @@ class Propal extends CommonObject
|
|||||||
$statusType = '';
|
$statusType = '';
|
||||||
if ($status == self::STATUS_DRAFT) $statusType = 'status0';
|
if ($status == self::STATUS_DRAFT) $statusType = 'status0';
|
||||||
elseif ($status == self::STATUS_VALIDATED) $statusType = 'status1';
|
elseif ($status == self::STATUS_VALIDATED) $statusType = 'status1';
|
||||||
elseif ($status == self::STATUS_SIGNED) $statusType = 'status3';
|
elseif ($status == self::STATUS_SIGNED) $statusType = 'status4';
|
||||||
elseif ($status == self::STATUS_NOTSIGNED) $statusType = 'status5';
|
elseif ($status == self::STATUS_NOTSIGNED) $statusType = 'status9';
|
||||||
elseif ($status == self::STATUS_BILLED) $statusType = 'status6';
|
elseif ($status == self::STATUS_BILLED) $statusType = 'status6';
|
||||||
|
|
||||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||||
|
|||||||
@ -211,9 +211,10 @@ class PropaleStats extends Stats
|
|||||||
* Return nb, amount of predefined product for year
|
* Return nb, amount of predefined product for year
|
||||||
*
|
*
|
||||||
* @param int $year Year to scan
|
* @param int $year Year to scan
|
||||||
|
* @param int $limit Limit
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
public function getAllByProduct($year)
|
public function getAllByProduct($year, $limit = 10)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@ -227,6 +228,6 @@ class PropaleStats extends Stats
|
|||||||
$sql .= $this->db->order('nb', 'DESC');
|
$sql .= $this->db->order('nb', 'DESC');
|
||||||
//$sql.= $this->db->plimit(20);
|
//$sql.= $this->db->plimit(20);
|
||||||
|
|
||||||
return $this->_getAllByProduct($sql);
|
return $this->_getAllByProduct($sql, $limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/comm/propal/contact.php
|
* \file htdocs/comm/propal/contact.php
|
||||||
* \ingroup propal
|
* \ingroup propal
|
||||||
* \brief Onglet de gestion des contacts de propal
|
* \brief Tab to manage contacts/adresses of proposal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|||||||
@ -55,7 +55,7 @@ $result = restrictedArea($user, 'propal', $id);
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -82,7 +82,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
|||||||
* Statistics
|
* Statistics
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT count(p.rowid), p.fk_statut";
|
$sql = "SELECT count(p.rowid) as nb, p.fk_statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
|
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -101,24 +101,26 @@ if ($resql)
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
$totalinprocess = 0;
|
$totalinprocess = 0;
|
||||||
$dataseries = array();
|
$dataseries = array();
|
||||||
|
$colorseries = array();
|
||||||
$vals = array();
|
$vals = array();
|
||||||
|
|
||||||
// -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not)
|
// -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not)
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($row)
|
if ($obj)
|
||||||
{
|
{
|
||||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
$vals[$obj->status] = $obj->nb;
|
||||||
{
|
$totalinprocess += $obj->nb;
|
||||||
$vals[$row[1]] = $row[0];
|
|
||||||
$totalinprocess += $row[0];
|
$total += $obj->nb;
|
||||||
}
|
|
||||||
$total += $row[0];
|
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
|
||||||
@ -126,7 +128,13 @@ if ($resql)
|
|||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($propalstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
$dataseries[] = array($propalstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||||
if (!$conf->use_javascript_ajax)
|
if ($status == Propal::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == Propal::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == Propal::STATUS_SIGNED) $colorseries[$status] = $badgeStatus4;
|
||||||
|
if ($status == Propal::STATUS_NOTSIGNED) $colorseries[$status] = $badgeStatus9;
|
||||||
|
if ($status == Propal::STATUS_BILLED) $colorseries[$status] = $badgeStatus6;
|
||||||
|
|
||||||
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$propalstatic->LibStatut($status, 0).'</td>';
|
print '<td>'.$propalstatic->LibStatut($status, 0).'</td>';
|
||||||
@ -141,10 +149,11 @@ if ($resql)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
$dolgraph->setShowLegend(1);
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
$dolgraph->setWidth('100%');
|
$dolgraph->setHeight('200');
|
||||||
$dolgraph->draw('idgraphthirdparties');
|
$dolgraph->draw('idgraphthirdparties');
|
||||||
print $dolgraph->show($total ? 0 : 1);
|
print $dolgraph->show($total ? 0 : 1);
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ $mesg = (GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -1165,9 +1165,7 @@ if ($resql)
|
|||||||
$nbofsalesrepresentative = count($listsalesrepresentatives);
|
$nbofsalesrepresentative = count($listsalesrepresentatives);
|
||||||
if ($nbofsalesrepresentative > 3) // We print only number
|
if ($nbofsalesrepresentative > 3) // We print only number
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$companystatic->id.'">';
|
|
||||||
print $nbofsalesrepresentative;
|
print $nbofsalesrepresentative;
|
||||||
print '</a>';
|
|
||||||
}
|
}
|
||||||
elseif ($nbofsalesrepresentative > 0)
|
elseif ($nbofsalesrepresentative > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class Orders extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function get($id, $contact_list = 1)
|
public function get($id, $contact_list = 1)
|
||||||
{
|
{
|
||||||
return $this->_fetch($id, '', '', '', $contact_list);
|
return $this->_fetch($id, '', '', $contact_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,7 +82,7 @@ class Orders extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function getByRef($ref, $contact_list = 1)
|
public function getByRef($ref, $contact_list = 1)
|
||||||
{
|
{
|
||||||
return $this->_fetch('', $ref, '', '', $contact_list);
|
return $this->_fetch('', $ref, '', $contact_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,7 +100,7 @@ class Orders extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function getByRefExt($ref_ext, $contact_list = 1)
|
public function getByRefExt($ref_ext, $contact_list = 1)
|
||||||
{
|
{
|
||||||
return $this->_fetch('', '', $ref_ext, '', $contact_list);
|
return $this->_fetch('', '', $ref_ext, $contact_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,19 +111,18 @@ class Orders extends DolibarrApi
|
|||||||
* @param int $id ID of order
|
* @param int $id ID of order
|
||||||
* @param string $ref Ref of object
|
* @param string $ref Ref of object
|
||||||
* @param string $ref_ext External reference of object
|
* @param string $ref_ext External reference of object
|
||||||
* @param string $ref_int Internal reference of other objec
|
|
||||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||||
* @return array|mixed data without useless information
|
* @return array|mixed data without useless information
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
private function _fetch($id, $ref = '', $ref_ext = '', $ref_int = '', $contact_list = 1)
|
private function _fetch($id, $ref = '', $ref_ext = '', $contact_list = 1)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->commande->fetch($id, $ref, $ref_ext, $ref_int);
|
$result = $this->commande->fetch($id, $ref, $ref_ext);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
throw new RestException(404, 'Order not found');
|
throw new RestException(404, 'Order not found');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,6 +101,7 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Internal ref for order
|
* @var string Internal ref for order
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $ref_int;
|
public $ref_int;
|
||||||
|
|
||||||
@ -232,6 +233,94 @@ class Commande extends CommonOrder
|
|||||||
//! key of pos source ('0', '1', ...)
|
//! key of pos source ('0', '1', ...)
|
||||||
public $pos_source;
|
public $pos_source;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
|
* 'label' the translation key.
|
||||||
|
* 'enabled' is a condition when the field must be managed.
|
||||||
|
* 'position' is the sort order of field.
|
||||||
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||||
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||||
|
* 'noteditable' says if field is not editable (1 or 0)
|
||||||
|
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||||
|
* 'index' if we want an index in database.
|
||||||
|
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||||
|
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||||
|
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||||
|
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||||
|
* 'help' is a string visible as a tooltip on field
|
||||||
|
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||||
|
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||||
|
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||||
|
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||||
|
*
|
||||||
|
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
|
/**
|
||||||
|
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||||
|
*/
|
||||||
|
public $fields = array(
|
||||||
|
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||||
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
|
||||||
|
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25),
|
||||||
|
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>26),
|
||||||
|
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated
|
||||||
|
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
|
||||||
|
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
|
||||||
|
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
|
||||||
|
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||||
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>56),
|
||||||
|
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
||||||
|
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||||
|
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
||||||
|
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||||
|
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80),
|
||||||
|
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
|
||||||
|
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||||
|
'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
||||||
|
//'amount_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
||||||
|
'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||||
|
'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||||
|
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||||
|
'tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1),
|
||||||
|
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
|
||||||
|
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1),
|
||||||
|
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1),
|
||||||
|
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1),
|
||||||
|
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>150),
|
||||||
|
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>155),
|
||||||
|
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>160),
|
||||||
|
//'facture' =>array('type'=>'tinyint(4)', 'label'=>'ParentInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
|
||||||
|
'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||||
|
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||||
|
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||||
|
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||||
|
'date_livraison' =>array('type'=>'date', 'label'=>'DateDeliveryPlanned', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||||
|
'fk_shipping_method' =>array('type'=>'integer', 'label'=>'ShippingMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
|
||||||
|
'fk_warehouse' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Fk warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>200),
|
||||||
|
'fk_availability' =>array('type'=>'integer', 'label'=>'Availability', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
|
||||||
|
'fk_input_reason' =>array('type'=>'integer', 'label'=>'InputReason', 'enabled'=>1, 'visible'=>-1, 'position'=>210),
|
||||||
|
//'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
|
||||||
|
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225),
|
||||||
|
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>230),
|
||||||
|
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>235),
|
||||||
|
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>240),
|
||||||
|
'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>245),
|
||||||
|
'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>250, 'isameasure'=>1),
|
||||||
|
'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>255, 'isameasure'=>1),
|
||||||
|
'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>260, 'isameasure'=>1),
|
||||||
|
'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>265, 'isameasure'=>1),
|
||||||
|
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
|
||||||
|
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
|
||||||
|
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
|
||||||
|
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||||
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||||
|
);
|
||||||
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ERR Not enough stock
|
* ERR Not enough stock
|
||||||
*/
|
*/
|
||||||
@ -927,6 +1016,14 @@ class Commande extends CommonOrder
|
|||||||
$vatrate = $line->tva_tx;
|
$vatrate = $line->tva_tx;
|
||||||
if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')';
|
if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')';
|
||||||
|
|
||||||
|
if(!empty($conf->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) {
|
||||||
|
$originid=$line->origin_id;
|
||||||
|
$origintype=$line->origin;
|
||||||
|
} else {
|
||||||
|
$originid=$line->id;
|
||||||
|
$origintype=$this->element;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->addline(
|
$result = $this->addline(
|
||||||
$line->desc,
|
$line->desc,
|
||||||
$line->subprice,
|
$line->subprice,
|
||||||
@ -951,8 +1048,8 @@ class Commande extends CommonOrder
|
|||||||
$line->label,
|
$line->label,
|
||||||
$line->array_options,
|
$line->array_options,
|
||||||
$line->fk_unit,
|
$line->fk_unit,
|
||||||
$this->element,
|
$origintype,
|
||||||
$line->id
|
$originid
|
||||||
);
|
);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -1355,8 +1452,8 @@ class Commande extends CommonOrder
|
|||||||
* @param string $label Label
|
* @param string $label Label
|
||||||
* @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
|
* @param array $array_options extrafields array. Example array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
|
||||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||||
* @param string $origin 'order', ...
|
* @param string $origin Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be 'orderdet', 'propaldet'..., else 'order','propal,'....
|
||||||
* @param int $origin_id Id of origin object
|
* @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id
|
||||||
* @param double $pu_ht_devise Unit price in currency
|
* @param double $pu_ht_devise Unit price in currency
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*
|
*
|
||||||
@ -1685,13 +1782,13 @@ class Commande extends CommonOrder
|
|||||||
* @param int $id Id of object to load
|
* @param int $id Id of object to load
|
||||||
* @param string $ref Ref of object
|
* @param string $ref Ref of object
|
||||||
* @param string $ref_ext External reference of object
|
* @param string $ref_ext External reference of object
|
||||||
* @param string $ref_int Internal reference of other object
|
* @param string $notused Internal reference of other object
|
||||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $ref = '', $ref_ext = '', $ref_int = '')
|
public function fetch($id, $ref = '', $ref_ext = '', $notused = '')
|
||||||
{
|
{
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
|
if (empty($id) && empty($ref) && empty($ref_ext)) return -1;
|
||||||
|
|
||||||
$sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut';
|
$sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut';
|
||||||
$sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
|
$sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
|
||||||
@ -1722,7 +1819,7 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'";
|
if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'";
|
||||||
if ($ref_ext) $sql .= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
|
if ($ref_ext) $sql .= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||||
if ($ref_int) $sql .= " AND c.ref_int='".$this->db->escape($ref_int)."'";
|
if ($notused) $sql .= " AND c.ref_int='".$this->db->escape($notused)."'";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
@ -204,9 +204,10 @@ class CommandeStats extends Stats
|
|||||||
* Return nb, amount of predefined product for year
|
* Return nb, amount of predefined product for year
|
||||||
*
|
*
|
||||||
* @param int $year Year to scan
|
* @param int $year Year to scan
|
||||||
|
* @param int $limit Limit
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
public function getAllByProduct($year)
|
public function getAllByProduct($year, $limit = 10)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@ -220,6 +221,6 @@ class CommandeStats extends Stats
|
|||||||
$sql .= $this->db->order('nb', 'DESC');
|
$sql .= $this->db->order('nb', 'DESC');
|
||||||
//$sql.= $this->db->plimit(20);
|
//$sql.= $this->db->plimit(20);
|
||||||
|
|
||||||
return $this->_getAllByProduct($sql);
|
return $this->_getAllByProduct($sql, $limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $langs->loadLangs(array("companies", "orders"));
|
|||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -54,7 +54,7 @@ $result = restrictedArea($user, 'commande', $id, '');
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -140,10 +140,10 @@ if ($resql)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
$dolgraph->setShowLegend(1);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
$dolgraph->setWidth('100%');
|
$dolgraph->setHeight('200');
|
||||||
$dolgraph->draw('idgraphstatus');
|
$dolgraph->draw('idgraphstatus');
|
||||||
print $dolgraph->show($total ? 0 : 1);
|
print $dolgraph->show($total ? 0 : 1);
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/ma
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -54,7 +54,7 @@ $hookmanager->initHooks(array('comptafileslist', 'globallist'));
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -59,7 +59,7 @@ if ($user->socid)
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; }
|
if (empty($page) || $page == -1) { $page = 0; }
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -98,7 +98,7 @@ if (empty($dateop)) $dateop = -1;
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
$pageplusone = GETPOST("pageplusone", 'int');
|
$pageplusone = GETPOST("pageplusone", 'int');
|
||||||
if ($pageplusone) $page = $pageplusone - 1;
|
if ($pageplusone) $page = $pageplusone - 1;
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if ($user->socid)
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; }
|
if (empty($page) || $page == -1) { $page = 0; }
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $conf->liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
|
|||||||
@ -350,10 +350,11 @@ else
|
|||||||
}
|
}
|
||||||
$datamin[$i] = $object->min_desired;
|
$datamin[$i] = $object->min_desired;
|
||||||
$dataall[$i] = $object->min_allowed;
|
$dataall[$i] = $object->min_allowed;
|
||||||
if ($xday == '15')
|
/*if ($xday == '15') // Set only some label for jflot
|
||||||
{
|
{
|
||||||
$labels[$i] = dol_print_date($day, "%b");
|
$labels[$i] = dol_print_date($day, "%b");
|
||||||
}
|
}*/
|
||||||
|
$labels[$i] = dol_print_date($day, "%Y%m");
|
||||||
$day += 86400;
|
$day += 86400;
|
||||||
$textdate = strftime("%Y%m%d", $day);
|
$textdate = strftime("%Y%m%d", $day);
|
||||||
$xyear = substr($textdate, 0, 4);
|
$xyear = substr($textdate, 0, 4);
|
||||||
@ -465,10 +466,11 @@ else
|
|||||||
}
|
}
|
||||||
$datamin[$i] = $object->min_desired;
|
$datamin[$i] = $object->min_desired;
|
||||||
$dataall[$i] = $object->min_allowed;
|
$dataall[$i] = $object->min_allowed;
|
||||||
if (substr($textdate, 6, 2) == '01' || $i == 0)
|
/*if (substr($textdate, 6, 2) == '01' || $i == 0) // Set only few label for jflot
|
||||||
{
|
{
|
||||||
$labels[$i] = substr($textdate, 4, 2);
|
$labels[$i] = substr($textdate, 0, 6);
|
||||||
}
|
}*/
|
||||||
|
$labels[$i] = substr($textdate, 0, 6);
|
||||||
|
|
||||||
$day += 86400;
|
$day += 86400;
|
||||||
$textdate = strftime("%Y%m%d", $day);
|
$textdate = strftime("%Y%m%d", $day);
|
||||||
@ -815,6 +817,8 @@ else
|
|||||||
}
|
}
|
||||||
print '<br><br></td></tr>';
|
print '<br><br></td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
// Graphs
|
// Graphs
|
||||||
if ($mode == 'standard')
|
if ($mode == 'standard')
|
||||||
@ -826,39 +830,39 @@ if ($mode == 'standard')
|
|||||||
|
|
||||||
// For month
|
// For month
|
||||||
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"] != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
|
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"] != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
|
||||||
print '<tr><td class="right">'.$link.'</td></tr>';
|
print '<div class="right clearboth">'.$link.'</div>';
|
||||||
|
|
||||||
print '<tr><td class="center">';
|
print '<div class="center clearboth margintoponly">';
|
||||||
$file = "movement".$account."-".$year.$month.".png";
|
$file = "movement".$account."-".$year.$month.".png";
|
||||||
print $show4;
|
print $show4;
|
||||||
print '</td></tr>';
|
print '</div>';
|
||||||
|
|
||||||
print '<tr><td class="center">';
|
print '<div class="center clearboth margintoponly">';
|
||||||
print $show1;
|
print $show1;
|
||||||
print '</td></tr>';
|
print '</div>';
|
||||||
|
|
||||||
// For year
|
// For year
|
||||||
$prevyear = $year - 1; $nextyear = $year + 1;
|
$prevyear = $year - 1; $nextyear = $year + 1;
|
||||||
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"] != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
|
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"] != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
|
||||||
print '<tr><td class="right">'.$link.'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td class="center">';
|
print '<div class="right clearboth margintoponly">'.$link.'</div>';
|
||||||
|
|
||||||
|
print '<div class="center clearboth margintoponly">';
|
||||||
print $show5;
|
print $show5;
|
||||||
print '</td></tr>';
|
print '</div>';
|
||||||
|
|
||||||
print '<tr><td class="center">';
|
print '<div class="center clearboth margintoponly">';
|
||||||
print $show2;
|
print $show2;
|
||||||
print '</td></tr>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'showalltime')
|
if ($mode == 'showalltime')
|
||||||
{
|
{
|
||||||
print '<tr><td class="center">';
|
print '<div class="center clearboth margintoponly">';
|
||||||
print $show3;
|
print $show3;
|
||||||
print '</td></tr>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -30,8 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
|
||||||
if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||||
|
if (!empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('banks', 'categories', 'accountancy', 'compta'));
|
$langs->loadLangs(array('banks', 'categories', 'accountancy', 'compta'));
|
||||||
@ -49,6 +52,11 @@ $search_number=GETPOST('search_number', 'alpha');
|
|||||||
$search_status = GETPOST('search_status') ?GETPOST('search_status', 'alpha') : 'opened'; // 'all' or ''='opened'
|
$search_status = GETPOST('search_status') ?GETPOST('search_status', 'alpha') : 'opened'; // 'all' or ''='opened'
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
|
|
||||||
|
if (!empty($conf->categorie->enabled))
|
||||||
|
{
|
||||||
|
$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array");
|
||||||
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid) $socid = $user->socid;
|
if ($user->socid) $socid = $user->socid;
|
||||||
if (!empty($user->rights->accounting->chartofaccount)) $allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account
|
if (!empty($user->rights->accounting->chartofaccount)) $allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account
|
||||||
@ -59,7 +67,7 @@ $diroutputmassaction=$conf->bank->dir_output . '/temp/massgeneration/'.$user->id
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -138,7 +146,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form = new FormCategory($db);
|
||||||
|
|
||||||
$title = $langs->trans('BankAccounts');
|
$title = $langs->trans('BankAccounts');
|
||||||
|
|
||||||
@ -156,9 +164,21 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); //
|
|||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||||
|
|
||||||
|
if (!empty($conf->categorie->enabled))
|
||||||
|
{
|
||||||
|
$sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_ACCOUNT, "b.rowid");
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= " WHERE b.entity IN (".getEntity('bank_account').")";
|
$sql .= " WHERE b.entity IN (".getEntity('bank_account').")";
|
||||||
if ($search_status == 'opened') $sql .= " AND clos = 0";
|
if ($search_status == 'opened') $sql .= " AND clos = 0";
|
||||||
if ($search_status == 'closed') $sql .= " AND clos = 1";
|
if ($search_status == 'closed') $sql .= " AND clos = 1";
|
||||||
|
|
||||||
|
if (!empty($conf->categorie->enabled))
|
||||||
|
{
|
||||||
|
$sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_ACCOUNT, "b.rowid", $search_category_list);
|
||||||
|
}
|
||||||
|
|
||||||
if ($search_ref != '') $sql .= natural_search('b.ref', $search_ref);
|
if ($search_ref != '') $sql .= natural_search('b.ref', $search_ref);
|
||||||
if ($search_label != '') $sql .= natural_search('b.label', $search_label);
|
if ($search_label != '') $sql .= natural_search('b.label', $search_label);
|
||||||
if ($search_number != '') $sql .= natural_search('b.number', $search_number);
|
if ($search_number != '') $sql .= natural_search('b.number', $search_number);
|
||||||
@ -263,6 +283,10 @@ if ($sall)
|
|||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
|
if (!empty($conf->categorie->enabled))
|
||||||
|
{
|
||||||
|
$moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
|
||||||
|
}
|
||||||
|
|
||||||
// Bank accounts
|
// Bank accounts
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user