Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_addHookOnSelectUserORSalesRep
This commit is contained in:
commit
ef83801a53
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
|
||||||
|
|||||||
4
.github/workflows/stale-issues-safe.yml
vendored
4
.github/workflows/stale-issues-safe.yml
vendored
@ -11,12 +11,12 @@ jobs:
|
|||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: DeMoorJasper/stale@master
|
- uses: Dolibarr/stale@staleunstale
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
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-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)'
|
stale-label: 'Issue Stale (automatic label)'
|
||||||
exempt-label: 'Priority High / Blocking'
|
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE)'
|
||||||
days-before-stale: 365
|
days-before-stale: 365
|
||||||
days-before-close: 15
|
days-before-close: 15
|
||||||
operations-per-run: 100
|
operations-per-run: 100
|
||||||
|
|||||||
@ -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,7 +32,7 @@ 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
|
||||||
|
|
||||||
|
|||||||
40
ChangeLog
40
ChangeLog
@ -2,6 +2,27 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
|
||||||
|
For Users:
|
||||||
|
NEW: Module MO (Manufacturing Order) is available as stable module.
|
||||||
|
|
||||||
|
For Developers or integrators:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* PHP 5.5 is no more supported. Minimum PHP is now 5.6+.
|
||||||
|
* Default mode for GETPOST function is now 'alphanohtml' instead of 'none'. So check when you make POST or GET requests
|
||||||
|
with HTML content that you make a GETPOST('myparam', 'restricthtml') or GETPOST('myparam', 'none') if you really need posted content without sanitizing
|
||||||
|
the HTML into content (in such a case, sanitize data later)
|
||||||
|
* 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
|
||||||
|
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 *****
|
***** ChangeLog for 11.0.2 compared to 11.0.1 *****
|
||||||
FIX: #10309
|
FIX: #10309
|
||||||
FIX: #13110
|
FIX: #13110
|
||||||
@ -66,25 +87,6 @@ FIX: Visualization rights correction on last modified contacts box.
|
|||||||
FIX: Vulnerability in module from modulebuilder.
|
FIX: Vulnerability in module from modulebuilder.
|
||||||
FIX: Vulnerability reported by code16
|
FIX: Vulnerability reported by code16
|
||||||
|
|
||||||
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
|
|
||||||
For Users:
|
|
||||||
NEW: Module MO (Manufacturing Order) is available as stable module.
|
|
||||||
|
|
||||||
For Developers or integrators:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
|
||||||
* PHP 5.5 is no more supported. Minimum PHP is now 5.6+.
|
|
||||||
* Default mode for GETPOST function is now 'alphanohtml' instead of 'none'. So check when you make POST or GET requests
|
|
||||||
with HTML content that you make a GETPOST('myparam', 'restricthtml') or GETPOST('myparam', 'none') if you really need posted content without sanitizing
|
|
||||||
the HTML into content (in such a case, sanitize data later)
|
|
||||||
* 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
|
|
||||||
by a "_" automatically when a reference is generated.
|
|
||||||
|
|
||||||
***** 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.
|
||||||
FIX: After import of a website template, home page was not set.
|
FIX: After import of a website template, home page was not set.
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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>';
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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,10 @@ 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 .= " p.accountancy_code_buy_intra as code_buy_intra, p.accountancy_code_buy_export as code_buy_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);
|
||||||
@ -422,6 +424,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;
|
||||||
|
|
||||||
$facturefourn_static->ref = $objp->ref;
|
$facturefourn_static->ref = $objp->ref;
|
||||||
$facturefourn_static->id = $objp->facid;
|
$facturefourn_static->id = $objp->facid;
|
||||||
@ -508,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
|
||||||
@ -539,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");
|
||||||
@ -549,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");
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -524,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
|
||||||
@ -1183,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,
|
||||||
@ -1206,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)
|
||||||
@ -3334,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);
|
||||||
|
|||||||
@ -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,6 +149,7 @@ 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->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -1016,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,
|
||||||
@ -1040,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)
|
||||||
{
|
{
|
||||||
@ -1444,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
|
||||||
*
|
*
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -102,7 +102,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;
|
||||||
|
|||||||
@ -67,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;
|
||||||
|
|||||||
@ -80,7 +80,7 @@ if ($user->rights->banque->consolidate && $action == 'dvprev' && !empty($dvid))
|
|||||||
$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
|
||||||
|
|||||||
@ -45,7 +45,7 @@ $result = restrictedArea($user, 'banque', '', '', '');
|
|||||||
// 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;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if ($search_accountancy_subledger == - 1) $search_accountancy_subledger = '';
|
|||||||
|
|
||||||
$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 @@ $sday = (GETPOSTISSET('closeday') ?GETPOST('closeday', 'int') : dol_print_date($
|
|||||||
$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;
|
||||||
@ -77,6 +77,9 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('cashcontrolcard', 'globalcard'));
|
$hookmanager->initHooks(array('cashcontrolcard', 'globalcard'));
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -96,8 +99,23 @@ if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && empty($conf->global->C
|
|||||||
|
|
||||||
if (GETPOST('cancel', 'alpha'))
|
if (GETPOST('cancel', 'alpha'))
|
||||||
{
|
{
|
||||||
|
if ($action == 'valid') {
|
||||||
|
$action = 'view';
|
||||||
|
}
|
||||||
|
else {
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == "reopen")
|
||||||
|
{
|
||||||
|
$result = $object->setStatut($object::STATUS_DRAFT, null, '', 'CASHFENCE_REOPEN');
|
||||||
|
if ($result < 0) {
|
||||||
|
dol_print_error($db, $object->error, $object->error);
|
||||||
|
}
|
||||||
|
|
||||||
|
$action = 'view';
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == "start")
|
if ($action == "start")
|
||||||
{
|
{
|
||||||
@ -162,18 +180,35 @@ elseif ($action == "add")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "close")
|
if ($action == "valid") // validate = close
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
/*
|
||||||
|
$object->day_close = GETPOST('closeday', 'int');
|
||||||
|
$object->month_close = GETPOST('closemonth', 'int');
|
||||||
|
$object->year_close = GETPOST('closeyear', 'int');
|
||||||
|
*/
|
||||||
|
|
||||||
|
$object->cash = price2num(GETPOST('cash_amount', 'alpha'));
|
||||||
|
$object->card = price2num(GETPOST('card_amount', 'alpha'));
|
||||||
|
$object->cheque = price2num(GETPOST('cheque_amount', 'alpha'));
|
||||||
|
|
||||||
|
$result = $object->update($user);
|
||||||
|
|
||||||
$result = $object->valid($user);
|
$result = $object->valid($user);
|
||||||
|
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$db->rollback();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("CashFenceDone"), null);
|
setEventMessages($langs->trans("CashFenceDone"), null);
|
||||||
|
$db->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = "view";
|
$action = "view";
|
||||||
@ -213,15 +248,22 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete))
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if ($action == "create" || $action == "start")
|
|
||||||
{
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$initialbalanceforterminal = array();
|
$initialbalanceforterminal = array();
|
||||||
$theoricalamountforterminal = array();
|
$theoricalamountforterminal = array();
|
||||||
$theoricalnbofinvoiceforterminal = array();
|
$theoricalnbofinvoiceforterminal = array();
|
||||||
|
|
||||||
if (GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '-1')
|
if ($action == "create" || $action == "start" || $action == 'close')
|
||||||
|
{
|
||||||
|
if ($action == 'close') {
|
||||||
|
$posmodule = $object->posmodule;
|
||||||
|
$terminalid = $object->posnumber;
|
||||||
|
$terminaltouse = $terminalid;
|
||||||
|
|
||||||
|
$syear = $object->year_close;
|
||||||
|
$smonth = $object->month_close;
|
||||||
|
$sday = $object->day_close;
|
||||||
|
}
|
||||||
|
elseif (GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '-1')
|
||||||
{
|
{
|
||||||
$posmodule = GETPOST('posmodule', 'alpha');
|
$posmodule = GETPOST('posmodule', 'alpha');
|
||||||
$terminalid = GETPOST('posnumber', 'alpha');
|
$terminalid = GETPOST('posnumber', 'alpha');
|
||||||
@ -234,7 +276,10 @@ if ($action == "create" || $action == "start")
|
|||||||
setEventMessages($langs->trans("OnlyTerminal1IsAvailableForCashDeskModule"), null, 'errors');
|
setEventMessages($langs->trans("OnlyTerminal1IsAvailableForCashDeskModule"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($terminalid != '')
|
||||||
|
{
|
||||||
// Calculate $initialbalanceforterminal for terminal 0
|
// Calculate $initialbalanceforterminal for terminal 0
|
||||||
foreach ($arrayofpaymentmode as $key => $val)
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
{
|
{
|
||||||
@ -246,9 +291,7 @@ if ($action == "create" || $action == "start")
|
|||||||
|
|
||||||
// Get the bank account dedicated to this point of sale module/terminal
|
// Get the bank account dedicated to this point of sale module/terminal
|
||||||
$vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
|
$vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
|
||||||
$bankid = $conf->global->$vartouse; // This value is ok for 'Terminal 0' for module 'CashDesk' and 'TakePos' (they manage only 1 terminal)
|
$bankid = $conf->global->$vartouse;
|
||||||
// Hook to get the good bank id according to posmodule and posnumber.
|
|
||||||
// @todo add hook here
|
|
||||||
|
|
||||||
if ($bankid > 0)
|
if ($bankid > 0)
|
||||||
{
|
{
|
||||||
@ -274,11 +317,9 @@ if ($action == "create" || $action == "start")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate $theoricalamountforterminal for terminal 0
|
// Calculate $theoricalamountforterminal
|
||||||
foreach ($arrayofpaymentmode as $key => $val)
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
{
|
{
|
||||||
/*$sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank";
|
|
||||||
$sql.= " WHERE fk_account = ".$bankid;*/
|
|
||||||
$sql = "SELECT SUM(pf.amount) as total, COUNT(*) as nb";
|
$sql = "SELECT SUM(pf.amount) as total, COUNT(*) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp";
|
||||||
$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
|
$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
|
||||||
@ -315,6 +356,10 @@ if ($action == "create" || $action == "start")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//var_dump($theoricalamountforterminal); var_dump($theoricalnbofinvoiceforterminal);
|
||||||
|
if ($action != 'close') {
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
|
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -322,11 +367,18 @@ if ($action == "create" || $action == "start")
|
|||||||
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
}
|
||||||
|
elseif ($action == 'close')
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="action" value="valid">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="action" value="start">';
|
print '<input type="hidden" name="action" value="start">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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>'.$langs->trans("Module").'</td>';
|
print '<td>'.$langs->trans("Module").'</td>';
|
||||||
@ -403,15 +455,17 @@ if ($action == "create" || $action == "start")
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
// Table to see/enter balance
|
// Table to see/enter balance
|
||||||
if ($action == 'start' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '-1')
|
if (($action == 'start' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '-1') || $action == 'close')
|
||||||
{
|
{
|
||||||
$posmodule = GETPOST('posmodule', 'alpha');
|
$posmodule = GETPOST('posmodule', 'alpha');
|
||||||
$terminalid = GETPOST('posnumber', 'alpha');
|
$terminalid = GETPOST('posnumber', 'alpha');
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
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">';
|
||||||
@ -419,9 +473,12 @@ if ($action == "create" || $action == "start")
|
|||||||
print '<td class="center">'.$langs->trans("InitialBankBalance");
|
print '<td class="center">'.$langs->trans("InitialBankBalance");
|
||||||
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
/*
|
||||||
print '<td align="center" class="hide0" colspan="'.count($arrayofpaymentmode).'">';
|
print '<td align="center" class="hide0" colspan="'.count($arrayofpaymentmode).'">';
|
||||||
print $langs->trans("AmountAtEndOfPeriod");
|
print $langs->trans("AmountAtEndOfPeriod");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
*/
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -430,6 +487,7 @@ if ($action == "create" || $action == "start")
|
|||||||
print '<td class="center">'.$langs->trans("Cash");
|
print '<td class="center">'.$langs->trans("Cash");
|
||||||
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
/*
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($arrayofpaymentmode as $key => $val)
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
{
|
{
|
||||||
@ -437,11 +495,11 @@ if ($action == "create" || $action == "start")
|
|||||||
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}*/
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
/*print '<tr>';
|
||||||
// Initial amount
|
// Initial amount
|
||||||
print '<td>'.$langs->trans("NbOfInvoices").'</td>';
|
print '<td>'.$langs->trans("NbOfInvoices").'</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -458,6 +516,7 @@ if ($action == "create" || $action == "start")
|
|||||||
// Save
|
// Save
|
||||||
print '<td align="center"></td>';
|
print '<td align="center"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
// Initial amount
|
// Initial amount
|
||||||
@ -466,46 +525,61 @@ if ($action == "create" || $action == "start")
|
|||||||
print price($initialbalanceforterminal[$terminalid]['cash']).'<br>';
|
print price($initialbalanceforterminal[$terminalid]['cash']).'<br>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Amount per payment type
|
// Amount per payment type
|
||||||
$i = 0;
|
/*$i = 0;
|
||||||
foreach ($arrayofpaymentmode as $key => $val)
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
{
|
{
|
||||||
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
||||||
print price($theoricalamountforterminal[$terminalid][$key]).'<br>';
|
print price($theoricalamountforterminal[$terminalid][$key]).'<br>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}*/
|
||||||
// Save
|
// Save
|
||||||
print '<td align="center"></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("RealAmount").'</td>';
|
print '<td>'.$langs->trans("RealAmount").'</td>';
|
||||||
// Initial amount
|
// Initial amount
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input name="opening" type="text" class="maxwidth100 center" value="'.(GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash'])).'">';
|
print '<input ';
|
||||||
|
if ($action == 'close') print 'disabled '; // To close cash user can't set opening cash
|
||||||
|
print 'name="opening" type="text" class="maxwidth100 center" value="';
|
||||||
|
if ($action == 'close')
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
print $object->opening;
|
||||||
|
}
|
||||||
|
else print (GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash']));
|
||||||
|
print '">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Amount per payment type
|
// Amount per payment type
|
||||||
$i = 0;
|
/*$i = 0;
|
||||||
foreach ($arrayofpaymentmode as $key => $val)
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
{
|
{
|
||||||
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
||||||
print '<input name="'.$key.'_amount" type="text"'.($key == 'cash' ? ' autofocus' : '').' class="maxwidth100 center" value="'.GETPOST($key.'_amount', 'alpha').'">';
|
print '<input ';
|
||||||
|
if ($action == 'start') print 'disabled '; // To start cash user only can set opening cash
|
||||||
|
print 'name="'.$key.'_amount" type="text"'.($key == 'cash' ? ' autofocus' : '').' class="maxwidth100 center" value="'.GETPOST($key.'_amount', 'alpha').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}*/
|
||||||
// Save
|
// Save
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||||
print '<input type="submit" name="add" class="button" value="'.$langs->trans("Save").'">';
|
if ($action == 'start') print '<input type="submit" name="add" class="button" value="'.$langs->trans("Save").'">';
|
||||||
|
elseif ($action == 'close') print '<input type="submit" name="valid" class="button" value="'.$langs->trans("Validate").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</form>';
|
print '</table>';
|
||||||
}
|
print '</div>';
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($action) || $action == "view")
|
print '</form>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($action) || $action == "view" || $action == "close")
|
||||||
{
|
{
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
@ -520,7 +594,7 @@ if (empty($action) || $action == "view")
|
|||||||
$head[0][1] = $langs->trans("Card");
|
$head[0][1] = $langs->trans("Card");
|
||||||
$head[0][2] = 'cashcontrol';
|
$head[0][2] = 'cashcontrol';
|
||||||
|
|
||||||
dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'cashcontrol');
|
dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
@ -587,17 +661,212 @@ if (empty($action) || $action == "view")
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
if ($action != 'close') {
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">'.$langs->trans('PrintTicket').'</a></div>';
|
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">'.$langs->trans('PrintTicket').'</a></div>';
|
||||||
|
|
||||||
if ($object->status == CashControl::STATUS_DRAFT)
|
if ($object->status == CashControl::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=close">'.$langs->trans('ValidateAndClose').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=close">'.$langs->trans('Close').'</a></div>';
|
||||||
|
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=confirm_delete">'.$langs->trans('Delete').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=confirm_delete">'.$langs->trans('Delete').'</a></div>';
|
||||||
|
} else {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
||||||
|
} else {
|
||||||
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formclose">';
|
||||||
|
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||||
|
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
}
|
||||||
|
elseif ($action == 'close')
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="action" value="valid">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="action" value="start">';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Module").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Terminal").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Year").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Month").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Day").'</td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$disabled = 1;
|
||||||
|
$prefix = 'close';
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$form->selectarray('posmodulebis', $arrayofposavailable, $object->posmodule, (count($arrayofposavailable) > 1 ? 1 : 0), 0, 0, '', 0, 0, $disabled).'</td>';
|
||||||
|
print '<input type="hidden" name="posmodule" value="'.$object->posmodule.'">';
|
||||||
|
print '<td>';
|
||||||
|
|
||||||
|
$array = array();
|
||||||
|
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
|
||||||
|
for($i = 1; $i <= $numterminals; $i++) {
|
||||||
|
$array[$i] = $i;
|
||||||
|
}
|
||||||
|
$selectedposnumber = $object->posnumber; $showempty = 1;
|
||||||
|
//print $form->selectarray('posnumber', $array, GETPOSTISSET('posnumber') ?GETPOST('posnumber', 'int') : $selectedposnumber, $showempty, 0, 0, '', 0, 0, $disabled);
|
||||||
|
print '<input name="posnumberbis" disabled="disabled" type="text" class="maxwidth50" value="'.$object->posnumber.'">';
|
||||||
|
print '<input type="hidden" name="posnumber" value="'.$object->posmodule.'">';
|
||||||
|
print '</td>';
|
||||||
|
// Year
|
||||||
|
print '<td>';
|
||||||
|
print '<input name="yearbis" disabled="disabled" type="text" class="maxwidth50" value="'.$object->year_close.'">';
|
||||||
|
print '<input type="hidden" name="year_close" value="'.$object->year_close.'">';
|
||||||
|
print '</td>';
|
||||||
|
// Month
|
||||||
|
print '<td>';
|
||||||
|
print '<input name="monthbis" disabled="disabled" type="text" class="maxwidth50" value="'.$object->month_close.'">';
|
||||||
|
print '<input type="hidden" name="month_close" value="'.$object->month_close.'">';
|
||||||
|
print '</td>';
|
||||||
|
// Day
|
||||||
|
print '<td>';
|
||||||
|
print '<input name="daybis" disabled="disabled" type="text" class="maxwidth50" value="'.$object->date_close.'">';
|
||||||
|
print '<input type="hidden" name="day_close" value="'.$object->date_close.'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td></td>';
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Table to see/enter balance
|
||||||
|
if (($action == 'start' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '-1') || $action == 'close')
|
||||||
|
{
|
||||||
|
$posmodule = $object->posmodule;
|
||||||
|
$terminalid = $object->posnumber;
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td class="center">'.$langs->trans("InitialBankBalance");
|
||||||
|
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td align="center" class="hide0" colspan="'.count($arrayofpaymentmode).'">';
|
||||||
|
print $langs->trans("AmountAtEndOfPeriod");
|
||||||
|
print '</td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td class="center">'.$langs->trans("Cash");
|
||||||
|
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
||||||
|
print '</td>';
|
||||||
|
$i = 0;
|
||||||
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
|
{
|
||||||
|
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>'.$langs->trans($val);
|
||||||
|
//print '<br>'.$langs->trans("TheoricalAmount").'<br>'.$langs->trans("RealAmount");
|
||||||
|
print '</td>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print '<td></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
// Initial amount
|
||||||
|
print '<td>'.$langs->trans("NbOfInvoices").'</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print '</td>';
|
||||||
|
// Amount per payment type
|
||||||
|
$i = 0;
|
||||||
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
|
{
|
||||||
|
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
||||||
|
print $theoricalnbofinvoiceforterminal[$terminalid][$key];
|
||||||
|
print '</td>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
// Save
|
||||||
|
print '<td align="center"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
// Initial amount
|
||||||
|
print '<td>'.$langs->trans("TheoricalAmount").'</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print price($initialbalanceforterminal[$terminalid]['cash']).'<br>';
|
||||||
|
print '</td>';
|
||||||
|
// Amount per payment type
|
||||||
|
$i = 0;
|
||||||
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
|
{
|
||||||
|
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
||||||
|
if ($key == 'cash') {
|
||||||
|
$deltaforcash = ($object->opening - $initialbalanceforterminal[$terminalid]['cash']);
|
||||||
|
print price($theoricalamountforterminal[$terminalid][$key] + $deltaforcash).'<br>';
|
||||||
|
} else {
|
||||||
|
print price($theoricalamountforterminal[$terminalid][$key]).'<br>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
// Save
|
||||||
|
print '<td align="center"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("RealAmount").'</td>';
|
||||||
|
// Initial amount
|
||||||
|
print '<td class="center">';
|
||||||
|
print '<input ';
|
||||||
|
if ($action == 'close') print 'disabled '; // To close cash user can't set opening cash
|
||||||
|
print 'name="opening" type="text" class="maxwidth100 center" value="';
|
||||||
|
if ($action == 'close')
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
print $object->opening;
|
||||||
|
}
|
||||||
|
else print (GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash']));
|
||||||
|
print '">';
|
||||||
|
print '</td>';
|
||||||
|
// Amount per payment type
|
||||||
|
$i = 0;
|
||||||
|
foreach ($arrayofpaymentmode as $key => $val)
|
||||||
|
{
|
||||||
|
print '<td align="center"'.($i == 0 ? ' class="hide0"' : '').'>';
|
||||||
|
print '<input ';
|
||||||
|
if ($action == 'start') print 'disabled '; // To start cash user only can set opening cash
|
||||||
|
print 'name="'.$key.'_amount" type="text"'.($key == 'cash' ? ' autofocus' : '').' class="maxwidth100 center" value="'.GETPOST($key.'_amount', 'alpha').'">';
|
||||||
|
print '</td>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
// Save
|
||||||
|
print '<td class="center">';
|
||||||
|
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||||
|
if ($action == 'start') print '<input type="submit" name="add" class="button" value="'.$langs->trans("Save").'">';
|
||||||
|
elseif ($action == 'close') print '<input type="submit" name="valid" class="button" value="'.$langs->trans("Close").'">';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,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;
|
||||||
|
|||||||
@ -104,6 +104,7 @@ class CashControl extends CommonObject
|
|||||||
|
|
||||||
const STATUS_DRAFT = 0;
|
const STATUS_DRAFT = 0;
|
||||||
const STATUS_VALIDATED = 1;
|
const STATUS_VALIDATED = 1;
|
||||||
|
const STATUS_CLOSED = 1; // For the moment CLOSED = VALIDATED
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -288,6 +289,18 @@ class CashControl extends CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update object into database
|
||||||
|
*
|
||||||
|
* @param User $user User that modifies
|
||||||
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function update(User $user, $notrigger = false)
|
||||||
|
{
|
||||||
|
return $this->updateCommon($user, $notrigger);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete object in database
|
* Delete object in database
|
||||||
*
|
*
|
||||||
|
|||||||
@ -40,6 +40,7 @@ $langs->load("bills");
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
$_GET['optioncss'] = "print";
|
$_GET['optioncss'] = "print";
|
||||||
|
|
||||||
$cashcontrol = new CashControl($db);
|
$cashcontrol = new CashControl($db);
|
||||||
$cashcontrol->fetch($id);
|
$cashcontrol->fetch($id);
|
||||||
|
|
||||||
@ -69,6 +70,8 @@ $terminalid = $cashcontrol->posnumber;
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$param = '';
|
||||||
|
|
||||||
llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $param);
|
llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $param);
|
||||||
|
|
||||||
/*$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
|
/*$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
|
||||||
@ -268,21 +271,21 @@ if ($resql)
|
|||||||
|
|
||||||
print "<div style='text-align: right'><h2>";
|
print "<div style='text-align: right'><h2>";
|
||||||
print $langs->trans("Cash").": ".price($cash);
|
print $langs->trans("Cash").": ".price($cash);
|
||||||
if ($cash != $cashcontrol->cash) {
|
if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cash != $cashcontrol->cash) {
|
||||||
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->cash).'</span>';
|
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->cash).'</span>';
|
||||||
}
|
}
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
|
|
||||||
//print '<br>';
|
//print '<br>';
|
||||||
print $langs->trans("PaymentTypeCHQ").": ".price($cheque);
|
print $langs->trans("PaymentTypeCHQ").": ".price($cheque);
|
||||||
if ($cheque != $cashcontrol->cheque) {
|
if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cheque != $cashcontrol->cheque) {
|
||||||
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->cheque).'</span>';
|
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->cheque).'</span>';
|
||||||
}
|
}
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
|
|
||||||
//print '<br>';
|
//print '<br>';
|
||||||
print $langs->trans("PaymentTypeCB").": ".price($bank);
|
print $langs->trans("PaymentTypeCB").": ".price($bank);
|
||||||
if ($bank != $cashcontrol->card) {
|
if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $bank != $cashcontrol->card) {
|
||||||
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->card).'</span>';
|
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->card).'</span>';
|
||||||
}
|
}
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
|
|||||||
@ -58,7 +58,7 @@ $search_account = GETPOST('search_account', '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;
|
||||||
|
|||||||
@ -46,7 +46,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;
|
||||||
|
|||||||
@ -50,7 +50,7 @@ $result = restrictedArea($user, 'deplacement', $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;
|
||||||
|
|||||||
@ -37,7 +37,7 @@ $result = restrictedArea($user, 'deplacement', '', '');
|
|||||||
|
|
||||||
$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 @@ $search_company=GETPOST('search_company', 'alpha');
|
|||||||
// $search_amount=GETPOST('search_amount','alpha');
|
// $search_amount=GETPOST('search_amount','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');
|
||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
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;
|
||||||
|
|||||||
@ -70,7 +70,7 @@ $month_date_when = GETPOST('month_date_when');
|
|||||||
$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;
|
||||||
if (!$sortorder) $sortorder = 'DESC';
|
if (!$sortorder) $sortorder = 'DESC';
|
||||||
|
|||||||
@ -141,7 +141,6 @@ $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isd
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -813,6 +813,14 @@ class Facture extends CommonInvoice
|
|||||||
$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,
|
||||||
@ -832,8 +840,8 @@ class Facture extends CommonInvoice
|
|||||||
$line->product_type,
|
$line->product_type,
|
||||||
$line->rang,
|
$line->rang,
|
||||||
$line->special_code,
|
$line->special_code,
|
||||||
$this->element,
|
$origintype,
|
||||||
$line->id,
|
$originid,
|
||||||
$fk_parent_line,
|
$fk_parent_line,
|
||||||
$line->fk_fournprice,
|
$line->fk_fournprice,
|
||||||
$line->pa_ht,
|
$line->pa_ht,
|
||||||
@ -2942,8 +2950,8 @@ class Facture extends CommonInvoice
|
|||||||
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
|
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
|
||||||
* @param int $rang Position of line
|
* @param int $rang Position of line
|
||||||
* @param int $special_code Special code (also used by externals modules!)
|
* @param int $special_code Special code (also used by externals modules!)
|
||||||
* @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 int $fk_parent_line Id of parent line
|
* @param int $fk_parent_line Id of parent line
|
||||||
* @param int $fk_fournprice Supplier price id (to calculate margin) or ''
|
* @param int $fk_fournprice Supplier price id (to calculate margin) or ''
|
||||||
* @param int $pa_ht Buying price of line (to calculate margin) or ''
|
* @param int $pa_ht Buying price of line (to calculate margin) or ''
|
||||||
@ -3691,47 +3699,62 @@ class Facture extends CommonInvoice
|
|||||||
public function getNextNumRef($soc, $mode = 'next')
|
public function getNextNumRef($soc, $mode = 'next')
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$langs->load("bills");
|
|
||||||
|
if ($this->module_source == 'takepos') {
|
||||||
|
$langs->load('cashdesk@cashdesk');
|
||||||
|
|
||||||
|
$moduleName = 'takepos';
|
||||||
|
$moduleSourceName = 'Takepos';
|
||||||
|
$addonConstName = 'TAKEPOS_REF_ADDON';
|
||||||
|
|
||||||
|
// Clean parameters (if not defined or using deprecated value)
|
||||||
|
if (empty($conf->global->TAKEPOS_REF_ADDON)) $conf->global->TAKEPOS_REF_ADDON = 'mod_takepos_ref_simple';
|
||||||
|
|
||||||
|
$addon = $conf->global->TAKEPOS_REF_ADDON;
|
||||||
|
} else {
|
||||||
|
$langs->load('bills');
|
||||||
|
|
||||||
|
$moduleName = 'facture';
|
||||||
|
$moduleSourceName = 'Invoice';
|
||||||
|
$addonConstName = 'FACTURE_ADDON';
|
||||||
|
|
||||||
// Clean parameters (if not defined or using deprecated value)
|
// Clean parameters (if not defined or using deprecated value)
|
||||||
if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON = 'mod_facture_terre';
|
if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON = 'mod_facture_terre';
|
||||||
elseif ($conf->global->FACTURE_ADDON == 'terre') $conf->global->FACTURE_ADDON = 'mod_facture_terre';
|
elseif ($conf->global->FACTURE_ADDON == 'terre') $conf->global->FACTURE_ADDON = 'mod_facture_terre';
|
||||||
elseif ($conf->global->FACTURE_ADDON == 'mercure') $conf->global->FACTURE_ADDON = 'mod_facture_mercure';
|
elseif ($conf->global->FACTURE_ADDON == 'mercure') $conf->global->FACTURE_ADDON = 'mod_facture_mercure';
|
||||||
|
|
||||||
if (!empty($conf->global->FACTURE_ADDON))
|
$addon = $conf->global->FACTURE_ADDON;
|
||||||
{
|
}
|
||||||
dol_syslog("Call getNextNumRef with FACTURE_ADDON = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->nom.", type=".$soc->typent_code, LOG_DEBUG);
|
|
||||||
|
if (!empty($addon)) {
|
||||||
|
dol_syslog("Call getNextNumRef with " . $addonConstName . " = " . $conf->global->FACTURE_ADDON . ", thirdparty=" . $soc->nom . ", type=" . $soc->typent_code, LOG_DEBUG);
|
||||||
|
|
||||||
$mybool = false;
|
$mybool = false;
|
||||||
|
|
||||||
|
|
||||||
$file = $conf->global->FACTURE_ADDON.".php";
|
$file = $addon . '.php';
|
||||||
$classname = $conf->global->FACTURE_ADDON;
|
$classname = $addon;
|
||||||
|
|
||||||
|
|
||||||
// Include file with class
|
// Include file with class
|
||||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
|
|
||||||
foreach ($dirmodels as $reldir) {
|
foreach ($dirmodels as $reldir) {
|
||||||
$dir = dol_buildpath($reldir."core/modules/facture/");
|
$dir = dol_buildpath($reldir . 'core/modules/' . $moduleName . '/');
|
||||||
|
|
||||||
// Load file with numbering class (if found)
|
// Load file with numbering class (if found)
|
||||||
if (is_file($dir.$file) && is_readable($dir.$file))
|
if (is_file($dir . $file) && is_readable($dir . $file)) {
|
||||||
{
|
|
||||||
$mybool |= include_once $dir . $file;
|
$mybool |= include_once $dir . $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For compatibility
|
// For compatibility
|
||||||
if (!$mybool)
|
if (!$mybool) {
|
||||||
{
|
$file = $addon . '/' . $addon . '.modules.php';
|
||||||
$file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php";
|
$classname = 'mod_' . $moduleName . '_' . $addon;
|
||||||
$classname = "mod_facture_".$conf->global->FACTURE_ADDON;
|
|
||||||
$classname = preg_replace('/\-.*$/', '', $classname);
|
$classname = preg_replace('/\-.*$/', '', $classname);
|
||||||
// Include file with class
|
// Include file with class
|
||||||
foreach ($conf->file->dol_document_root as $dirroot)
|
foreach ($conf->file->dol_document_root as $dirroot) {
|
||||||
{
|
$dir = $dirroot . '/core/modules/' . $moduleName . '/';
|
||||||
$dir = $dirroot."/core/modules/facture/";
|
|
||||||
|
|
||||||
// Load file with numbering class (if found)
|
// Load file with numbering class (if found)
|
||||||
if (is_file($dir . $file) && is_readable($dir . $file)) {
|
if (is_file($dir . $file) && is_readable($dir . $file)) {
|
||||||
@ -3740,14 +3763,12 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$mybool)
|
if (!$mybool) {
|
||||||
{
|
dol_print_error('', 'Failed to include file ' . $file);
|
||||||
dol_print_error('', "Failed to include file ".$file);
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = new $classname();
|
$obj = new $classname();
|
||||||
$numref = "";
|
|
||||||
$numref = $obj->getNextValue($soc, $this, $mode);
|
$numref = $obj->getNextValue($soc, $this, $mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3756,17 +3777,14 @@ class Facture extends CommonInvoice
|
|||||||
*/
|
*/
|
||||||
if ($mode != 'last' && !$numref) {
|
if ($mode != 'last' && !$numref) {
|
||||||
$this->error = $obj->error;
|
$this->error = $obj->error;
|
||||||
//dol_print_error($this->db,"Facture::getNextNumRef ".$obj->error);
|
return '';
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $numref;
|
return $numref;
|
||||||
}
|
} else {
|
||||||
else
|
$langs->load('errors');
|
||||||
{
|
print $langs->trans('Error') . ' ' . $langs->trans('ErrorModuleSetupNotComplete', $langs->transnoentitiesnoconv($moduleSourceName));
|
||||||
$langs->load("errors");
|
return '';
|
||||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice"));
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ $result=restrictedArea($user, 'facture', $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;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ $search_status = GETPOST('search_status', '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;
|
||||||
if (!$sortorder) $sortorder = 'DESC';
|
if (!$sortorder) $sortorder = 'DESC';
|
||||||
|
|||||||
@ -121,7 +121,7 @@ $filtre = GETPOST('filtre', '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 || !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;
|
||||||
if (!$sortorder && !empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == '1') $sortorder = $conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
|
if (!$sortorder && !empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == '1') $sortorder = $conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user