Merge remote-tracking branch 'upstream/3.7' into 3.7-webservices-fix
This commit is contained in:
commit
54ffaea000
12
.travis.yml
12
.travis.yml
@ -91,13 +91,13 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- cd htdocs/install
|
- cd htdocs/install
|
||||||
- date
|
- date
|
||||||
# - php upgrade.php 3.4.0 3.5.0 > upgrade.log
|
# - php upgrade.php 3.4.0 3.5.0 ignoredbversion > upgrade.log
|
||||||
# - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
|
# - php upgrade2.php 3.4.0 3.5.0 ignoredbversion > upgrade2.log
|
||||||
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log
|
- php upgrade.php 3.5.0 3.6.0 ignoredbversion >> upgrade.log
|
||||||
- php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
|
- php upgrade2.php 3.5.0 3.6.0 ignoredbversion >> upgrade2.log
|
||||||
- php upgrade.php 3.6.0 3.7.0 >> upgrade.log
|
- php upgrade.php 3.6.0 3.7.0 ignoredbversion >> upgrade.log
|
||||||
# - cat upgrade360370.log
|
# - cat upgrade360370.log
|
||||||
- php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
|
- php upgrade2.php 3.6.0 3.7.0 ignoredbversion >> upgrade2.log
|
||||||
# - cat upgrade2.log
|
# - cat upgrade2.log
|
||||||
- cd ../..
|
- cd ../..
|
||||||
- date
|
- date
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[main]
|
[main]
|
||||||
host = https://www.transifex.com
|
host = https://www.transifex.com
|
||||||
lang_map = uz: uz_UZ
|
lang_map = uz: uz_UZ, sw: sw_SW
|
||||||
|
|
||||||
[dolibarr.accountancy]
|
[dolibarr.accountancy]
|
||||||
file_filter = htdocs/langs/<lang>/accountancy.lang
|
file_filter = htdocs/langs/<lang>/accountancy.lang
|
||||||
|
|||||||
@ -13,6 +13,7 @@ Component Version License GPL Compatible
|
|||||||
-------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------
|
||||||
PHP libraries:
|
PHP libraries:
|
||||||
AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package)
|
AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package)
|
||||||
|
ChromePHP 4.3.3 Apache Software License 2.0 Yes Return server log to chrome browser console
|
||||||
CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG
|
CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG
|
||||||
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management
|
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management
|
||||||
FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management
|
FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management
|
||||||
|
|||||||
70
ChangeLog
70
ChangeLog
@ -2,6 +2,12 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
|
||||||
|
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
|
||||||
|
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
|
||||||
|
Upgrading to any other version or database system is abolutely required BEFORE trying to
|
||||||
|
make a migration.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 3.7 compared to 3.6.* *****
|
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||||
For users:
|
For users:
|
||||||
@ -85,6 +91,8 @@ For users:
|
|||||||
- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export.
|
- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export.
|
||||||
- New : Option on extrafields to have them always editable regardless of the document status.
|
- New : Option on extrafields to have them always editable regardless of the document status.
|
||||||
- New : New module PrintIPP to print without opening document is available as stable.
|
- New : New module PrintIPP to print without opening document is available as stable.
|
||||||
|
- New : Introduce hidden option STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS to solve at no risk
|
||||||
|
a missing control on missing warehouse.
|
||||||
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
|
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
|
||||||
- Fix: [ bug #1470, #1472, #1473] User trigger problem
|
- Fix: [ bug #1470, #1472, #1473] User trigger problem
|
||||||
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
|
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
|
||||||
@ -128,6 +136,7 @@ For translators:
|
|||||||
- New: When a translation is not available we always jump to en_US and only en_US.
|
- New: When a translation is not available we always jump to en_US and only en_US.
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
|
- New: Syslog module can be set to use ChromePHP plugin to output log server into browser console.
|
||||||
- New: Add a css style "cursorpointer".
|
- New: Add a css style "cursorpointer".
|
||||||
- New: Select list of users can return user into hierarchy.
|
- New: Select list of users can return user into hierarchy.
|
||||||
- New: getBrowserInfo can return type of layout of browser (classic/phone/tablet)
|
- New: getBrowserInfo can return type of layout of browser (classic/phone/tablet)
|
||||||
@ -169,32 +178,53 @@ Dolibarr better:
|
|||||||
- A lot of pages called liste.php were renamed into list.php
|
- A lot of pages called liste.php were renamed into list.php
|
||||||
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
|
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
|
||||||
warehouse module and your Point Of Sale module if you use one.
|
warehouse module and your Point Of Sale module if you use one.
|
||||||
|
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook
|
||||||
|
|
||||||
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
|
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
|
||||||
- Fix: ref_ext was not saved when recording a customer order from web service
|
- Fix: ref_ext was not saved when recording a customer order from web service
|
||||||
- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid.
|
|
||||||
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
|
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
|
||||||
|
- Fix: amarok is a bugged theme making dolidroid failed. We switch to eldy automatically with dolidroid.
|
||||||
- Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php
|
- Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php
|
||||||
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
|
- Fix: withdrawal create error if in the same month are deleted previous withdrawals.
|
||||||
- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
|
- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
|
||||||
- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database
|
- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database
|
||||||
- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects
|
- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects
|
||||||
- Fix: [ bug #1804 ] SQL error when sending email without addresee
|
- Fix: [ bug #1804 ] SQL error when sending email without address
|
||||||
- Fix: [ bug #1803 ] AJAX company contact input is not aligned
|
- Fix: [ bug #1803 ] AJAX company contact input is not aligned
|
||||||
- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook
|
- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook
|
||||||
- Fix: [ bug #1796 ] Unable to use numeration modules from an external module
|
- Fix: [ bug #1796 ] Unable to use numeration modules from an external module
|
||||||
- Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON
|
- Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON
|
||||||
- Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount
|
- Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount
|
||||||
- Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme
|
- Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme
|
||||||
|
- Fix: Tracking number not visible on shipment pdf
|
||||||
|
- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL database
|
||||||
|
- Fix: [ bug #1819 ] SQL error when searching for an invoice payment
|
||||||
|
- Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes
|
||||||
|
- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL
|
||||||
|
- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object
|
||||||
|
- Fix: [ bug #1833 ] user permissions in contact/note.php not working
|
||||||
|
- Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php
|
||||||
|
- Fix: [ bug #1830 ] Salaries payment only allows checking accounts
|
||||||
|
- Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work
|
||||||
|
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
|
||||||
|
- Fix: Bad SEPA xml file creation
|
||||||
|
- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
|
||||||
|
- Fix: Showing system error if not enough stock of product into orders creation with lines
|
||||||
|
- Fix: [ bug #2543 ] Untranslated "Contract" origin string when creating an invoice from a contract
|
||||||
|
- Fix: [ bug #2534 ] SQL error when editing a supplier invoice line
|
||||||
|
- Fix: [ bug #2535 ] Untranslated string in "Linked objects" page of a project
|
||||||
|
- Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme
|
||||||
|
- Fix: [ bug #2542 ] Contracts store localtax preferences
|
||||||
|
- Fix: Bad permission assignments for stock movements actions
|
||||||
|
|
||||||
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
|
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
|
||||||
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
|
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
|
||||||
- Fix: bug 1588 : relative discount.
|
- Fix: bug 1588 : relative discount.
|
||||||
- Fix: label of input method not tranlated.
|
- Fix: label of input method not translated.
|
||||||
- Fix: box of customer and propsects were not correctly disabled.
|
- Fix: box of customer and prospects were not correctly disabled.
|
||||||
- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
|
- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
|
||||||
- Fix: Civility & birthdate wasn't save into adherent module.
|
- Fix: Civility & birthdate wasn't save into adherent module.
|
||||||
- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
|
- Fix: webservice Thirdparty parameter lastname for individual creation is now lastname and not ref
|
||||||
- Fix: Chars - is no more allowed into value for code for extra fields.
|
- Fix: Chars - is no more allowed into value for code for extra fields.
|
||||||
- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
|
- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
|
||||||
- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state
|
- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state
|
||||||
@ -222,14 +252,14 @@ For users:
|
|||||||
- Fix: Iban was used instead of Bic into SEPA file.
|
- Fix: Iban was used instead of Bic into SEPA file.
|
||||||
- Fix: Must unaccent strings into SEPA file.
|
- Fix: Must unaccent strings into SEPA file.
|
||||||
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
|
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
|
||||||
- Fix: cents for indian ruppes are calle paisa and paise.
|
- Fix: cents for indian ruppes are called paisa and paise.
|
||||||
- Fix: Invoices payments may be older than invoices.
|
- Fix: Invoices payments may be older than invoices.
|
||||||
- Fix: Withdrawal total amount is double
|
- Fix: Withdrawal total amount is double
|
||||||
- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line
|
- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line
|
||||||
- Fix: Web service categorie WDSL declaration is correct
|
- Fix: Web service categorie WDSL declaration is correct
|
||||||
- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined
|
- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined
|
||||||
- Fix: Category creation failed and no message output
|
- Fix: Category creation failed and no message output
|
||||||
- Fix: Lanf for Payment Type
|
- Fix: Lang for Payment Type
|
||||||
- Fix: PHPCheckstyle 1.5.5
|
- Fix: PHPCheckstyle 1.5.5
|
||||||
|
|
||||||
***** ChangeLog for 3.6 compared to 3.5.* *****
|
***** ChangeLog for 3.6 compared to 3.5.* *****
|
||||||
@ -251,12 +281,12 @@ For users:
|
|||||||
- New: Improved Opensurvey module:
|
- New: Improved Opensurvey module:
|
||||||
Added options to disable comments and disable public votes.
|
Added options to disable comments and disable public votes.
|
||||||
Limit dates use calendar popup.
|
Limit dates use calendar popup.
|
||||||
Description of survey use wysiwig editor.
|
Description of survey use wysiwyg editor.
|
||||||
More information shown on result tab.
|
More information shown on result tab.
|
||||||
Renamed "survey" into "poll" (better translation).
|
Renamed "survey" into "poll" (better translation).
|
||||||
- New: Add filter on text and status into survey list. Can also sort on id, text and date end.
|
- New: Add filter on text and status into survey list. Can also sort on id, text and date end.
|
||||||
- New: The box "balance of bank accounts" show all opened accounts.
|
- New: The box "balance of bank accounts" show all opened accounts.
|
||||||
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale represnative into public
|
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale representative into public
|
||||||
note of generated documents.
|
note of generated documents.
|
||||||
- New: Add warning if supplier payment is higher that due amount.
|
- New: Add warning if supplier payment is higher that due amount.
|
||||||
- New: Increase length of url into bookmark module.
|
- New: Increase length of url into bookmark module.
|
||||||
@ -269,7 +299,7 @@ For users:
|
|||||||
- New: Add barcode fields into user database.
|
- New: Add barcode fields into user database.
|
||||||
- New: Add manager name (ceo, director, president...) into main company information page.
|
- New: Add manager name (ceo, director, president...) into main company information page.
|
||||||
- New: Add field url as product properties.
|
- New: Add field url as product properties.
|
||||||
- New: More options to create a credit note (can be filled autatically according to remain to pay).
|
- New: More options to create a credit note (can be filled automatically according to remain to pay).
|
||||||
- New: Can define custom fields for categories.
|
- New: Can define custom fields for categories.
|
||||||
- New: Prepare generation of SEPA files into module withdrawal.
|
- New: Prepare generation of SEPA files into module withdrawal.
|
||||||
- New: [ task #1164 ] Add "Ref. supplier" search box in supplier orders
|
- New: [ task #1164 ] Add "Ref. supplier" search box in supplier orders
|
||||||
@ -286,7 +316,7 @@ For users:
|
|||||||
- New: [ task #926 ] Add extrafield feature on order lines.
|
- New: [ task #926 ] Add extrafield feature on order lines.
|
||||||
- New: [ task #927 ] Add extrafield feature on Proposal lines.
|
- New: [ task #927 ] Add extrafield feature on Proposal lines.
|
||||||
- New: [ task #928 ] Add extrafield feature on invoice lines.
|
- New: [ task #928 ] Add extrafield feature on invoice lines.
|
||||||
- New: Paypal/paybox email sent after backcall of a payment is now a formated and translated
|
- New: Paypal/paybox email sent after backcall of a payment is now a formatted and translated
|
||||||
HTML content. For member subscription renewal, there is also a link to member.
|
HTML content. For member subscription renewal, there is also a link to member.
|
||||||
- New: When a subscription is recorded with invoice and payment:
|
- New: When a subscription is recorded with invoice and payment:
|
||||||
- the document (PDF) of invoice is also generated.
|
- the document (PDF) of invoice is also generated.
|
||||||
@ -342,16 +372,22 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
|
|||||||
So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable
|
So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable
|
||||||
default standard behaviour.
|
default standard behaviour.
|
||||||
- Properties "civilite_id" were renamed into "civility_id".
|
- Properties "civilite_id" were renamed into "civility_id".
|
||||||
- Remove add_photo_web() that is ot used anymore by core code.
|
- Remove add_photo_web() that is not used anymore by core code.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 3.5.7 compared to 3.5.6 *****
|
***** ChangeLog for 3.5.7 compared to 3.5.6 *****
|
||||||
Fix: Paypal link were broken dur to SSL v3 closed.
|
Fix: Paypal link were broken due to SSL v3 closed.
|
||||||
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers
|
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers
|
||||||
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
|
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
|
||||||
Fix: [ bug #1757 ] Sorting breaks product/service statistics
|
Fix: [ bug #1757 ] Sorting breaks product/service statistics
|
||||||
Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date
|
Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date
|
||||||
Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled
|
Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled
|
||||||
|
Fix: [ bug #1846 ] Browser IE11 not detected
|
||||||
|
Fix: [ bug #1906 ] Deplacement does not allow translated decimal format
|
||||||
|
Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card
|
||||||
|
Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers
|
||||||
|
Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project
|
||||||
|
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
|
||||||
|
|
||||||
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
|
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
|
||||||
Fix: Avoid missing class error for fetch_thirdparty method #1973
|
Fix: Avoid missing class error for fetch_thirdparty method #1973
|
||||||
@ -365,7 +401,7 @@ Fix: Bad days and month reported by function.
|
|||||||
Fix: Bad margin calculation.
|
Fix: Bad margin calculation.
|
||||||
|
|
||||||
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
|
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
|
||||||
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
|
Fix: Holiday module was broken. Initialization of amount of holidays failed.
|
||||||
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
|
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
|
||||||
Fix: Fusion PDF button on unpaid invoice is no more displayed.
|
Fix: Fusion PDF button on unpaid invoice is no more displayed.
|
||||||
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click).
|
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click).
|
||||||
@ -400,7 +436,7 @@ Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender.
|
|||||||
Fix: Question about warehouse must not be done when module stock is disabled.
|
Fix: Question about warehouse must not be done when module stock is disabled.
|
||||||
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
|
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
|
||||||
(missing test at some places).
|
(missing test at some places).
|
||||||
Fix: Renaming a project with uplaoded files failed.
|
Fix: Renaming a project with uploaded files failed.
|
||||||
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
|
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
|
||||||
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
|
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
|
||||||
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
|
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
|
||||||
@ -421,7 +457,7 @@ Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and
|
|||||||
Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler.
|
Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler.
|
||||||
Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order.
|
Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order.
|
||||||
Fix: [ bug #1454 ] Mention de bas de page erroné
|
Fix: [ bug #1454 ] Mention de bas de page erroné
|
||||||
Fix: Do not display dictionnay for non activated module
|
Fix: Do not display dictionary for non activated module
|
||||||
Fix: Link element from element project pages
|
Fix: Link element from element project pages
|
||||||
Fix: [ bug #1509 ] Expedition admin free text & watermark submit error
|
Fix: [ bug #1509 ] Expedition admin free text & watermark submit error
|
||||||
Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card
|
Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card
|
||||||
|
|||||||
@ -21,8 +21,9 @@ vous devez vous réorienter vers DoliWamp (la version tout-en-un
|
|||||||
de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou
|
de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou
|
||||||
Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
|
Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
|
||||||
OpenSuse, Mandriva ou Mageia).
|
OpenSuse, Mandriva ou Mageia).
|
||||||
Vous pouvez les télécharger à l'adresse:
|
|
||||||
http://www.dolibarr.org/downloads/
|
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
||||||
|
http://www.dolibarr.org/
|
||||||
|
|
||||||
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql),
|
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql),
|
||||||
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
||||||
|
|||||||
@ -15,7 +15,7 @@ Dolibarr is released under the terms of the GNU General Public License as publis
|
|||||||
|
|
||||||
If you have no technical knowledge, and you are looking for an autoinstaller to install Dolibarr ERP/CRM in few clicks, you must download DoliWamp (the all-in-one package of Dolibarr for Windows), DoliDeb (the all-in-one package of Dolibarr for Debian or Ubuntu) or DoliRpm (the all-in-one package of Dolibarr for Fedora, Redhat, Opensuse, Mandriva or Mageia).
|
If you have no technical knowledge, and you are looking for an autoinstaller to install Dolibarr ERP/CRM in few clicks, you must download DoliWamp (the all-in-one package of Dolibarr for Windows), DoliDeb (the all-in-one package of Dolibarr for Debian or Ubuntu) or DoliRpm (the all-in-one package of Dolibarr for Fedora, Redhat, Opensuse, Mandriva or Mageia).
|
||||||
|
|
||||||
You can download this at: [Official website] (<http://www.dolibarr.org/downloads/>)
|
You can download this from the download area of [Official website] (<http://www.dolibarr.org/>)
|
||||||
|
|
||||||
If you already have installed a Web server and a Mysql database, you can install the standard version like this:
|
If you already have installed a Web server and a Mysql database, you can install the standard version like this:
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,6 @@ Note: Prerequisites to build autoexe DoliWamp package:
|
|||||||
recommanded), open file build/exe/doliwamp.iss and click on button "Compile".
|
recommanded), open file build/exe/doliwamp.iss and click on button "Compile".
|
||||||
The .exe file will be build into directory build.
|
The .exe file will be build into directory build.
|
||||||
|
|
||||||
- To build a translaction package, launch the script
|
|
||||||
> perl makepack-dolibarrlang.pl
|
|
||||||
|
|
||||||
- To build a theme package, launch the script
|
- To build a theme package, launch the script
|
||||||
> perl makepack-dolibarrtheme.pl
|
> perl makepack-dolibarrtheme.pl
|
||||||
|
|
||||||
|
|||||||
@ -3,4 +3,4 @@ dolibarr (3.7.0-3) UNRELEASED; urgency=low
|
|||||||
[ Laurent Destailleur (eldy) ]
|
[ Laurent Destailleur (eldy) ]
|
||||||
* New upstream release.
|
* New upstream release.
|
||||||
|
|
||||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 21 Oct 2014 12:00:00 +0100
|
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sun, 21 March 2015 12:00:00 +0100
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# \file build/makepack-dolibarr.pl
|
# \file build/makepack-dolibarr.pl
|
||||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||||
# \author (c)2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
# \author (c)2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||||
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
||||||
@ -15,8 +15,12 @@
|
|||||||
|
|
||||||
use Cwd;
|
use Cwd;
|
||||||
|
|
||||||
|
|
||||||
|
# Change this to defined target for option 98 and 99
|
||||||
$PROJECT="dolibarr";
|
$PROJECT="dolibarr";
|
||||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||||
|
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||||
|
|
||||||
|
|
||||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||||
%REQUIREMENTPUBLISH=(
|
%REQUIREMENTPUBLISH=(
|
||||||
@ -41,6 +45,7 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD
|
|||||||
"makensis.exe"=>"NSIS"
|
"makensis.exe"=>"NSIS"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||||
if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
|
if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
|
||||||
if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse
|
if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse
|
||||||
if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
|
if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
|
||||||
@ -59,8 +64,6 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
|
|||||||
|
|
||||||
$SOURCE="$DIR/..";
|
$SOURCE="$DIR/..";
|
||||||
$DESTI="$SOURCE/build";
|
$DESTI="$SOURCE/build";
|
||||||
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
|
||||||
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/files";
|
|
||||||
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
||||||
{
|
{
|
||||||
print "Error: Missing environment variables.\n";
|
print "Error: Missing environment variables.\n";
|
||||||
@ -210,9 +213,9 @@ else {
|
|||||||
printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
|
printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
|
||||||
}
|
}
|
||||||
$cpt=98;
|
$cpt=98;
|
||||||
printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
|
printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".$REQUIREMENTPUBLISH{"ASSO"});
|
||||||
$cpt=99;
|
$cpt=99;
|
||||||
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
|
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"});
|
||||||
|
|
||||||
# Ask which target to build
|
# Ask which target to build
|
||||||
print "Choose one package number or several separated with space (0 - ".$cpt."): ";
|
print "Choose one package number or several separated with space (0 - ".$cpt."): ";
|
||||||
@ -951,6 +954,8 @@ if ($nboftargetok) {
|
|||||||
print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
|
print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
|
||||||
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
|
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
|
||||||
|
|
||||||
|
print "Check that in your Wine setup, you create a Z: drive that point to your /tmp directory.\n";
|
||||||
|
|
||||||
$SOURCEBACK=$SOURCE;
|
$SOURCEBACK=$SOURCE;
|
||||||
$SOURCEBACK =~ s/\//\\/g;
|
$SOURCEBACK =~ s/\//\\/g;
|
||||||
|
|
||||||
@ -958,7 +963,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||||
|
|
||||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n";
|
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n";
|
||||||
$cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
$cmd= "ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
||||||
print "$cmd\n";
|
print "$cmd\n";
|
||||||
$ret= `$cmd`;
|
$ret= `$cmd`;
|
||||||
#print "$ret\n";
|
#print "$ret\n";
|
||||||
@ -1028,9 +1033,16 @@ if ($nboftargetok) {
|
|||||||
if (! $filesize) { next; }
|
if (! $filesize) { next; }
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print "Publish file ".$file." to ".$filestoscan{$file}."\n";
|
|
||||||
|
|
||||||
|
if ($target eq 'SF') {
|
||||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||||
|
print "Publish file ".$file." to $NEWPUBLISH/".$filestoscan{$file}."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$destFolder="$NEWPUBLISH";
|
||||||
|
print "Publish file ".$file." to $NEWPUBLISH\n";
|
||||||
|
}
|
||||||
|
|
||||||
# mkdir
|
# mkdir
|
||||||
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
|
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
|
||||||
|
|||||||
@ -8,7 +8,7 @@ This files describe steps made by Dolibarr packaging team to make a
|
|||||||
beta version of Dolibarr, step by step.
|
beta version of Dolibarr, step by step.
|
||||||
|
|
||||||
- Check all files are commited.
|
- Check all files are commited.
|
||||||
- Update version/info in /ChangeLog
|
- Update version/info in ChangeLog. To generate a changelog, you can do "git log x.y.z..HEAD --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIXED\|NEW'"
|
||||||
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
|
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
|
||||||
- Update version number with x.y.z-w in build/debian/changelog
|
- Update version number with x.y.z-w in build/debian/changelog
|
||||||
- Update version number with x.y.z-w in build/rpm/*.spec
|
- Update version number with x.y.z-w in build/rpm/*.spec
|
||||||
@ -17,10 +17,11 @@ beta version of Dolibarr, step by step.
|
|||||||
- Create a branch (x.y).
|
- Create a branch (x.y).
|
||||||
|
|
||||||
- Run makepack-dolibarr.pl to generate all packages.
|
- Run makepack-dolibarr.pl to generate all packages.
|
||||||
|
|
||||||
- Move build files into www.dolibarr.org web site
|
- Move build files into www.dolibarr.org web site
|
||||||
(/home/dolibarr/wwwroot/files/lastbuild).
|
(/home/dolibarr/wwwroot/files/lastbuild).
|
||||||
|
|
||||||
- Post a news on dolibarr.org/dolibarr.fr
|
- Post a news on dolibarr.org/dolibarr.fr + social networks
|
||||||
- Send mail on mailings-list
|
- Send mail on mailings-list
|
||||||
|
|
||||||
|
|
||||||
@ -35,14 +36,16 @@ complete release of Dolibarr, step by step.
|
|||||||
- Update version number with x.y.z in build/rpm/*.spec
|
- Update version number with x.y.z in build/rpm/*.spec
|
||||||
- Commit all changes.
|
- Commit all changes.
|
||||||
|
|
||||||
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl
|
- Run makepack-dolibarr.pl to generate all packages.
|
||||||
|
|
||||||
- Check content of built packages.
|
- Check content of built packages.
|
||||||
- Move build files into www.dolibarr.org web site
|
- Move build files into www.dolibarr.org web site
|
||||||
(/home/dolibarr/wwwroot/files/stable).
|
(/home/dolibarr/wwwroot/files/stable).
|
||||||
|
|
||||||
- Run makepack-dolibarr.pl again with option to publish files on
|
- Run makepack-dolibarr.pl again with option to publish files on
|
||||||
sourceforge. This will also add official tag.
|
sourceforge. This will also add official tag.
|
||||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
|
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
|
||||||
on server to point to new files (used by some web sites).
|
on server to point to new files (used by some web sites).
|
||||||
|
|
||||||
|
- Post a news on dolibarr.org/dolibarr.fr + social networks
|
||||||
- Send mail on mailings-list
|
- Send mail on mailings-list
|
||||||
- Send news on OpenSource web sites (if major beta or release)
|
|
||||||
|
|||||||
@ -164,8 +164,6 @@
|
|||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="Generic.VersionControl.SubversionProperties" />
|
|
||||||
|
|
||||||
<!-- Disallow usage of tab -->
|
<!-- Disallow usage of tab -->
|
||||||
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
|
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
|
||||||
|
|
||||||
|
|||||||
68
dev/fixaltlanguages.sh
Executable file
68
dev/fixaltlanguages.sh
Executable file
@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Recursively deduplicate file lines on a per file basis
|
||||||
|
# Useful to deduplicate language files
|
||||||
|
#
|
||||||
|
# Needs awk 4.0 for the inplace fixing command
|
||||||
|
#
|
||||||
|
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||||
|
|
||||||
|
# Syntax
|
||||||
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
|
then
|
||||||
|
echo "Scan alternate language files and remove entries found into parent file"
|
||||||
|
echo "Usage: fixaltlanguages.sh (list|fix) (all|file.lang) [xx_XX]"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
if [ "x$2" = "x" ]
|
||||||
|
then
|
||||||
|
echo "Scan alternate language files and remove entries found into parent file"
|
||||||
|
echo "Usage: fixaltlanguages.sh (list|fix) (all|file.lang) [xx_XX]"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# To detect
|
||||||
|
if [ "x$1" = "xlist" ]
|
||||||
|
then
|
||||||
|
echo Feature not available
|
||||||
|
fi
|
||||||
|
|
||||||
|
# To fix
|
||||||
|
if [ "x$1" = "xfix" ]
|
||||||
|
then
|
||||||
|
for dir in `find htdocs/langs/$3* -type d`
|
||||||
|
do
|
||||||
|
dirshort=`basename $dir`
|
||||||
|
|
||||||
|
#echo $dirshort
|
||||||
|
|
||||||
|
export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'`
|
||||||
|
export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'`
|
||||||
|
aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'`
|
||||||
|
if [ $aaupper = "EN" ]
|
||||||
|
then
|
||||||
|
aaupper="US"
|
||||||
|
fi
|
||||||
|
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
||||||
|
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
||||||
|
then
|
||||||
|
reflang="htdocs/langs/"$aa"_"$aaupper
|
||||||
|
if [ -d $reflang ]
|
||||||
|
then
|
||||||
|
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
|
||||||
|
echo $dirshort est une langue alternative de $reflang
|
||||||
|
echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
|
||||||
|
./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
|
||||||
|
for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
|
||||||
|
for fic in `ls htdocs/langs/${aa}_${bb}/*.lang`;
|
||||||
|
do f=`cat $fic | wc -l`;
|
||||||
|
#echo $f lines into file $fic;
|
||||||
|
if [ $f = 1 ]
|
||||||
|
then
|
||||||
|
echo Only one line remainging into file $fic, we delete it;
|
||||||
|
rm $fic
|
||||||
|
fi;
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done;
|
||||||
|
fi
|
||||||
@ -10,6 +10,7 @@
|
|||||||
# Syntax
|
# Syntax
|
||||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
then
|
then
|
||||||
|
echo "Detect and fix files ending with bad ending chars (must be LF)"
|
||||||
echo "Usage: fixdosfiles.sh [list|fix]"
|
echo "Usage: fixdosfiles.sh [list|fix]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
# Syntax
|
# Syntax
|
||||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
then
|
then
|
||||||
|
echo "Detect duplicate translation keys inside a file (there is no cross file check)."
|
||||||
echo "Usage: detectduplicatelangkey.sh (list|fix)"
|
echo "Usage: detectduplicatelangkey.sh (list|fix)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -9,17 +9,19 @@
|
|||||||
# Syntax
|
# Syntax
|
||||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
then
|
then
|
||||||
|
echo "Find exact duplicated lines into file (not cross file checking)"
|
||||||
echo "Usage: deduplicatefilelinesrecursively.sh [list|fix]"
|
echo "Usage: deduplicatefilelinesrecursively.sh [list|fix]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# To detect
|
# To detect
|
||||||
if [ "x$1" = "xlist" ]
|
if [ "x$1" = "xlist" ]
|
||||||
then
|
then
|
||||||
for file in `find . -type f -name *.lang`
|
for file in `find htdocs/langs/en_US -type f -name *.lang`
|
||||||
do
|
do
|
||||||
if [ `sort "$file" | uniq -d | wc -l` -gt 0 ]
|
if [ `sort "$file" | grep -v '^$' | uniq -d | wc -l` -gt 0 ]
|
||||||
then
|
then
|
||||||
echo "$file"
|
echo "***** $file"
|
||||||
|
sort "$file" | grep -v '^$' | uniq -d
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -27,7 +29,7 @@ fi
|
|||||||
# To fix
|
# To fix
|
||||||
if [ "x$1" = "xfix" ]
|
if [ "x$1" = "xfix" ]
|
||||||
then
|
then
|
||||||
for file in `find . -type f -name *.lang`
|
for file in `find htdocs/langs/en_US -type f -name *.lang`
|
||||||
do
|
do
|
||||||
awk -i inplace ' !x[$0]++' "$file"
|
awk -i inplace ' !x[$0]++' "$file"
|
||||||
done;
|
done;
|
||||||
@ -10,6 +10,7 @@
|
|||||||
# Syntax
|
# Syntax
|
||||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
then
|
then
|
||||||
|
echo "Fix permissions of files"
|
||||||
echo "Usage: fixperms.sh (list|fix)"
|
echo "Usage: fixperms.sh (list|fix)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
# Syntax
|
# Syntax
|
||||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
then
|
then
|
||||||
|
echo "Detect and fix bad UTF8 encoded files (UTF8 must not use BOM char)"
|
||||||
echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]"
|
echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -114,7 +114,7 @@ class modMyModule extends DolibarrModules
|
|||||||
|
|
||||||
// Array to add new pages in new tabs
|
// Array to add new pages in new tabs
|
||||||
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
|
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
|
||||||
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
|
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||||
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||||
// where objecttype can be
|
// where objecttype can be
|
||||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
* cd htdocs/langs
|
* cd htdocs/langs
|
||||||
* ../../dev/translation/strip_language_file.php <primary_lang_dir> <secondary_lang_dir> [file.lang|all]
|
* ./dev/translation/strip_language_file.php <primary_lang_dir> <secondary_lang_dir> [file.lang|all]
|
||||||
*
|
*
|
||||||
* To rename all .delta files, you can do
|
* To rename all .delta files, you can do
|
||||||
* for fic in `ls *.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
|
* for fic in `ls *.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
|
||||||
@ -60,24 +60,26 @@ $rc = 0;
|
|||||||
|
|
||||||
$lPrimary = isset($argv[1])?$argv[1]:'';
|
$lPrimary = isset($argv[1])?$argv[1]:'';
|
||||||
$lSecondary = isset($argv[2])?$argv[2]:'';
|
$lSecondary = isset($argv[2])?$argv[2]:'';
|
||||||
|
$lEnglish = 'en_US';
|
||||||
$filesToProcess = isset($argv[3])?$argv[3]:'';
|
$filesToProcess = isset($argv[3])?$argv[3]:'';
|
||||||
|
|
||||||
if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
|
if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
|
||||||
{
|
{
|
||||||
$rc = 1;
|
$rc = 1;
|
||||||
$msg = '***** Script to clean language files *****'."\n";
|
$msg = '***** Script to clean language files *****'."\n";
|
||||||
$msg.= 'Usage: ../../dev/translation/strip_language_file.php xx_XX xx_YY [file.lang|all]'."\n";
|
$msg.= 'Usage: ./dev/translation/strip_language_file.php xx_XX xx_YY [file.lang|all]'."\n";
|
||||||
print $msg . "(rc=$rc).\n";
|
print $msg . "(rc=$rc).\n";
|
||||||
exit($rc);
|
exit($rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
$aPrimary = array();
|
$aPrimary = array();
|
||||||
$aSecondary = array();
|
$aSecondary = array();
|
||||||
|
$aEnglish = array();
|
||||||
|
|
||||||
// Define array $filesToProcess
|
// Define array $filesToProcess
|
||||||
if ($filesToProcess == 'all')
|
if ($filesToProcess == 'all')
|
||||||
{
|
{
|
||||||
$dir = new DirectoryIterator($lPrimary);
|
$dir = new DirectoryIterator('htdocs/langs/'.$lPrimary);
|
||||||
while($dir->valid()) {
|
while($dir->valid()) {
|
||||||
if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) {
|
if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) {
|
||||||
$files[] = $dir->getFilename();
|
$files[] = $dir->getFilename();
|
||||||
@ -94,8 +96,9 @@ else $filesToProcess=explode(',',$filesToProcess);
|
|||||||
// Loop on each file
|
// Loop on each file
|
||||||
foreach($filesToProcess as $fileToProcess)
|
foreach($filesToProcess as $fileToProcess)
|
||||||
{
|
{
|
||||||
$lPrimaryFile = $lPrimary.'/'.$fileToProcess;
|
$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
|
||||||
$lSecondaryFile = $lSecondary.'/'.$fileToProcess;
|
$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
|
||||||
|
$lEnglishFile = 'htdocs/langs/'.$lEnglish.'/'.$fileToProcess;
|
||||||
$output = $lSecondaryFile . '.delta';
|
$output = $lSecondaryFile . '.delta';
|
||||||
|
|
||||||
print "---- Process language file ".$lSecondaryFile."\n";
|
print "---- Process language file ".$lSecondaryFile."\n";
|
||||||
@ -114,6 +117,13 @@ foreach($filesToProcess as $fileToProcess)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! is_readable($lEnglishFile) ) {
|
||||||
|
$rc = 3;
|
||||||
|
$msg = "Cannot read english language file $lEnglishFile. We discard this file.";
|
||||||
|
print $msg . "\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Start reading and parsing Secondary
|
// Start reading and parsing Secondary
|
||||||
|
|
||||||
if ( $handle = fopen($lSecondaryFile, 'r') )
|
if ( $handle = fopen($lSecondaryFile, 'r') )
|
||||||
@ -172,6 +182,65 @@ foreach($filesToProcess as $fileToProcess)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Start reading and parsing English
|
||||||
|
|
||||||
|
if ( $handle = fopen($lEnglishFile, 'r') )
|
||||||
|
{
|
||||||
|
print "Read English File $lEnglishFile:\n";
|
||||||
|
$cnt = 0;
|
||||||
|
while (($line = fgets($handle)) !== false)
|
||||||
|
{
|
||||||
|
$cnt++;
|
||||||
|
|
||||||
|
// strip comments
|
||||||
|
if ( preg_match("/^\w*#/", $line) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// strip empty lines
|
||||||
|
if ( preg_match("/^\w*$/", $line) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$a = mb_split('=', trim($line), 2);
|
||||||
|
if ( count($a) != 2 ) {
|
||||||
|
print "ERROR in file $lEnglishFile, line $cnt: " . trim($line) . "\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
list($key, $value) = $a;
|
||||||
|
|
||||||
|
// key is redundant
|
||||||
|
if ( array_key_exists($key, $aEnglish) ) {
|
||||||
|
print "Key $key is redundant in file $lEnglishFile (line: $cnt).\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// String has no value
|
||||||
|
if ( $value == '' ) {
|
||||||
|
print "Key $key has no value in file $lEnglishFile (line: $cnt).\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$aEnglish[$key] = trim($value);
|
||||||
|
}
|
||||||
|
if ( ! feof($handle) )
|
||||||
|
{
|
||||||
|
$rc = 5;
|
||||||
|
$msg = "Unexpected fgets() fail";
|
||||||
|
print $msg . " (rc=$rc).\n";
|
||||||
|
exit($rc);
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$rc = 6;
|
||||||
|
$msg = "Cannot open file $lEnglishFile";
|
||||||
|
print $msg . " (rc=$rc).\n";
|
||||||
|
exit($rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Start reading and parsing Primary. See rules in header!
|
// Start reading and parsing Primary. See rules in header!
|
||||||
|
|
||||||
$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
|
$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
|
||||||
@ -246,7 +315,11 @@ foreach($filesToProcess as $fileToProcess)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// String exists in both files and does not match
|
// String exists in both files and does not match
|
||||||
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key))
|
if (
|
||||||
|
(! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
|
||||||
|
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|
||||||
|
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
//print "Key $key differs so we add it into new secondary language (line: $cnt).\n";
|
//print "Key $key differs so we add it into new secondary language (line: $cnt).\n";
|
||||||
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");
|
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");
|
||||||
@ -270,8 +343,8 @@ foreach($filesToProcess as $fileToProcess)
|
|||||||
|
|
||||||
print "Output can be found at $output.\n";
|
print "Output can be found at $output.\n";
|
||||||
|
|
||||||
print "To rename all .delta files, you can do\n";
|
print "To rename all .delta files, you can do:\n";
|
||||||
print 'for fic in `ls *.delta`; do f=`echo $fic | sed -e \'s/\.delta//\'`; echo $f; mv $f.delta $f; done'."\n";
|
print '> for fic in `ls htdocs/langs/'.$lSecondary.'/*.delta`; do f=`echo $fic | sed -e \'s/\.delta//\'`; echo $f; mv $f.delta $f; done'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ then
|
|||||||
echo "This pull remote transifex files to local dir."
|
echo "This pull remote transifex files to local dir."
|
||||||
echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
|
echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
|
||||||
echo " Using -f will overwrite local file (does not work with 'all')."
|
echo " Using -f will overwrite local file (does not work with 'all')."
|
||||||
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]"
|
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] [-s]"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -26,13 +26,20 @@ fi
|
|||||||
|
|
||||||
if [ "x$1" = "xall" ]
|
if [ "x$1" = "xall" ]
|
||||||
then
|
then
|
||||||
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
|
for dir in `find htdocs/langs/* -type d`
|
||||||
do
|
do
|
||||||
|
fic=`basename $dir`
|
||||||
|
if [ $fic != "en_US" ]
|
||||||
|
then
|
||||||
echo "tx pull -l $fic $2 $3"
|
echo "tx pull -l $fic $2 $3"
|
||||||
tx pull -l $fic $2 $3
|
tx pull -l $fic $2 $3
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
cd -
|
||||||
else
|
else
|
||||||
echo "tx pull -l $1 $2 $3 $4"
|
echo "tx pull -l $1 $2 $3 $4 $5"
|
||||||
tx pull -l $1 $2 $3 $4
|
tx pull -l $1 $2 $3 $4 $5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo Think to launch also:
|
||||||
|
echo "> dev/fixaltlanguages.sh fix all"
|
||||||
|
|||||||
@ -25,7 +25,7 @@ fi
|
|||||||
|
|
||||||
if [ "x$1" = "xall" ]
|
if [ "x$1" = "xall" ]
|
||||||
then
|
then
|
||||||
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
|
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
|
||||||
do
|
do
|
||||||
echo "tx push --skip -t -l $fic $2 $3"
|
echo "tx push --skip -t -l $fic $2 $3"
|
||||||
tx push --skip -t -l $fic $2 $3
|
tx push --skip -t -l $fic $2 $3
|
||||||
|
|||||||
@ -94,7 +94,6 @@ if ($result)
|
|||||||
while ($i < $num && $i < $max)
|
while ($i < $num && $i < $max)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$fiscalyearstatic->ref=$obj->rowid;
|
|
||||||
$fiscalyearstatic->id=$obj->rowid;
|
$fiscalyearstatic->id=$obj->rowid;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';
|
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';
|
||||||
|
|||||||
@ -226,7 +226,7 @@ else if ($id)
|
|||||||
// Ref
|
// Ref
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||||
print $object->ref;
|
print $object->rowid;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
@ -278,7 +278,7 @@ else if ($id)
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
|
||||||
print $object->ref;
|
print $object->rowid;
|
||||||
print '</td><td width="25%">';
|
print '</td><td width="25%">';
|
||||||
print $linkback;
|
print $linkback;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -66,8 +66,8 @@ class AccountancySystem
|
|||||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_system");
|
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_system");
|
||||||
|
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$this->id = $id;
|
$this->rowid = $id;
|
||||||
$result = $this->id;
|
$result = $this->rowid;
|
||||||
} else {
|
} else {
|
||||||
$result = - 2;
|
$result = - 2;
|
||||||
$this->error = "AccountancySystem::Create Erreur $result";
|
$this->error = "AccountancySystem::Create Erreur $result";
|
||||||
|
|||||||
@ -123,7 +123,7 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
@ -190,7 +190,7 @@ class AccountingAccount
|
|||||||
if (! $error) {
|
if (! $error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount");
|
||||||
|
|
||||||
if (! $notrigger) {
|
// if (! $notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ class AccountingAccount
|
|||||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -225,8 +225,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function update($user)
|
function update($user)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||||
@ -294,7 +292,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
@ -303,8 +300,8 @@ class AccountingAccount
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error) {
|
// if (! $error) {
|
||||||
if (! $notrigger) {
|
// if (! $notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -314,8 +311,8 @@ class AccountingAccount
|
|||||||
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
|
||||||
@ -392,8 +389,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function account_desactivate($id)
|
function account_desactivate($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@ -427,8 +422,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function account_activate($id)
|
function account_activate($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||||
|
|||||||
@ -225,8 +225,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function create($user='')
|
function create($user='')
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
|
||||||
|
|
||||||
$this->piece_num = 0;
|
$this->piece_num = 0;
|
||||||
|
|
||||||
// first check if line not yet in bookkeeping
|
// first check if line not yet in bookkeeping
|
||||||
@ -355,7 +353,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function create_std($user, $notrigger = 0)
|
function create_std($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -445,7 +442,7 @@ class BookKeeping
|
|||||||
if (! $error) {
|
if (! $error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping");
|
||||||
|
|
||||||
if (! $notrigger) {
|
// if (! $notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -455,7 +452,7 @@ class BookKeeping
|
|||||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -481,7 +478,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0)
|
function update($user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -550,8 +546,8 @@ class BookKeeping
|
|||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
// if (! $error) {
|
||||||
if (! $notrigger) {
|
// if (! $notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -561,8 +557,8 @@ class BookKeeping
|
|||||||
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -587,7 +583,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -642,10 +637,10 @@ class BookKeeping
|
|||||||
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::export_bookkeping sql=" . $sql, LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$this->linesexport = array ();
|
$this->linesexport = array ();
|
||||||
|
|
||||||
|
|||||||
@ -50,10 +50,6 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
|
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$date_array = array ();
|
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
||||||
$sql .= ' ORDER BY import_key DESC';
|
$sql .= ' ORDER BY import_key DESC';
|
||||||
|
|
||||||
@ -100,7 +96,7 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array())
|
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array())
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
@ -161,7 +157,7 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array())
|
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array())
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
@ -217,7 +213,7 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
|
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
|
|||||||
@ -103,9 +103,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
|
|||||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
|
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
|
||||||
// To isolate the cash of the other accounts
|
$sql .= " WHERE ba.rowid=".$id_accountancy_journal;
|
||||||
$sql .= " WHERE ba.courant <> 2";
|
|
||||||
$sql .= " AND ba.rowid=".$id_accountancy_journal;
|
|
||||||
if (! empty($conf->multicompany->enabled)) {
|
if (! empty($conf->multicompany->enabled)) {
|
||||||
$sql .= " AND ba.entity = " . $conf->entity;
|
$sql .= " AND ba.entity = " . $conf->entity;
|
||||||
}
|
}
|
||||||
@ -218,6 +216,7 @@ if ($result) {
|
|||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
||||||
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
||||||
|
|
||||||
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||||
$resultmid = $db->query($sqlmid);
|
$resultmid = $db->query($sqlmid);
|
||||||
if ($resultmid)
|
if ($resultmid)
|
||||||
@ -237,6 +236,7 @@ if ($result) {
|
|||||||
{
|
{
|
||||||
$paymentsalstatic->id = $links[$key]['url_id'];
|
$paymentsalstatic->id = $links[$key]['url_id'];
|
||||||
$paymentsalstatic->ref = $links[$key]['url_id'];
|
$paymentsalstatic->ref = $links[$key]['url_id'];
|
||||||
|
$paymentsalstatic->label = $links[$key]['label'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
||||||
$tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount;
|
$tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount;
|
||||||
}
|
}
|
||||||
@ -421,6 +421,7 @@ if ($action == 'export_csv')
|
|||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||||
|
|
||||||
|
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
|
|
||||||
@ -438,8 +439,12 @@ if ($action == 'export_csv')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
if (is_array ( $tabtp[$key]))
|
||||||
if ($mt) {
|
{
|
||||||
|
foreach ( $tabtp[$key] as $k => $mt )
|
||||||
|
{
|
||||||
|
if ($mt)
|
||||||
|
{
|
||||||
print $date . $sep;
|
print $date . $sep;
|
||||||
print $bank_journal . $sep;
|
print $bank_journal . $sep;
|
||||||
if ($val["lib"] == '(SupplierInvoicePayment)') {
|
if ($val["lib"] == '(SupplierInvoicePayment)') {
|
||||||
@ -456,6 +461,25 @@ if ($action == 'export_csv')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach ( $tabbq[$key] as $k => $mt )
|
||||||
|
{
|
||||||
|
if (1)
|
||||||
|
{
|
||||||
|
print $date . $sep;
|
||||||
|
print $bank_journal . $sep;
|
||||||
|
print $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . $sep;
|
||||||
|
print $sep;
|
||||||
|
print ($mt < 0 ? 'D' : 'C') . $sep;
|
||||||
|
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||||
|
print $val["type_payment"] . $sep;
|
||||||
|
print $val["ref"] . $sep;
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else // Model Classic Export
|
} else // Model Classic Export
|
||||||
{
|
{
|
||||||
foreach ( $tabpay as $key => $val ) {
|
foreach ( $tabpay as $key => $val ) {
|
||||||
@ -476,7 +500,10 @@ if ($action == 'export_csv')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
if (is_array ( $tabtp[$key]))
|
||||||
|
{
|
||||||
|
foreach ( $tabtp[$key] as $k => $mt )
|
||||||
|
{
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
print '"' . $date . '"' . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
print '"' . $val["type_payment"] . '"' . $sep;
|
print '"' . $val["type_payment"] . '"' . $sep;
|
||||||
@ -488,6 +515,23 @@ if ($action == 'export_csv')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach ( $tabbq[$key] as $k => $mt )
|
||||||
|
{
|
||||||
|
if (1)
|
||||||
|
{
|
||||||
|
print '"' . $date . '"' . $sep;
|
||||||
|
print '"' . $val["ref"] . '"' . $sep;
|
||||||
|
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("Bank") . '"' . $sep;
|
||||||
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||||
|
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -498,13 +542,53 @@ else
|
|||||||
llxHeader('', $langs->trans("BankJournal"));
|
llxHeader('', $langs->trans("BankJournal"));
|
||||||
|
|
||||||
$namereport = $langs->trans("BankJournal");
|
$namereport = $langs->trans("BankJournal");
|
||||||
$namelink = '';
|
$description = $langs->trans("DescBankJournal");
|
||||||
$periodlink = '';
|
|
||||||
$exportlink = '';
|
|
||||||
$builddate = time();
|
|
||||||
$description = $langs->trans("DescBankJournal") . '<br>';
|
|
||||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||||
report_header($namereport, $namelink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
|
|
||||||
|
// Report
|
||||||
|
$h=0;
|
||||||
|
$head[$h][0] = $_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal;
|
||||||
|
$head[$h][1] = $langs->trans("Report");
|
||||||
|
$head[$h][2] = 'report';
|
||||||
|
|
||||||
|
dol_fiche_head($head, $hselected);
|
||||||
|
|
||||||
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal.'">';
|
||||||
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
|
// Title
|
||||||
|
print '<tr>';
|
||||||
|
print '<td valign="top" width="110">'.$langs->trans("ReportName").'</td>';
|
||||||
|
print '<td colspan="3">'.$namereport.'</td>';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Period report
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("ReportPeriod").'</td>';
|
||||||
|
if (! $periodlink) print '<td colspan="3">';
|
||||||
|
else print '<td>';
|
||||||
|
if ($period) print $period;
|
||||||
|
if ($periodlink) print '</td><td colspan="2">'.$periodlink;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Description
|
||||||
|
print '<tr>';
|
||||||
|
print '<td valign="top">'.$langs->trans("ReportDescription").'</td>';
|
||||||
|
print '<td colspan="3">'.$description.'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr>';
|
||||||
|
print '<td colspan="4" align="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
// End report
|
||||||
|
|
||||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
|
|
||||||
@ -553,7 +637,6 @@ else
|
|||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
if (1) {
|
|
||||||
print "<tr " . $bc[$var] . ">";
|
print "<tr " . $bc[$var] . ">";
|
||||||
print "<td>" . $date . "</td>";
|
print "<td>" . $date . "</td>";
|
||||||
print "<td>" . $reflabel . "</td>";
|
print "<td>" . $reflabel . "</td>";
|
||||||
@ -564,9 +647,10 @@ else
|
|||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
|
if (is_array ( $tabtp[$key]))
|
||||||
|
{
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
if ($k != 'type') {
|
if ($k != 'type') {
|
||||||
print "<tr " . $bc[$var] . ">";
|
print "<tr " . $bc[$var] . ">";
|
||||||
@ -580,7 +664,21 @@ else
|
|||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach ( $tabbq[$key] as $k => $mt )
|
||||||
|
{
|
||||||
|
print "<tr " . $bc[$var] . ">";
|
||||||
|
print "<td>" . $date . "</td>";
|
||||||
|
print "<td>" . $reflabel . "</td>";
|
||||||
|
print "<td>" . $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . "</td>";
|
||||||
|
print "<td>" . $langs->trans('ThirdParty') . "</td>";
|
||||||
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
|
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||||
|
print "</tr>";
|
||||||
|
}
|
||||||
|
}
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,533 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
|
||||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
|
||||||
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/accountancy/journal/cashjournal.php
|
|
||||||
* \ingroup Accounting Expert
|
|
||||||
* \brief Page with cash journal
|
|
||||||
*/
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
|
||||||
|
|
||||||
// Class
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
|
||||||
|
|
||||||
// Langs
|
|
||||||
$langs->load("companies");
|
|
||||||
$langs->load("other");
|
|
||||||
$langs->load("compta");
|
|
||||||
$langs->load("bank");
|
|
||||||
$langs->load("accountancy");
|
|
||||||
|
|
||||||
$date_startmonth = GETPOST('date_startmonth');
|
|
||||||
$date_startday = GETPOST('date_startday');
|
|
||||||
$date_startyear = GETPOST('date_startyear');
|
|
||||||
$date_endmonth = GETPOST('date_endmonth');
|
|
||||||
$date_endday = GETPOST('date_endday');
|
|
||||||
$date_endyear = GETPOST('date_endyear');
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->societe_id > 0)
|
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
$action = GETPOST('action');
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
$year_current = strftime("%Y", dol_now());
|
|
||||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
|
||||||
$pastmonthyear = $year_current;
|
|
||||||
if ($pastmonth == 0) {
|
|
||||||
$pastmonth = 12;
|
|
||||||
$pastmonthyear --;
|
|
||||||
}
|
|
||||||
|
|
||||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
|
||||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
|
||||||
|
|
||||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
|
||||||
{
|
|
||||||
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
|
||||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
|
||||||
$idpays = $p[0];
|
|
||||||
|
|
||||||
$sql = "SELECT b.rowid , b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, soc.code_compta, ba.courant,";
|
|
||||||
$sql .= " soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, ba.account_number, bu1.type as typeop";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
|
|
||||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
|
|
||||||
|
|
||||||
// Code opération type caisse
|
|
||||||
$sql .= " WHERE ba.courant = 2";
|
|
||||||
if (! empty($conf->multicompany->enabled)) {
|
|
||||||
$sql .= " AND ba.entity = " . $conf->entity;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($date_start && $date_end)
|
|
||||||
$sql .= " AND b.dateo >= '" . $db->idate($date_start) . "' AND b.dateo <= '" . $db->idate($date_end) . "'";
|
|
||||||
$sql .= " ORDER BY b.datev";
|
|
||||||
|
|
||||||
$object = new Account($db);
|
|
||||||
$paymentstatic = new Paiement($db);
|
|
||||||
$paymentsupplierstatic = new PaiementFourn($db);
|
|
||||||
$societestatic = new Societe($db);
|
|
||||||
$chargestatic = new ChargeSociales($db);
|
|
||||||
$paymentvatstatic = new TVA($db);
|
|
||||||
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sql=" . $sql, LOG_DEBUG);
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result) {
|
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
// les variables
|
|
||||||
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
|
|
||||||
$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
|
|
||||||
$cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
|
|
||||||
$cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
|
|
||||||
|
|
||||||
$tabpay = array ();
|
|
||||||
$tabbq = array ();
|
|
||||||
$tabtp = array ();
|
|
||||||
$tabcompany = array ();
|
|
||||||
$tabtype = array ();
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
while ( $i < $num ) {
|
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
|
|
||||||
// controls
|
|
||||||
$compta_bank = $obj->account_number;
|
|
||||||
if ($obj->label == '(SupplierInvoicePayment)')
|
|
||||||
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $cptfour);
|
|
||||||
if ($obj->label == '(CustomerInvoicePayment)')
|
|
||||||
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
|
|
||||||
if ($obj->typeop == '(BankTransfert)')
|
|
||||||
$compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
|
|
||||||
|
|
||||||
// variable bookkeeping
|
|
||||||
|
|
||||||
$tabpay[$obj->rowid]["date"] = $obj->do;
|
|
||||||
$tabpay[$obj->rowid]["ref"] = $obj->label;
|
|
||||||
$tabpay[$obj->rowid]["fk_bank"] = $obj->rowid;
|
|
||||||
if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) {
|
|
||||||
$tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]);
|
|
||||||
} else {
|
|
||||||
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
|
|
||||||
}
|
|
||||||
$links = $object->get_url($obj->rowid);
|
|
||||||
|
|
||||||
foreach ( $links as $key => $val ) {
|
|
||||||
|
|
||||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
|
||||||
|
|
||||||
if ($links[$key]['type'] == 'payment') {
|
|
||||||
$paymentstatic->id = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
|
||||||
} else if ($links[$key]['type'] == 'payment_supplier') {
|
|
||||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
|
||||||
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
|
||||||
} else if ($links[$key]['type'] == 'company') {
|
|
||||||
|
|
||||||
$societestatic->id = $links[$key]['url_id'];
|
|
||||||
$societestatic->name = $links[$key]['label'];
|
|
||||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
|
||||||
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
|
||||||
} else if ($links[$key]['type'] == 'sc') {
|
|
||||||
|
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
|
||||||
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
|
||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
|
||||||
if ($reg[1] == 'socialcontribution')
|
|
||||||
$reg[1] = 'SocialContribution';
|
|
||||||
$chargestatic->lib = $langs->trans($reg[1]);
|
|
||||||
} else {
|
|
||||||
$chargestatic->lib = $links[$key]['label'];
|
|
||||||
}
|
|
||||||
$chargestatic->ref = $chargestatic->lib;
|
|
||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
|
||||||
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
|
||||||
}
|
|
||||||
} else if ($links[$key]['type'] == 'payment_vat') {
|
|
||||||
|
|
||||||
$paymentvatstatic->id = $links[$key]['url_id'];
|
|
||||||
$paymentvatstatic->ref = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
|
||||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
|
||||||
}
|
|
||||||
/*else {
|
|
||||||
$tabtp [$obj->rowid] [$cptsociale] += $obj->amount;
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
|
||||||
|
|
||||||
// if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
|
||||||
|
|
||||||
$i ++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Actions
|
|
||||||
*/
|
|
||||||
|
|
||||||
// write bookkeeping
|
|
||||||
if ($action == 'writeBookKeeping') {
|
|
||||||
$error = 0;
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
|
||||||
// cash
|
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
|
||||||
$bookkeeping->doc_date = $val["date"];
|
|
||||||
$bookkeeping->doc_ref = $val["ref"];
|
|
||||||
$bookkeeping->doc_type = 'cash';
|
|
||||||
$bookkeeping->fk_doc = $key;
|
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
|
||||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
|
||||||
$bookkeeping->numero_compte = $k;
|
|
||||||
$bookkeeping->label_compte = $compte->label;
|
|
||||||
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
|
||||||
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
|
||||||
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
|
|
||||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
|
||||||
|
|
||||||
if ($tabtype[$key] == 'payment') {
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT fac.facnumber';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
|
||||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
|
||||||
}
|
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT facf.facnumber';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
|
||||||
$sqlmid .= " WHERE payf.fk_bank=" . $key;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $bookkeeping->create();
|
|
||||||
if ($result < 0) {
|
|
||||||
$error ++;
|
|
||||||
setEventMessage($object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// third party
|
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
|
||||||
$bookkeeping->doc_date = $val["date"];
|
|
||||||
$bookkeeping->doc_ref = $val["ref"];
|
|
||||||
$bookkeeping->doc_type = 'cash';
|
|
||||||
$bookkeeping->fk_doc = $key;
|
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
|
||||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
|
||||||
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
|
||||||
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
|
||||||
$bookkeeping->credit = ($mt >= 0 ? $mt : 0);
|
|
||||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
|
||||||
|
|
||||||
if ($tabtype[$key] == 'sc') {
|
|
||||||
$bookkeeping->code_tiers = '';
|
|
||||||
$bookkeeping->numero_compte = $k;
|
|
||||||
} else if ($tabtype[$key] == 'payment') {
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT fac.facnumber';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
|
||||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
|
||||||
}
|
|
||||||
$bookkeeping->code_tiers = $k;
|
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT facf.facnumber';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
|
||||||
$sqlmid .= " WHERE payf.fk_bank=" . $key;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
|
||||||
}
|
|
||||||
$bookkeeping->code_tiers = $k;
|
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
|
||||||
} else if ($tabtype[$key] == 'company') {
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT fac.facnumber';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
|
||||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
|
||||||
}
|
|
||||||
$bookkeeping->code_tiers = $k;
|
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$bookkeeping->doc_ref = $k;
|
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $bookkeeping->create();
|
|
||||||
if ($result < 0) {
|
|
||||||
$error ++;
|
|
||||||
setEventMessage($object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($error)) {
|
|
||||||
setEventMessage($langs->trans('Success'), 'mesgs');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Export
|
|
||||||
if ($action == 'export_csv') {
|
|
||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
|
||||||
$cash_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
|
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
|
||||||
header('Content-Disposition:attachment;filename=journal_caisse.csv');
|
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
|
|
||||||
{
|
|
||||||
$sep = ";";
|
|
||||||
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
|
||||||
|
|
||||||
// Cash
|
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
|
||||||
print $date . $sep;
|
|
||||||
print $cash_journal . $sep;
|
|
||||||
print length_accountg(html_entity_decode($k)) . $sep;
|
|
||||||
print $sep;
|
|
||||||
print ($mt < 0 ? 'C' : 'D') . $sep;
|
|
||||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
|
||||||
print $val["type_payment"] . $sep;
|
|
||||||
print $val["ref"] . $sep;
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Third party
|
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
|
||||||
if ($mt) {
|
|
||||||
print $date . $sep;
|
|
||||||
print $cash_journal . $sep;
|
|
||||||
if ($val["lib"] == '(SupplierInvoicePayment)') {
|
|
||||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
|
|
||||||
} else {
|
|
||||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
|
|
||||||
}
|
|
||||||
print length_accounta(html_entity_decode($k)) . $sep;
|
|
||||||
print ($mt < 0 ? 'D' : 'C') . $sep;
|
|
||||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
|
||||||
print $val["type_payment"] . $sep;
|
|
||||||
print $val["ref"] . $sep;
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else // Model Classic Export
|
|
||||||
{
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
|
||||||
|
|
||||||
// Cash
|
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
|
||||||
print '"' . $date . '"' . $sep;
|
|
||||||
print '"' . $val["ref"] . '"' . $sep;
|
|
||||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
|
||||||
print '"' . $langs->trans("Cash") . '"' . $sep;
|
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Third party
|
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
|
||||||
if ($mt) {
|
|
||||||
print '"' . $date . '"' . $sep;
|
|
||||||
print '"' . $val["ref"] . '"' . $sep;
|
|
||||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
|
||||||
print '"' . $langs->trans("ThirdParty") . '"' . $sep;
|
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
llxHeader('', $langs->trans("CashJournal"), '');
|
|
||||||
|
|
||||||
$name = $langs->trans("CashJournal");
|
|
||||||
$nomlink = '';
|
|
||||||
$periodlink = '';
|
|
||||||
$exportlink = '';
|
|
||||||
$builddate = time();
|
|
||||||
$description = $langs->trans("DescCashJournal") . '<br>';
|
|
||||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
|
||||||
report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
|
|
||||||
|
|
||||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
|
||||||
|
|
||||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';
|
|
||||||
|
|
||||||
print '
|
|
||||||
<script type="text/javascript">
|
|
||||||
function launch_export() {
|
|
||||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
|
||||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
|
||||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
|
||||||
}
|
|
||||||
function writeBookKeeping() {
|
|
||||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writeBookKeeping");
|
|
||||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
|
||||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
|
||||||
}
|
|
||||||
</script>';
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Show result array
|
|
||||||
*/
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
|
||||||
print "<tr class=\"liste_titre\">";
|
|
||||||
print "<td>" . $langs->trans("Date") . "</td>";
|
|
||||||
print "<td>" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")</td>";
|
|
||||||
print "<td>" . $langs->trans("Account") . "</td>";
|
|
||||||
print "<td align='right'>" . $langs->trans("Debit") . "</td><td align='right'>" . $langs->trans("Credit") . "</td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$var = true;
|
|
||||||
$r = '';
|
|
||||||
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
|
||||||
|
|
||||||
// Cash
|
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
|
||||||
if (1) {
|
|
||||||
print "<tr " . $bc[$var] . " >";
|
|
||||||
print "<td>" . $date . "</td>";
|
|
||||||
print "<td>" . $val["lib"] . "</td>";
|
|
||||||
print "<td>" . length_accountg($k) . "</td>";
|
|
||||||
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
|
||||||
print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// third party
|
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
|
||||||
if ($k != 'type') {
|
|
||||||
print "<tr " . $bc[$var] . ">";
|
|
||||||
|
|
||||||
print "<td>" . $date . "</td>";
|
|
||||||
print "<td>" . $val["soclib"] . "</td>";
|
|
||||||
|
|
||||||
print "<td>" . length_accounta($k) . "</td>";
|
|
||||||
print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
|
||||||
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$var = ! $var;
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
// End of page
|
|
||||||
llxFooter();
|
|
||||||
}
|
|
||||||
$db->close();
|
|
||||||
@ -230,7 +230,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->doc_type = 'customer_invoice';
|
$bookkeeping->doc_type = 'customer_invoice';
|
||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
||||||
$bookkeeping->fk_compte = $compte->id;
|
|
||||||
$bookkeeping->code_tiers = '';
|
$bookkeeping->code_tiers = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = $langs->trans("VAT");
|
$bookkeeping->label_compte = $langs->trans("VAT");
|
||||||
@ -420,7 +419,6 @@ if ($action == 'export_csv') {
|
|||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
$invoicestatic->ref = $val["ref"];
|
$invoicestatic->ref = $val["ref"];
|
||||||
$invoicestatic->type = $val["type"];
|
$invoicestatic->type = $val["type"];
|
||||||
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
|
|
||||||
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
|
|||||||
@ -186,9 +186,9 @@ if ($result) {
|
|||||||
if (empty($objp->code_buy)) {
|
if (empty($objp->code_buy)) {
|
||||||
$code_buy_notset = 'color:red';
|
$code_buy_notset = 'color:red';
|
||||||
if ($objp->type == 1) {
|
if ($objp->type == 1) {
|
||||||
$objp->code_buy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$objp->code_buy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
} else {
|
} else {
|
||||||
$objp->code_buy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
$objp->code_buy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
$code_buy_notset = 'color:blue';
|
$code_buy_notset = 'color:blue';
|
||||||
|
|||||||
@ -219,7 +219,7 @@ if ($conf->facture->enabled)
|
|||||||
print '<input type="hidden" name="constname" value="ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS">';
|
print '<input type="hidden" name="constname" value="ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS">';
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
||||||
print '</td><td align="center" width="80">';
|
print '</td><td align="center" width="80">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -27,6 +27,10 @@
|
|||||||
*/
|
*/
|
||||||
abstract class ActionsAdherentCardCommon
|
abstract class ActionsAdherentCardCommon
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Database handler
|
||||||
|
* @var DoliDB
|
||||||
|
*/
|
||||||
var $db;
|
var $db;
|
||||||
var $dirmodule;
|
var $dirmodule;
|
||||||
var $targetmodule;
|
var $targetmodule;
|
||||||
|
|||||||
@ -302,6 +302,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
// Check if we need to also synchronize user information
|
// Check if we need to also synchronize user information
|
||||||
$nosyncuser=0;
|
$nosyncuser=0;
|
||||||
@ -471,6 +472,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($morphy) || $morphy == "-1") {
|
if (empty($morphy) || $morphy == "-1") {
|
||||||
@ -1159,7 +1161,7 @@ else
|
|||||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">';
|
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">';
|
||||||
if ($object->user_id)
|
if ($object->user_id)
|
||||||
{
|
{
|
||||||
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
|
||||||
}
|
}
|
||||||
else print $langs->trans("NoDolibarrAccess");
|
else print $langs->trans("NoDolibarrAccess");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1516,13 +1518,13 @@ else
|
|||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
if ($action == 'editlogin')
|
if ($action == 'editlogin')
|
||||||
{
|
{
|
||||||
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($object->user_id)
|
if ($object->user_id)
|
||||||
{
|
{
|
||||||
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
|
||||||
}
|
}
|
||||||
else print $langs->trans("NoDolibarrAccess");
|
else print $langs->trans("NoDolibarrAccess");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -674,13 +674,13 @@ if ($rowid)
|
|||||||
{
|
{
|
||||||
$include=array($object->user_id,$user->id);
|
$include=array($object->user_id,$user->id);
|
||||||
}*/
|
}*/
|
||||||
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($object->user_id)
|
if ($object->user_id)
|
||||||
{
|
{
|
||||||
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
|
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
|
||||||
}
|
}
|
||||||
else print $langs->trans("NoDolibarrAccess");
|
else print $langs->trans("NoDolibarrAccess");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -641,10 +641,6 @@ class Adherent extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function update_end_date($user)
|
function update_end_date($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
|
|
||||||
$error=0;
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Search for last subscription id and end date
|
// Search for last subscription id and end date
|
||||||
|
|||||||
@ -36,6 +36,13 @@ class AdherentType extends CommonObject
|
|||||||
public $element = 'adherent_type';
|
public $element = 'adherent_type';
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
* @deprecated Use rowid
|
||||||
|
*/
|
||||||
|
public $ref;
|
||||||
|
|
||||||
var $libelle;
|
var $libelle;
|
||||||
var $statut;
|
var $statut;
|
||||||
var $cotisation; // Soumis a la cotisation
|
var $cotisation; // Soumis a la cotisation
|
||||||
|
|||||||
@ -152,7 +152,7 @@ $nbtotalofrecords = 0;
|
|||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) $nbtotalofrecords = $db->num_rows($result);
|
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
// Add order and limit
|
// Add order and limit
|
||||||
|
|||||||
@ -89,10 +89,11 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if ($adht->libelle)
|
if ($adht->libelle)
|
||||||
{
|
{
|
||||||
$id=$adht->create($user->id);
|
$id=$adht->create($user);
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
@ -126,8 +127,9 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
$adht->update($user->id);
|
$adht->update($user);
|
||||||
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]);
|
header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $actiontest=GETPOST('test','alpha');
|
|||||||
$actionsave=GETPOST('save','alpha');
|
$actionsave=GETPOST('save','alpha');
|
||||||
|
|
||||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
||||||
|
|
||||||
// List of aviable colors
|
// List of aviable colors
|
||||||
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
|
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
|
||||||
|
|||||||
@ -133,7 +133,7 @@ print '<tr '.$bc[$var].'>'."\n";
|
|||||||
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
|
||||||
print '<td align="center"> </td>'."\n";
|
print '<td align="center"> </td>'."\n";
|
||||||
print '<td align="right" class="nowrap">'."\n";
|
print '<td align="right" class="nowrap">'."\n";
|
||||||
print $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 1);
|
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 1);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// AGENDA_DEFAULT_FILTER_STATUS
|
// AGENDA_DEFAULT_FILTER_STATUS
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -328,7 +328,7 @@ if (! empty($conf->product->enabled))
|
|||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||||
print '<td width="60" align="right">';
|
print '<td width="60" align="right">';
|
||||||
print $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
|
$formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" name="submit_PRODUIT_DEFAULT_BARCODE_TYPE" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="submit_PRODUIT_DEFAULT_BARCODE_TYPE" value="'.$langs->trans("Modify").'">';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -430,6 +430,5 @@ print '</form>';
|
|||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
|
|||||||
@ -605,8 +605,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
$opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
|
||||||
|
|
||||||
print '<tr><td align="left"></label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
print '<tr><td align="left"></label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||||
$opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code));
|
|
||||||
print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
|
print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -649,7 +650,6 @@ if ($action == 'edit' || $action == 'updateedit')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '<tr><td align="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
print '<tr><td align="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||||
$opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code));
|
|
||||||
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
|
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -1061,15 +1061,15 @@ else
|
|||||||
print '<tr><td align="left">'.$langs->trans("CalcLocaltax").': ';
|
print '<tr><td align="left">'.$langs->trans("CalcLocaltax").': ';
|
||||||
if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0)
|
if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0)
|
||||||
{
|
{
|
||||||
print $langs->transcountry("CalcLocaltax1",$mysoc->country_code);
|
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
||||||
}
|
}
|
||||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
|
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
|
||||||
{
|
{
|
||||||
print $langs->transcountry("CalcLocaltax2",$mysoc->country_code);
|
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
||||||
}
|
}
|
||||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
|
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
|
||||||
{
|
{
|
||||||
print $langs->transcountry("CalcLocaltax3",$mysoc->country_code);
|
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -229,8 +229,8 @@ $sql.= ", note";
|
|||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||||
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
|
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
|
||||||
if (empty($user->entity) && $debug) {} // to force for superadmin
|
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin
|
||||||
elseif ($user->entity || empty($conf->multicompany->enabled)) $sql.= " AND visible = 1";
|
else $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||||
$sql.= " ORDER BY entity, name ASC";
|
$sql.= " ORDER BY entity, name ASC";
|
||||||
|
|
||||||
dol_syslog("Const::listConstant", LOG_DEBUG);
|
dol_syslog("Const::listConstant", LOG_DEBUG);
|
||||||
@ -280,7 +280,6 @@ if ($result)
|
|||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">';
|
print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">';
|
||||||
print ' ';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||||
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
||||||
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
*
|
*
|
||||||
@ -1217,7 +1217,7 @@ if ($id)
|
|||||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
||||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; }
|
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; }
|
||||||
|
|
||||||
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&';
|
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&';
|
||||||
|
|
||||||
// Favorite
|
// Favorite
|
||||||
// Only activated on country dictionary
|
// Only activated on country dictionary
|
||||||
|
|||||||
@ -117,7 +117,8 @@ if ($action == 'edit') // Edit
|
|||||||
clearstatcache();
|
clearstatcache();
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("Language"),'','').'<br>';
|
print_fiche_titre($langs->trans("Language"),'','');
|
||||||
|
print '<br>';
|
||||||
print '<table summary="edit" class="noborder" width="100%">';
|
print '<table summary="edit" class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
@ -299,7 +300,8 @@ else // Show
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
print_fiche_titre($langs->trans("Language"),'','').'<br>';
|
print_fiche_titre($langs->trans("Language"),'','');
|
||||||
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td><td> </td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td><td> </td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -100,6 +100,7 @@ print '<br>';
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Add hook to add information
|
// Add hook to add information
|
||||||
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
|
|||||||
@ -183,10 +183,10 @@ if ($action == 'edit')
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled="disabled"');
|
$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled="disabled"');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled="disabled"');
|
$formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled="disabled"');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -194,10 +194,10 @@ if ($action == 'edit')
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled="disabled"');
|
$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled="disabled"');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled="disabled"');
|
$formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled="disabled"');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -299,7 +299,7 @@ if ($action == 'create')
|
|||||||
// Handler
|
// Handler
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu);
|
$formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
|
print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,7 @@ print "</td>";
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Use a flip-hide menu
|
// Use a flip-hide menu
|
||||||
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0)
|
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|||||||
@ -33,6 +33,7 @@ $langs->load("orders");
|
|||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
$langs->load("mails");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
@ -76,7 +77,9 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
$form=new Form($db);
|
||||||
|
|
||||||
|
llxHeader('',$langs->trans("NotificationSetup"));
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup');
|
print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup');
|
||||||
@ -132,9 +135,19 @@ foreach($listofnotifiedevents as $notifiedevent)
|
|||||||
print '<td>'.$elementLabel.'</td>';
|
print '<td>'.$elementLabel.'</td>';
|
||||||
print '<td>'.$notifiedevent['code'].'</td>';
|
print '<td>'.$notifiedevent['code'].'</td>';
|
||||||
print '<td>'.$label.'</td>';
|
print '<td>'.$label.'</td>';
|
||||||
|
print '<td>';
|
||||||
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'];
|
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'];
|
||||||
print '<td><input type="email" size="32" name="'.$param.'" value="'.dol_escape_htmltag(GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param).'">';
|
$value=GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param;
|
||||||
if (! empty($conf->global->$param) && ! isValidEmail($conf->global->$param)) print ' '.img_warning($langs->trans("ErrorBadEMail"));
|
$s='<input type="text" size="32" name="'.$param.'" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||||
|
$arrayemail=explode(',',$value);
|
||||||
|
$showwarning=0;
|
||||||
|
foreach($arrayemail as $key=>$valuedet)
|
||||||
|
{
|
||||||
|
$valuedet=trim($valuedet);
|
||||||
|
if (! empty($valuedet) && ! isValidEmail($valuedet)) $showwarning++;
|
||||||
|
}
|
||||||
|
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||||
|
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,7 +149,7 @@ print '</tr>';
|
|||||||
// Bank account (from Banks module)
|
// Bank account (from Banks module)
|
||||||
print '<tr class="impair"><td>'.$langs->trans("BankToReceiveWithdraw").'</td>';
|
print '<tr class="impair"><td>'.$langs->trans("BankToReceiveWithdraw").'</td>';
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1);
|
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// ICS
|
// ICS
|
||||||
|
|||||||
@ -136,6 +136,8 @@ print " <td align=\"right\" width=\"160\"> </td>\n";
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
$found=0;
|
||||||
|
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -148,6 +150,7 @@ if (! empty($conf->facture->enabled))
|
|||||||
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->commande->enabled))
|
if (! empty($conf->commande->enabled))
|
||||||
@ -162,6 +165,7 @@ if (! empty($conf->commande->enabled))
|
|||||||
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->expedition->enabled))
|
if (! empty($conf->expedition->enabled))
|
||||||
@ -176,7 +180,17 @@ if (! empty($conf->expedition->enabled))
|
|||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $found)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td colspan="2">'.$langs->trans("NoModueToManageStockDecrease").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -189,6 +203,8 @@ print " <td align=\"right\" width=\"160\"> </td>\n";
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
$found=0;
|
||||||
|
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -201,6 +217,7 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
@ -215,6 +232,7 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
}
|
}
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
{
|
{
|
||||||
@ -228,19 +246,30 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $found)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td colspan="2">'.$langs->trans("NoModueToManageStockIncrease").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
// Optio to force stock to be enough before adding a line into document
|
// Optio to force stock to be enough before adding a line into document
|
||||||
print '<br>';
|
if ($conf->invoice->enabled || $conf->order->enabled || $conf->expedition->enabled)
|
||||||
print '<table class="noborder" width="100%">';
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<br>';
|
||||||
print " <td>".$langs->trans("RuleForStockAvailability")."</td>\n";
|
print '<table class="noborder" width="100%">';
|
||||||
print " <td align=\"right\" width=\"160\"> </td>\n";
|
print '<tr class="liste_titre">';
|
||||||
print '</tr>'."\n";
|
print " <td>".$langs->trans("RuleForStockAvailability")."</td>\n";
|
||||||
|
print " <td align=\"right\" width=\"160\"> </td>\n";
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
if($conf->invoice->enabled) {
|
if($conf->invoice->enabled) {
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
|
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
|
||||||
@ -253,9 +282,9 @@ if($conf->invoice->enabled) {
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($conf->order->enabled) {
|
if($conf->order->enabled) {
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
|
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
|
||||||
@ -268,9 +297,9 @@ if($conf->order->enabled) {
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($conf->expedition->enabled) {
|
if($conf->expedition->enabled) {
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
|
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
|
||||||
@ -283,9 +312,9 @@ if($conf->expedition->enabled) {
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
|
|
||||||
$virtualdiffersfromphysical=0;
|
$virtualdiffersfromphysical=0;
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
||||||
|
|||||||
@ -31,6 +31,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
|
$langs->load("orders");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -81,33 +81,32 @@ if ($action == 'set')
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$activeModules = array();
|
$newActiveModules = array();
|
||||||
$selectedModules = (isset($_POST['SYSLOG_HANDLERS']) ? $_POST['SYSLOG_HANDLERS'] : array());
|
$selectedModules = (isset($_POST['SYSLOG_HANDLERS']) ? $_POST['SYSLOG_HANDLERS'] : array());
|
||||||
|
//var_dump($selectedModules);
|
||||||
foreach ($selectedModules as $syslogHandler)
|
foreach ($syslogModules as $syslogHandler)
|
||||||
{
|
{
|
||||||
if (in_array($syslogHandler, $syslogModules))
|
if (in_array($syslogHandler, $syslogModules))
|
||||||
{
|
{
|
||||||
$module = new $syslogHandler;
|
$module = new $syslogHandler;
|
||||||
|
|
||||||
if ($module->isActive())
|
if (in_array($syslogHandler, $selectedModules)) $newActiveModules[] = $syslogHandler;
|
||||||
{
|
|
||||||
$activeModules[] = $syslogHandler;
|
|
||||||
|
|
||||||
foreach ($module->configure() as $option)
|
foreach ($module->configure() as $option)
|
||||||
{
|
{
|
||||||
if ($_POST[$option['constant']])
|
if (isset($_POST[$option['constant']]))
|
||||||
{
|
{
|
||||||
|
$_POST[$option['constant']] = trim($_POST[$option['constant']]);
|
||||||
dolibarr_del_const($db, $option['constant'], 0);
|
dolibarr_del_const($db, $option['constant'], 0);
|
||||||
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0);
|
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
$activeModules = $newActiveModules;
|
||||||
dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0);
|
dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0);
|
||||||
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -165,6 +164,9 @@ if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity)
|
|||||||
$option = 'disabled="disabled"';
|
$option = 'disabled="disabled"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//print "conf->global->MAIN_FEATURES_LEVEL = ".$conf->global->MAIN_FEATURES_LEVEL."<br><br>\n";
|
||||||
|
|
||||||
// Output mode
|
// Output mode
|
||||||
print_titre($langs->trans("SyslogOutput"));
|
print_titre($langs->trans("SyslogOutput"));
|
||||||
|
|
||||||
@ -190,7 +192,7 @@ foreach ($syslogModules as $moduleName)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td width="140">';
|
print '<td width="140">';
|
||||||
print '<input '.$bc[$var].' type="checkbox" name="SYSLOG_HANDLERS[]" value="'.$moduleName.'" '.(in_array($moduleName, $activeModules) ? 'checked="checked"' : '').(!$moduleactive ? 'disabled="disabled"' : '').'> ';
|
print '<input '.$bc[$var].' type="checkbox" name="SYSLOG_HANDLERS[]" value="'.$moduleName.'" '.(in_array($moduleName, $activeModules) ? 'checked="checked"' : '').($moduleactive <= 0 ? 'disabled="disabled"' : '').'> ';
|
||||||
print $module->getName();
|
print $module->getName();
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -205,6 +207,7 @@ foreach ($syslogModules as $moduleName)
|
|||||||
else $value = (isset($option['default']) ? $option['default'] : '');
|
else $value = (isset($option['default']) ? $option['default'] : '');
|
||||||
|
|
||||||
print $option['name'].': <input type="text" class="flat" name="'.$option['constant'].'" value="'.$value.'"'.(isset($option['attr']) ? ' '.$option['attr'] : '').'>';
|
print $option['name'].': <input type="text" class="flat" name="'.$option['constant'].'" value="'.$value.'"'.(isset($option['attr']) ? ' '.$option['attr'] : '').'>';
|
||||||
|
if (! empty($option['example'])) print '<br>'.$langs->trans("Example").': '.$option['example'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -97,7 +97,7 @@ jQuery(document).ready(function() {
|
|||||||
if (jQuery("#select_sql_compat").val() == 'POSTGRESQL')
|
if (jQuery("#select_sql_compat").val() == 'POSTGRESQL')
|
||||||
{
|
{
|
||||||
jQuery("#checkbox_dump_disable-add-locks").attr('checked',true);
|
jQuery("#checkbox_dump_disable-add-locks").attr('checked',true);
|
||||||
};
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -91,7 +91,7 @@ function compare($x, $y)
|
|||||||
*/
|
*/
|
||||||
function revcompare($x, $y)
|
function revcompare($x, $y)
|
||||||
{
|
{
|
||||||
global $sortby, $langs;
|
global $sortby;
|
||||||
|
|
||||||
if ( $x[$sortby] == $y[$sortby] )
|
if ( $x[$sortby] == $y[$sortby] )
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -469,7 +469,6 @@ function backup_tables($outputfile, $tables='*')
|
|||||||
|
|
||||||
$sql='SELECT * FROM '.$table;
|
$sql='SELECT * FROM '.$table;
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$num_fields = $db->num_rows($result);
|
|
||||||
while($row = $db->fetch_row($result))
|
while($row = $db->fetch_row($result))
|
||||||
{
|
{
|
||||||
// For each row of data we print a line of INSERT
|
// For each row of data we print a line of INSERT
|
||||||
|
|||||||
@ -102,7 +102,7 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin)
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog($securityevent->error, LOG_ERR);
|
dol_syslog($securityevent->error, LOG_ERR);
|
||||||
$db->rolback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
|||||||
/**
|
/**
|
||||||
* Empty header
|
* Empty header
|
||||||
*
|
*
|
||||||
* @return none
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader()
|
function llxHeader()
|
||||||
{
|
{
|
||||||
@ -53,7 +53,7 @@ function llxHeader()
|
|||||||
/**
|
/**
|
||||||
* Empty footer
|
* Empty footer
|
||||||
*
|
*
|
||||||
* @return none
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxFooter()
|
function llxFooter()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
$langs->load("other");
|
||||||
|
|
||||||
// Choice of print year or current year.
|
// Choice of print year or current year.
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@ -210,7 +211,8 @@ if ($conf->societe->enabled)
|
|||||||
{
|
{
|
||||||
$nbno=$nbtotal=0;
|
$nbno=$nbtotal=0;
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','').'<br>'."\n";
|
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','');
|
||||||
|
print '<br>'."\n";
|
||||||
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
|
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -229,7 +231,7 @@ if ($conf->societe->enabled)
|
|||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
print $langs->trans("CurrentlyNWithoutBarCode", $nbno, $nbtotal, $langs->transnoentitiesnoconv("Thirdparties")).'<br>'."\n";
|
print $langs->trans("CurrentlyNWithoutBarCode", $nbno, $nbtotal, $langs->transnoentitiesnoconv("ThirdParties")).'<br>'."\n";
|
||||||
|
|
||||||
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled="checked" ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
|
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled="checked" ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
|
||||||
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled="disabled"';
|
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled="disabled"';
|
||||||
@ -250,11 +252,13 @@ if ($conf->product->enabled || $conf->product->service)
|
|||||||
|
|
||||||
$nbno=$nbtotal=0;
|
$nbno=$nbtotal=0;
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','').'<br>'."\n";
|
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','');
|
||||||
$sql ="SELECT count(rowid) as nb, fk_product_type";
|
print '<br>'."\n";
|
||||||
|
|
||||||
|
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."product";
|
$sql.=" FROM ".MAIN_DB_PREFIX."product";
|
||||||
$sql.=" WHERE barcode IS NULL OR barcode = ''";
|
$sql.=" WHERE barcode IS NULL OR barcode = ''";
|
||||||
$sql.=" GROUP BY fk_product_type";
|
$sql.=" GROUP BY fk_product_type, datec";
|
||||||
$sql.=" ORDER BY datec";
|
$sql.=" ORDER BY datec";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -360,7 +360,7 @@ print '<br>';
|
|||||||
print '<input id="fillfromproduct" type="radio" '.((GETPOST("selectorforbarcode")=='fillfromproduct')?'checked="checked" ':'').'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"> '.$langs->trans("FillBarCodeTypeAndValueFromProduct").' ';
|
print '<input id="fillfromproduct" type="radio" '.((GETPOST("selectorforbarcode")=='fillfromproduct')?'checked="checked" ':'').'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"> '.$langs->trans("FillBarCodeTypeAndValueFromProduct").' ';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="showforproductselector">';
|
print '<div class="showforproductselector">';
|
||||||
print $form->select_produits(GETPOST('productid'), 'productid', '');
|
$form->select_produits(GETPOST('productid'), 'productid', '');
|
||||||
print ' <input type="submit" id="submitproduct" name="submitproduct" class="button" value="'.(dol_escape_htmltag($langs->trans("GetBarCode"))).'">';
|
print ' <input type="submit" id="submitproduct" name="submitproduct" class="button" value="'.(dol_escape_htmltag($langs->trans("GetBarCode"))).'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -38,8 +38,6 @@ function printBookmarksList($aDb, $aLangs)
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||||
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
||||||
|
|
||||||
$bookm = new Bookmark($db);
|
|
||||||
|
|
||||||
$langs->load("bookmarks");
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
|
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
|
||||||
|
|||||||
@ -94,9 +94,12 @@ if ($resql)
|
|||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
//print "<td> </td>";
|
//print "<td> </td>";
|
||||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","","",'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","","",'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Title"),'','')."</td>";
|
print_liste_field_titre($langs->trans("Title"),'','');
|
||||||
print_liste_field_titre($langs->trans("Link"),'','')."</td>";
|
print "</td>";
|
||||||
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"')."</td>";
|
print_liste_field_titre($langs->trans("Link"),'','');
|
||||||
|
print "</td>";
|
||||||
|
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"');
|
||||||
|
print "</td>";
|
||||||
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);
|
||||||
|
|||||||
@ -130,7 +130,16 @@ if (! empty($conf->stock->enabled))
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
|
if (empty($conf->productbatch->enabled)) {
|
||||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
|
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
|
||||||
|
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
|
||||||
|
}
|
||||||
|
print $langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch');
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;
|
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;
|
||||||
|
|||||||
@ -31,7 +31,7 @@ $langs->load("bills");
|
|||||||
function popupTicket()
|
function popupTicket()
|
||||||
{
|
{
|
||||||
largeur = 600;
|
largeur = 600;
|
||||||
hauteur = 500
|
hauteur = 500;
|
||||||
opt = 'width='+largeur+', height='+hauteur+', left='+(screen.width - largeur)/2+', top='+(screen.height-hauteur)/2+'';
|
opt = 'width='+largeur+', height='+hauteur+', left='+(screen.width - largeur)/2+', top='+(screen.height-hauteur)/2+'';
|
||||||
window.open('validation_ticket.php?facid=<?php echo $_GET['facid']; ?>', '<?php echo $langs->trans('PrintTicket') ?>', opt);
|
window.open('validation_ticket.php?facid=<?php echo $_GET['facid']; ?>', '<?php echo $langs->trans('PrintTicket') ?>', opt);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,6 +127,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
|||||||
if ($parent != "-1") $object->fk_parent = $parent;
|
if ($parent != "-1") $object->fk_parent = $parent;
|
||||||
|
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $object->label)
|
if (! $object->label)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -278,7 +278,7 @@ if ($socid)
|
|||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">';
|
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">';
|
||||||
print dol_print_address($soc->address,'gmap','thirdparty',$soc->id);
|
dol_print_address($soc->address,'gmap','thirdparty',$soc->id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Zip / Town
|
// Zip / Town
|
||||||
@ -609,7 +609,7 @@ else if ($id || $ref)
|
|||||||
* @param Object $object Object we want to see categories it can be classified into
|
* @param Object $object Object we want to see categories it can be classified into
|
||||||
* @param int $typeid Type of category (0, 1, 2, 3)
|
* @param int $typeid Type of category (0, 1, 2, 3)
|
||||||
* @param int $socid Id thirdparty
|
* @param int $socid Id thirdparty
|
||||||
* @param string $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
|
* @param int $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
|
||||||
* @return int 0
|
* @return int 0
|
||||||
*/
|
*/
|
||||||
function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
||||||
|
|||||||
@ -297,7 +297,6 @@ class Categorie extends CommonObject
|
|||||||
// FIXME le hook fait double emploi avec le trigger !!
|
// FIXME le hook fait double emploi avec le trigger !!
|
||||||
$hookmanager->initHooks(array('HookCategorydao'));
|
$hookmanager->initHooks(array('HookCategorydao'));
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$action='update';
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
@ -334,7 +333,7 @@ class Categorie extends CommonObject
|
|||||||
* Delete a category from database
|
* Delete a category from database
|
||||||
*
|
*
|
||||||
* @param User $user Object user that ask to delete
|
* @param User $user Object user that ask to delete
|
||||||
* @return void
|
* @return int <0 KO >0 OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
@ -689,7 +688,9 @@ class Categorie extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function containsObject($type, $object_id)
|
function containsObject($type, $object_id)
|
||||||
{
|
{
|
||||||
$field = ''; $classname = ''; $category_table = ''; $object_table = '';
|
$field = '';
|
||||||
|
$category_table = '';
|
||||||
|
|
||||||
if ($type == 'product') {
|
if ($type == 'product') {
|
||||||
$field = 'product';
|
$field = 'product';
|
||||||
}
|
}
|
||||||
@ -726,7 +727,7 @@ class Categorie extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return childs of a category
|
* Return childs of a category
|
||||||
*
|
*
|
||||||
* @return void
|
* @return array|int <0 KO, array ok
|
||||||
*/
|
*/
|
||||||
function get_filles()
|
function get_filles()
|
||||||
{
|
{
|
||||||
@ -1045,7 +1046,7 @@ class Categorie extends CommonObject
|
|||||||
* Retourne les categories de premier niveau (qui ne sont pas filles)
|
* Retourne les categories de premier niveau (qui ne sont pas filles)
|
||||||
*
|
*
|
||||||
* @param int $type Type of category
|
* @param int $type Type of category
|
||||||
* @return void
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_main_categories($type=null)
|
function get_main_categories($type=null)
|
||||||
{
|
{
|
||||||
@ -1058,7 +1059,7 @@ class Categorie extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param string $sep Separator
|
* @param string $sep Separator
|
||||||
* @param string $url Url
|
* @param string $url Url
|
||||||
* @return void
|
* @return array
|
||||||
*/
|
*/
|
||||||
function print_all_ways($sep = " >> ", $url='')
|
function print_all_ways($sep = " >> ", $url='')
|
||||||
{
|
{
|
||||||
@ -1088,7 +1089,7 @@ class Categorie extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Retourne un tableau contenant la liste des categories meres
|
* Retourne un tableau contenant la liste des categories meres
|
||||||
*
|
*
|
||||||
* @return void
|
* @return int|array <0 KO, array OK
|
||||||
*/
|
*/
|
||||||
function get_meres()
|
function get_meres()
|
||||||
{
|
{
|
||||||
@ -1123,7 +1124,7 @@ class Categorie extends CommonObject
|
|||||||
* Retourne dans un tableau tous les chemins possibles pour arriver a la categorie
|
* Retourne dans un tableau tous les chemins possibles pour arriver a la categorie
|
||||||
* en partant des categories principales, representes par des tableaux de categories
|
* en partant des categories principales, representes par des tableaux de categories
|
||||||
*
|
*
|
||||||
* @return void
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_all_ways()
|
function get_all_ways()
|
||||||
{
|
{
|
||||||
@ -1315,7 +1316,7 @@ class Categorie extends CommonObject
|
|||||||
$originImage = $dir . $file['name'];
|
$originImage = $dir . $file['name'];
|
||||||
|
|
||||||
// Cree fichier en taille origine
|
// Cree fichier en taille origine
|
||||||
$result=dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
||||||
|
|
||||||
if (file_exists($originImage))
|
if (file_exists($originImage))
|
||||||
{
|
{
|
||||||
@ -1329,17 +1330,23 @@ class Categorie extends CommonObject
|
|||||||
* Build thumb
|
* Build thumb
|
||||||
*
|
*
|
||||||
* @param string $file Chemin du fichier d'origine
|
* @param string $file Chemin du fichier d'origine
|
||||||
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
|
|
||||||
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function add_thumb($file, $maxWidth = 160, $maxHeight = 120)
|
function add_thumb($file)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php';
|
global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ...
|
||||||
|
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
vignette($file,$maxWidth,$maxHeight);
|
// Create small thumbs for company (Ratio is near 16/9)
|
||||||
|
// Used on logon for example
|
||||||
|
$imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
|
||||||
|
|
||||||
|
// Create mini thumbs for company (Ratio is near 16/9)
|
||||||
|
// Used on menu or for setup page for example
|
||||||
|
$imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1560,8 +1567,6 @@ class Categorie extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::initAsSpecimen");
|
dol_syslog(get_class($this)."::initAsSpecimen");
|
||||||
|
|
||||||
// Initialise parametres
|
// Initialise parametres
|
||||||
|
|||||||
@ -90,6 +90,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
|||||||
if (empty($categorie->error))
|
if (empty($categorie->error))
|
||||||
{
|
{
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if ($categorie->update($user) > 0)
|
if ($categorie->update($user) > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,9 @@ if ($id > 0)
|
|||||||
|
|
||||||
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if ($object->id) $result = $object->add_photo($upload_dir, $_FILES['userfile']);
|
if ($object->id) {
|
||||||
|
$object->add_photo($upload_dir, $_FILES['userfile']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer)
|
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer)
|
||||||
|
|||||||
@ -274,6 +274,7 @@ if ($action == 'add')
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -429,6 +430,7 @@ if ($action == 'update')
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -37,27 +37,67 @@ class ActionComm extends CommonObject
|
|||||||
public $table_rowid = 'id';
|
public $table_rowid = 'id';
|
||||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id of the event
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $id;
|
var $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id of the event. Use $id as possible
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $ref;
|
||||||
|
|
||||||
var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
|
var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||||
var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
|
var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
|
||||||
var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
|
var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||||
var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
|
var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||||
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
||||||
|
|
||||||
var $label;
|
var $label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @deprecated Use $label
|
||||||
|
*/
|
||||||
|
public $libelle;
|
||||||
|
|
||||||
var $datec; // Date creation record (datec)
|
var $datec; // Date creation record (datec)
|
||||||
var $datem; // Date modification record (tms)
|
var $datem; // Date modification record (tms)
|
||||||
var $author; // Object user that create action //deprecated
|
|
||||||
var $usermod; // Object user that modified action // deprecated
|
/**
|
||||||
|
* Object user that create action
|
||||||
|
* @var User
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
var $author;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object user that modified action
|
||||||
|
* @var User
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
var $usermod;
|
||||||
var $authorid; // Id user that create action
|
var $authorid; // Id user that create action
|
||||||
var $usermodid; // Id user that modified action
|
var $usermodid; // Id user that modified action
|
||||||
|
|
||||||
var $datep; // Date action start (datep)
|
var $datep; // Date action start (datep)
|
||||||
var $datef; // Date action end (datep2)
|
var $datef; // Date action end (datep2)
|
||||||
var $durationp = -1; // -1=Unkown duration // deprecated
|
|
||||||
|
/**
|
||||||
|
* @var int -1=Unkown duration
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
var $durationp = -1;
|
||||||
var $fulldayevent = 0; // 1=Event on full day
|
var $fulldayevent = 0; // 1=Event on full day
|
||||||
var $punctual = 1; // Milestone // deprecated. Milestone is already event with end date = start date
|
|
||||||
|
/**
|
||||||
|
* Milestone
|
||||||
|
* @var int
|
||||||
|
* @deprecated Milestone is already event with end date = start date
|
||||||
|
*/
|
||||||
|
var $punctual = 1;
|
||||||
var $percentage; // Percentage
|
var $percentage; // Percentage
|
||||||
var $location; // Location
|
var $location; // Location
|
||||||
|
|
||||||
@ -68,14 +108,41 @@ class ActionComm extends CommonObject
|
|||||||
var $userassigned = array(); // Array of user ids
|
var $userassigned = array(); // Array of user ids
|
||||||
var $userownerid; // Id of user owner
|
var $userownerid; // Id of user owner
|
||||||
var $userdoneid; // Id of user done
|
var $userdoneid; // Id of user done
|
||||||
var $usertodo; // Object user of owner // deprecated
|
|
||||||
var $userdone; // Object user that did action // deprecated
|
/**
|
||||||
|
* Object user of owner
|
||||||
|
* @var User
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
var $usertodo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object user that did action
|
||||||
|
* @var User
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
var $userdone;
|
||||||
|
|
||||||
var $socid;
|
var $socid;
|
||||||
var $contactid;
|
var $contactid;
|
||||||
var $societe; // Company linked to action (optional)
|
|
||||||
var $contact; // Contact linked to action (optional)
|
/**
|
||||||
var $fk_project; // Id of project (optional)
|
* Company linked to action (optional)
|
||||||
|
* @var Societe|null
|
||||||
|
*/
|
||||||
|
var $societe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contact linked to action (optional)
|
||||||
|
* @var Contact|null
|
||||||
|
*/
|
||||||
|
var $contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id of project (optional)
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
var $fk_project;
|
||||||
|
|
||||||
// Properties for links to other objects
|
// Properties for links to other objects
|
||||||
var $fk_element; // Id of record
|
var $fk_element; // Id of record
|
||||||
@ -95,8 +162,6 @@ class ActionComm extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->societe = new stdClass(); // deprecated
|
$this->societe = new stdClass(); // deprecated
|
||||||
@ -239,12 +304,11 @@ class ActionComm extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! is_array($val)) // For backward compatibility when val=id
|
if (! is_array($val)) // For backward compatibility when val=id
|
||||||
{
|
{
|
||||||
$tmpid=$val;
|
|
||||||
$val=array('id'=>$val);
|
$val=array('id'=>$val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||||
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".($val['mandatory']?$val['mandatory']:'0').", ".($val['transparency']?$val['transparency']:'0').", ".($val['answer_status']?$val['answer_status']:'0').")";
|
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory'])?'0':$val['mandatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
@ -337,18 +401,20 @@ class ActionComm extends CommonObject
|
|||||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
|
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
|
||||||
$sql.= " s.nom as socname,";
|
$sql.= " s.nom as socname,";
|
||||||
$sql.= " u.firstname, u.lastname as lastname";
|
$sql.= " u.firstname, u.lastname as lastname";
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a ";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id ";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
||||||
$sql.= " WHERE a.fk_action=c.id";
|
$sql.= " WHERE ";
|
||||||
if ($ref) $sql.= " AND a.id=".$ref; // No field ref, we use id
|
if ($ref) $sql.= " a.id=".$ref; // No field ref, we use id
|
||||||
else $sql.= " AND a.id=".$id;
|
else $sql.= " a.id=".$id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows($resql))
|
$num=$this->db->num_rows($resql);
|
||||||
|
if ($num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
@ -404,13 +470,15 @@ class ActionComm extends CommonObject
|
|||||||
$this->elementtype = $obj->elementtype;
|
$this->elementtype = $obj->elementtype;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $num;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -421,9 +489,7 @@ class ActionComm extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function fetch_userassigned()
|
function fetch_userassigned()
|
||||||
{
|
{
|
||||||
global $langs;
|
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
||||||
|
|
||||||
$sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
||||||
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
||||||
$resql2=$this->db->query($sql);
|
$resql2=$this->db->query($sql);
|
||||||
@ -609,7 +675,7 @@ class ActionComm extends CommonObject
|
|||||||
foreach($this->userassigned as $key => $val)
|
foreach($this->userassigned as $key => $val)
|
||||||
{
|
{
|
||||||
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||||
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".($val['manadatory']?$val['manadatory']:'0').", ".($val['transparency']?$val['transparency']:'0').", ".($val['answer_status']?$val['answer_status']:'0').")";
|
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
@ -885,7 +951,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $overwritepicto 1=Overwrite picto
|
* @param int $overwritepicto 1=Overwrite picto
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
|
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -1145,7 +1211,7 @@ class ActionComm extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf,$user;
|
global $user;
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
@ -1162,6 +1228,7 @@ class ActionComm extends CommonObject
|
|||||||
$this->datef=$now;
|
$this->datef=$now;
|
||||||
$this->author=$user;
|
$this->author=$user;
|
||||||
$this->usermod=$user;
|
$this->usermod=$user;
|
||||||
|
$this->usertodo=$user;
|
||||||
$this->fulldayevent=0;
|
$this->fulldayevent=0;
|
||||||
$this->punctual=0;
|
$this->punctual=0;
|
||||||
$this->percentage=0;
|
$this->percentage=0;
|
||||||
|
|||||||
@ -99,10 +99,10 @@ class CActionComm
|
|||||||
/**
|
/**
|
||||||
* Return list of event types: array(id=>label) or array(code=>label)
|
* Return list of event types: array(id=>label) or array(code=>label)
|
||||||
*
|
*
|
||||||
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
|
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
|
||||||
* @param string $idorcode 'id' or 'code'
|
* @param string $idorcode 'id' or 'code'
|
||||||
* @param string $excludetype Type to exclude
|
* @param string $excludetype Type to exclude
|
||||||
* @param string $onlyautoornot Group list by auto events or not
|
* @param int $onlyautoornot Group list by auto events or not
|
||||||
* @return mixed Array of all event types if OK, <0 if KO
|
* @return mixed Array of all event types if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
|
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
|
||||||
|
|||||||
@ -23,10 +23,11 @@
|
|||||||
* \ingroup agenda
|
* \ingroup agenda
|
||||||
* \brief File of class to parse ical calendars
|
* \brief File of class to parse ical calendars
|
||||||
*/
|
*/
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/xcal.lib.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to parse ICal calendars
|
* Class to read/parse ICal calendars
|
||||||
*/
|
*/
|
||||||
class ICal
|
class ICal
|
||||||
{
|
{
|
||||||
@ -107,6 +108,7 @@ class ICal
|
|||||||
if (!stristr($this->file_text[0],'BEGIN:VCALENDAR')) return 'error not VCALENDAR';
|
if (!stristr($this->file_text[0],'BEGIN:VCALENDAR')) return 'error not VCALENDAR';
|
||||||
|
|
||||||
$insidealarm=0;
|
$insidealarm=0;
|
||||||
|
$tmpkey='';$tmpvalue='';
|
||||||
foreach ($this->file_text as $text)
|
foreach ($this->file_text as $text)
|
||||||
{
|
{
|
||||||
$text = trim($text); // trim one line
|
$text = trim($text); // trim one line
|
||||||
@ -137,7 +139,7 @@ class ICal
|
|||||||
case "BEGIN:DAYLIGHT":
|
case "BEGIN:DAYLIGHT":
|
||||||
case "BEGIN:VTIMEZONE":
|
case "BEGIN:VTIMEZONE":
|
||||||
case "BEGIN:STANDARD":
|
case "BEGIN:STANDARD":
|
||||||
$type = $value; // save tu array under value key
|
$type = $value; // save array under value key
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "END:VTODO": // end special text - goto VCALENDAR key
|
case "END:VTODO": // end special text - goto VCALENDAR key
|
||||||
@ -159,8 +161,31 @@ class ICal
|
|||||||
$insidealarm=0;
|
$insidealarm=0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // no special string
|
default: // no special string (SUMMARY, DESCRIPTION, ...)
|
||||||
if (! $insidealarm) $this->add_to_array($type, $key, $value); // add to array
|
if ($tmpvalue)
|
||||||
|
{
|
||||||
|
$tmpvalue .= $text;
|
||||||
|
if (! preg_match('/=$/',$text)) // No more lines
|
||||||
|
{
|
||||||
|
$key=$tmpkey;
|
||||||
|
$value=quotedPrintDecode(preg_replace('/^ENCODING=QUOTED-PRINTABLE:/i','',$tmpvalue));
|
||||||
|
$tmpkey='';
|
||||||
|
$tmpvalue='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^ENCODING=QUOTED-PRINTABLE:/i',$value))
|
||||||
|
{
|
||||||
|
if (preg_match('/=$/',$value))
|
||||||
|
{
|
||||||
|
$tmpkey=$key;
|
||||||
|
$tmpvalue=$tmpvalue.preg_replace('/=$/',"",$value); // We must wait to have next line to have complete message
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$value=quotedPrintDecode(preg_replace('/^ENCODING=QUOTED-PRINTABLE:/i','',$tmpvalue.$value));
|
||||||
|
}
|
||||||
|
} //$value=quotedPrintDecode($tmpvalue.$value);
|
||||||
|
if (! $insidealarm && ! $tmpkey) $this->add_to_array($type, $key, $value); // add to array
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,7 +286,7 @@ class ICal
|
|||||||
*/
|
*/
|
||||||
function ical_rrule($value)
|
function ical_rrule($value)
|
||||||
{
|
{
|
||||||
$result=aray();
|
$result=array();
|
||||||
$rrule = explode(';',$value);
|
$rrule = explode(';',$value);
|
||||||
foreach ($rrule as $line)
|
foreach ($rrule as $line)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -39,6 +40,9 @@ if (! empty($conf->projet->enabled)) {
|
|||||||
|
|
||||||
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
|
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
|
||||||
|
|
||||||
|
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||||
|
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
||||||
|
|
||||||
$filter=GETPOST("filter",'',3);
|
$filter=GETPOST("filter",'',3);
|
||||||
$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3);
|
$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3);
|
||||||
$usergroup = GETPOST("usergroup","int",3);
|
$usergroup = GETPOST("usergroup","int",3);
|
||||||
@ -170,7 +174,7 @@ $listofextcals=array();
|
|||||||
if (empty($conf->global->AGENDA_DISABLE_EXT))
|
if (empty($conf->global->AGENDA_DISABLE_EXT))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
while($i < $conf->global->AGENDA_EXT_NB)
|
while($i < $MAXAGENDA)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
$source='AGENDA_EXT_SRC'.$i;
|
$source='AGENDA_EXT_SRC'.$i;
|
||||||
@ -188,7 +192,7 @@ if (empty($conf->global->AGENDA_DISABLE_EXT))
|
|||||||
if (empty($user->conf->AGENDA_DISABLE_EXT))
|
if (empty($user->conf->AGENDA_DISABLE_EXT))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
while($i < $conf->global->AGENDA_EXT_NB)
|
while($i < $MAXAGENDA)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
$source='AGENDA_EXT_SRC_'.$user->id.'_'.$i;
|
$source='AGENDA_EXT_SRC_'.$user->id.'_'.$i;
|
||||||
@ -344,7 +348,6 @@ if (! empty($conf->use_javascript_ajax))
|
|||||||
$s='';
|
$s='';
|
||||||
$s.='<script type="text/javascript">' . "\n";
|
$s.='<script type="text/javascript">' . "\n";
|
||||||
$s.='jQuery(document).ready(function () {' . "\n";
|
$s.='jQuery(document).ready(function () {' . "\n";
|
||||||
$s.='jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
|
|
||||||
$s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
|
$s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
|
||||||
$s.='jQuery(".family_birthday").toggle();' . "\n";
|
$s.='jQuery(".family_birthday").toggle();' . "\n";
|
||||||
if ($action=="show_week" || $action=="show_month" || empty($action))
|
if ($action=="show_week" || $action=="show_month" || empty($action))
|
||||||
@ -358,18 +361,20 @@ if (! empty($conf->use_javascript_ajax))
|
|||||||
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' </div>';
|
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' </div>';
|
||||||
if (is_array($showextcals) && count($showextcals) > 0)
|
if (is_array($showextcals) && count($showextcals) > 0)
|
||||||
{
|
{
|
||||||
|
$s.='<script type="text/javascript">' . "\n";
|
||||||
|
$s.='jQuery(document).ready(function () {
|
||||||
|
jQuery("table input[name^=\"check_ext\"]").click(function() {
|
||||||
|
var name = $(this).attr("name");
|
||||||
|
|
||||||
|
jQuery(".family_ext" + name.replace("check_ext", "")).toggle();
|
||||||
|
});
|
||||||
|
});' . "\n";
|
||||||
|
$s.='</script>' . "\n";
|
||||||
|
|
||||||
foreach ($showextcals as $val)
|
foreach ($showextcals as $val)
|
||||||
{
|
{
|
||||||
$htmlname = dol_string_nospecial($val['name']);
|
$htmlname = md5($val['name']);
|
||||||
$s.='<script type="text/javascript">' . "\n";
|
$s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val['name'] . ' </div>';
|
||||||
$s.='jQuery(document).ready(function () {' . "\n";
|
|
||||||
$s.=' jQuery("#check_' . $htmlname . '").click(function() {';
|
|
||||||
$s.=' /* alert("'.$htmlname.'"); */';
|
|
||||||
$s.=' jQuery(".family_' . $htmlname . '").toggle();';
|
|
||||||
$s.=' });' . "\n";
|
|
||||||
$s.='});' . "\n";
|
|
||||||
$s.='</script>' . "\n";
|
|
||||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' </div>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' </div>';
|
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' </div>';
|
||||||
@ -1144,7 +1149,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
|
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
|
||||||
|
|
||||||
// Define $color (Hex string like '0088FF') and $cssclass of event
|
// Define $color (Hex string like '0088FF') and $cssclass of event
|
||||||
$color=-1; $cssclass=''; $colorindex=-1;
|
$color=-1; $colorindex=-1;
|
||||||
if (in_array($user->id, $keysofuserassigned))
|
if (in_array($user->id, $keysofuserassigned))
|
||||||
{
|
{
|
||||||
$nummytasks++; $cssclass='family_mytasks';
|
$nummytasks++; $cssclass='family_mytasks';
|
||||||
@ -1170,7 +1175,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$numicals[dol_string_nospecial($event->icalname)]++;
|
$numicals[dol_string_nospecial($event->icalname)]++;
|
||||||
}
|
}
|
||||||
$color=$event->icalcolor;
|
$color=$event->icalcolor;
|
||||||
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unmovable');
|
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unmovable');
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'BIRTHDAY')
|
else if ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -313,7 +313,7 @@ if ($resql)
|
|||||||
$actionstatic->id=$obj->id;
|
$actionstatic->id=$obj->id;
|
||||||
$actionstatic->type_code=$obj->type_code;
|
$actionstatic->type_code=$obj->type_code;
|
||||||
$actionstatic->type_label=$obj->type_label;
|
$actionstatic->type_label=$obj->type_label;
|
||||||
$actionstatic->libelle=$obj->label;
|
$actionstatic->label=$obj->label;
|
||||||
print $actionstatic->getNomUrl(1,28);
|
print $actionstatic->getNomUrl(1,28);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -305,16 +305,16 @@ if ($conf->use_javascript_ajax)
|
|||||||
{
|
{
|
||||||
foreach ($showextcals as $val)
|
foreach ($showextcals as $val)
|
||||||
{
|
{
|
||||||
$htmlname = dol_string_nospecial($val['name']);
|
$htmlname = md5($val['name']);
|
||||||
$s.='<script type="text/javascript">' . "\n";
|
$s.='<script type="text/javascript">' . "\n";
|
||||||
$s.='jQuery(document).ready(function () {' . "\n";
|
$s.='jQuery(document).ready(function () {' . "\n";
|
||||||
$s.=' jQuery("#check_' . $htmlname . '").click(function() {';
|
$s.=' jQuery("#check_ext' . $htmlname . '").click(function() {';
|
||||||
$s.=' /* alert("'.$htmlname.'"); */';
|
$s.=' /* alert("'.$htmlname.'"); */';
|
||||||
$s.=' jQuery(".family_' . $htmlname . '").toggle();';
|
$s.=' jQuery(".family_ext' . $htmlname . '").toggle();';
|
||||||
$s.=' });' . "\n";
|
$s.=' });' . "\n";
|
||||||
$s.='});' . "\n";
|
$s.='});' . "\n";
|
||||||
$s.='</script>' . "\n";
|
$s.='</script>' . "\n";
|
||||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' </div>';
|
$s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'] . ' </div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ else
|
|||||||
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||||
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
|
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
|
||||||
if ($usergroup > 0) $sql.= " AND ug.fk_usergroup = ".$usergroup;
|
if ($usergroup > 0) $sql.= " AND ug.fk_usergroup = ".$usergroup;
|
||||||
if (GETPOST("usertodo","int",3) > 0) $sql.=" AND u.rowid = ".GETPOST("usertodo","int",3);
|
//if (GETPOST("usertodo","int",3) > 0) $sql.=" AND u.rowid = ".GETPOST("usertodo","int",3);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -804,7 +804,7 @@ $db->close();
|
|||||||
* @param int $minheight Minimum height for each event. 60px by default.
|
* @param int $minheight Minimum height for each event. 60px by default.
|
||||||
* @param boolean $showheader Show header
|
* @param boolean $showheader Show header
|
||||||
* @param array $colorsbytype Array with colors by type
|
* @param array $colorsbytype Array with colors by type
|
||||||
* @param string $var true or false for alternat style on tr/td
|
* @param bool $var true or false for alternat style on tr/td
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
||||||
@ -869,7 +869,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
}
|
}
|
||||||
|
|
||||||
$color=$event->icalcolor;
|
$color=$event->icalcolor;
|
||||||
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
|
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'BIRTHDAY')
|
else if ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -909,7 +909,7 @@ if ($id > 0)
|
|||||||
// Addresses list
|
// Addresses list
|
||||||
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
|
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
|
||||||
{
|
{
|
||||||
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -65,7 +65,7 @@ if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db);
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("CustomerArea"));
|
print_fiche_titre($langs->trans("CommercialArea"));
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
|
print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"), 'contract')." ".$obj->ref."</a></td>";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$companystatic->id=$objp->rowid;
|
$companystatic->id=$objp->rowid;
|
||||||
$companystatic->name=$objp->name;
|
$companystatic->name=$objp->name;
|
||||||
|
|||||||
@ -197,7 +197,7 @@ if (empty($reshook))
|
|||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// Positionne date debut envoi
|
// Positionne date debut envoi
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate($now)." WHERE rowid=".$object->id;
|
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".$object->id;
|
||||||
$resql2=$db->query($sql);
|
$resql2=$db->query($sql);
|
||||||
if (! $resql2)
|
if (! $resql2)
|
||||||
{
|
{
|
||||||
@ -293,7 +293,7 @@ if (empty($reshook))
|
|||||||
dol_syslog("comm/mailing/card.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
|
dol_syslog("comm/mailing/card.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
|
||||||
|
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||||
$sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
|
$sql.=" SET statut=1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
|
||||||
$resql2=$db->query($sql);
|
$resql2=$db->query($sql);
|
||||||
if (! $resql2)
|
if (! $resql2)
|
||||||
{
|
{
|
||||||
@ -336,7 +336,7 @@ if (empty($reshook))
|
|||||||
dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
|
dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
|
||||||
|
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||||
$sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
|
$sql.=" SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
|
||||||
$resql2=$db->query($sql);
|
$resql2=$db->query($sql);
|
||||||
if (! $resql2)
|
if (! $resql2)
|
||||||
{
|
{
|
||||||
@ -778,7 +778,7 @@ else
|
|||||||
if ($conf->file->mailing_limit_sendbyweb == 0)
|
if ($conf->file->mailing_limit_sendbyweb == 0)
|
||||||
{
|
{
|
||||||
$text.=$langs->trans("MailingNeedCommand");
|
$text.=$langs->trans("MailingNeedCommand");
|
||||||
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>';
|
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>';
|
||||||
$text.='<br><br>';
|
$text.='<br><br>';
|
||||||
}
|
}
|
||||||
$text.=$langs->trans('ConfirmSendingEmailing').'<br>';
|
$text.=$langs->trans('ConfirmSendingEmailing').'<br>';
|
||||||
|
|||||||
@ -118,8 +118,7 @@ if ($action == 'add')
|
|||||||
if (GETPOST('clearlist'))
|
if (GETPOST('clearlist'))
|
||||||
{
|
{
|
||||||
// Chargement de la classe
|
// Chargement de la classe
|
||||||
$classname = "MailingTargets";
|
$obj = new MailingTargets($db);
|
||||||
$obj = new $classname($db);
|
|
||||||
$obj->clear_target($id);
|
$obj->clear_target($id);
|
||||||
|
|
||||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||||
@ -135,8 +134,7 @@ if ($action == 'delete')
|
|||||||
{
|
{
|
||||||
if (!empty($id))
|
if (!empty($id))
|
||||||
{
|
{
|
||||||
$classname = "MailingTargets";
|
$obj = new MailingTargets($db);
|
||||||
$obj = new $classname($db);
|
|
||||||
$obj->update_nb($id);
|
$obj->update_nb($id);
|
||||||
|
|
||||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||||
|
|||||||
@ -267,6 +267,8 @@ class Mailing extends CommonObject
|
|||||||
|
|
||||||
$object=new Mailing($this->db);
|
$object=new Mailing($this->db);
|
||||||
|
|
||||||
|
$object->context['createfromclone']='createfromclone';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
@ -362,6 +364,8 @@ class Mailing extends CommonObject
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($object->context['createfromclone']);
|
||||||
|
|
||||||
// End
|
// End
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -956,6 +956,11 @@ if (empty($reshook))
|
|||||||
else if ($action == 'builddoc' && $user->rights->propal->creer) {
|
else if ($action == 'builddoc' && $user->rights->propal->creer) {
|
||||||
if (GETPOST('model')) {
|
if (GETPOST('model')) {
|
||||||
$object->setDocModel($user, GETPOST('model'));
|
$object->setDocModel($user, GETPOST('model'));
|
||||||
|
}
|
||||||
|
if (GETPOST('fk_bank')) { // this field may come from an external module
|
||||||
|
$object->fk_bank = GETPOST('fk_bank');
|
||||||
|
} else {
|
||||||
|
$object->fk_bank = $object->fk_account;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -1080,10 +1085,10 @@ if (empty($reshook))
|
|||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||||
if ($ret < 0)
|
if ($ret < 0) $error++;
|
||||||
$error ++;
|
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error)
|
||||||
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
// FIXME le hook fait double emploi avec le trigger !!
|
// FIXME le hook fait double emploi avec le trigger !!
|
||||||
$hookmanager->initHooks(array('propaldao'));
|
$hookmanager->initHooks(array('propaldao'));
|
||||||
|
|||||||
@ -239,27 +239,30 @@ class Propal extends CommonObject
|
|||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
|
|
||||||
$propalligne=new PropaleLigne($this->db);
|
$line=new PropaleLigne($this->db);
|
||||||
$propalligne->fk_propal=$this->id;
|
|
||||||
$propalligne->fk_remise_except=$remise->id;
|
$this->line->context = $this->context;
|
||||||
$propalligne->desc=$remise->description; // Description ligne
|
|
||||||
$propalligne->tva_tx=$remise->tva_tx;
|
$line->fk_propal=$this->id;
|
||||||
$propalligne->subprice=-$remise->amount_ht;
|
$line->fk_remise_except=$remise->id;
|
||||||
$propalligne->fk_product=0; // Id produit predefini
|
$line->desc=$remise->description; // Description ligne
|
||||||
$propalligne->qty=1;
|
$line->tva_tx=$remise->tva_tx;
|
||||||
$propalligne->remise=0;
|
$line->subprice=-$remise->amount_ht;
|
||||||
$propalligne->remise_percent=0;
|
$line->fk_product=0; // Id produit predefini
|
||||||
$propalligne->rang=-1;
|
$line->qty=1;
|
||||||
$propalligne->info_bits=2;
|
$line->remise=0;
|
||||||
|
$line->remise_percent=0;
|
||||||
|
$line->rang=-1;
|
||||||
|
$line->info_bits=2;
|
||||||
|
|
||||||
// TODO deprecated
|
// TODO deprecated
|
||||||
$propalligne->price=-$remise->amount_ht;
|
$line->price=-$remise->amount_ht;
|
||||||
|
|
||||||
$propalligne->total_ht = -$remise->amount_ht;
|
$line->total_ht = -$remise->amount_ht;
|
||||||
$propalligne->total_tva = -$remise->amount_tva;
|
$line->total_tva = -$remise->amount_tva;
|
||||||
$propalligne->total_ttc = -$remise->amount_ttc;
|
$line->total_ttc = -$remise->amount_ttc;
|
||||||
|
|
||||||
$result=$propalligne->insert();
|
$result=$line->insert();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$result=$this->update_price(1);
|
$result=$this->update_price(1);
|
||||||
@ -276,7 +279,7 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$propalligne->error;
|
$this->error=$line->error;
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
@ -296,15 +299,15 @@ class Propal extends CommonObject
|
|||||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
||||||
*
|
*
|
||||||
* @param string $desc Description de la ligne
|
* @param string $desc Description de la ligne
|
||||||
* @param double $pu_ht Prix unitaire
|
* @param float $pu_ht Prix unitaire
|
||||||
* @param double $qty Quantite
|
* @param float $qty Quantite
|
||||||
* @param double $txtva Taux de tva
|
* @param float $txtva Taux de tva
|
||||||
* @param double $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate
|
||||||
* @param double $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate
|
||||||
* @param int $fk_product Id du produit/service predefini
|
* @param int $fk_product Id du produit/service predefini
|
||||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||||
* @param string $price_base_type HT or TTC
|
* @param string $price_base_type HT or TTC
|
||||||
* @param double $pu_ttc Prix unitaire TTC
|
* @param float $pu_ttc Prix unitaire TTC
|
||||||
* @param int $info_bits Bits de type de lignes
|
* @param int $info_bits Bits de type de lignes
|
||||||
* @param int $type Type of line (product, service)
|
* @param int $type Type of line (product, service)
|
||||||
* @param int $rang Position of line
|
* @param int $rang Position of line
|
||||||
@ -320,7 +323,7 @@ class Propal extends CommonObject
|
|||||||
*
|
*
|
||||||
* @see add_product
|
* @see add_product
|
||||||
*/
|
*/
|
||||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
|
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
|
||||||
{
|
{
|
||||||
global $mysoc;
|
global $mysoc;
|
||||||
|
|
||||||
@ -393,6 +396,8 @@ class Propal extends CommonObject
|
|||||||
// Insert line
|
// Insert line
|
||||||
$this->line=new PropaleLigne($this->db);
|
$this->line=new PropaleLigne($this->db);
|
||||||
|
|
||||||
|
$this->line->context = $this->context;
|
||||||
|
|
||||||
$this->line->fk_propal=$this->id;
|
$this->line->fk_propal=$this->id;
|
||||||
$this->line->label=$label;
|
$this->line->label=$label;
|
||||||
$this->line->desc=$desc;
|
$this->line->desc=$desc;
|
||||||
@ -477,14 +482,14 @@ class Propal extends CommonObject
|
|||||||
* Update a proposal line
|
* Update a proposal line
|
||||||
*
|
*
|
||||||
* @param int $rowid Id de la ligne
|
* @param int $rowid Id de la ligne
|
||||||
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type)
|
* @param float $pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||||
* @param double $qty Quantity
|
* @param float $qty Quantity
|
||||||
* @param double $remise_percent Remise effectuee sur le produit
|
* @param float $remise_percent Remise effectuee sur le produit
|
||||||
* @param double $txtva Taux de TVA
|
* @param float $txtva Taux de TVA
|
||||||
* @param double $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate
|
||||||
* @param double $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate
|
||||||
* @param string $desc Description
|
* @param string $desc Description
|
||||||
* @param double $price_base_type HT ou TTC
|
* @param string $price_base_type HT ou TTC
|
||||||
* @param int $info_bits Miscellaneous informations
|
* @param int $info_bits Miscellaneous informations
|
||||||
* @param int $special_code Special code (also used by externals modules!)
|
* @param int $special_code Special code (also used by externals modules!)
|
||||||
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
|
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
|
||||||
@ -498,9 +503,9 @@ class Propal extends CommonObject
|
|||||||
* @param array $array_option extrafields array
|
* @param array $array_option extrafields array
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0)
|
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0)
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs, $mysoc;
|
global $mysoc;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits");
|
dol_syslog(get_class($this)."::updateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits");
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
@ -545,6 +550,8 @@ class Propal extends CommonObject
|
|||||||
// Update line
|
// Update line
|
||||||
$this->line=new PropaleLigne($this->db);
|
$this->line=new PropaleLigne($this->db);
|
||||||
|
|
||||||
|
$this->line->context = $this->context;
|
||||||
|
|
||||||
// Stock previous line records
|
// Stock previous line records
|
||||||
$staticline=new PropaleLigne($this->db);
|
$staticline=new PropaleLigne($this->db);
|
||||||
$staticline->fetch($rowid);
|
$staticline->fetch($rowid);
|
||||||
@ -953,6 +960,8 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
global $user,$langs,$conf,$hookmanager;
|
global $user,$langs,$conf,$hookmanager;
|
||||||
|
|
||||||
|
$this->context['createfromclone']='createfromclone';
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
@ -1046,6 +1055,8 @@ class Propal extends CommonObject
|
|||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($this->context['createfromclone']);
|
||||||
|
|
||||||
// End
|
// End
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -1866,8 +1877,6 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function set_draft($user)
|
function set_draft($user)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0";
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
@ -3090,6 +3099,7 @@ class PropaleLigne extends CommonObject
|
|||||||
if (empty($this->special_code)) $this->special_code=0;
|
if (empty($this->special_code)) $this->special_code=0;
|
||||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||||
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
||||||
|
if (empty($this->subprice)) $this->subprice=0;
|
||||||
|
|
||||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||||
|
|
||||||
|
|||||||
@ -193,8 +193,6 @@ class PropaleStats extends Stats
|
|||||||
*/
|
*/
|
||||||
function getAllByProduct($year)
|
function getAllByProduct($year)
|
||||||
{
|
{
|
||||||
global $user;
|
|
||||||
|
|
||||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||||
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
|||||||
@ -144,7 +144,9 @@ if (! $sortorder) $sortorder='DESC';
|
|||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
|
|
||||||
|
|
||||||
$sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,';
|
if (! $sall) $sql = 'SELECT';
|
||||||
|
else $sql = 'SELECT DISTINCT';
|
||||||
|
$sql.= ' s.rowid, s.nom as name, s.town, s.client, s.code_client,';
|
||||||
$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
|
$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
||||||
$sql.= ' u.login';
|
$sql.= ' u.login';
|
||||||
|
|||||||
@ -41,8 +41,6 @@ class Prospect extends Societe
|
|||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
global $config;
|
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -56,7 +54,7 @@ class Prospect extends Societe
|
|||||||
*/
|
*/
|
||||||
function load_state_board()
|
function load_state_board()
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $user;
|
||||||
|
|
||||||
$this->nb=array("customers" => 0,"prospects" => 0);
|
$this->nb=array("customers" => 0,"prospects" => 0);
|
||||||
$clause = "WHERE";
|
$clause = "WHERE";
|
||||||
|
|||||||
@ -534,7 +534,7 @@ if ($socid > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,6 +94,7 @@ $hookmanager->initHooks(array('ordercard','globalcard'));
|
|||||||
|
|
||||||
$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -137,8 +138,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reopen a closed order
|
// Reopen a closed order
|
||||||
else if ($action == 'reopen' && $user->rights->commande->creer) {
|
else if ($action == 'reopen' && $user->rights->commande->creer)
|
||||||
if ($object->statut == 3) {
|
{
|
||||||
|
if ($object->statut == -1 || $object->statut == 3)
|
||||||
|
{
|
||||||
$result = $object->set_reopen($user);
|
$result = $object->set_reopen($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -206,13 +209,13 @@ if (empty($reshook))
|
|||||||
if ($datecommande == '') {
|
if ($datecommande == '') {
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($socid < 1) {
|
if ($socid < 1) {
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
@ -271,8 +274,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
if ($ret < 0)
|
if ($ret < 0) $error++;
|
||||||
$error ++;
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -334,7 +336,7 @@ if (empty($reshook))
|
|||||||
$result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option);
|
$result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,14 +351,14 @@ if (empty($reshook))
|
|||||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
if ($reshook < 0)
|
if ($reshook < 0)
|
||||||
$error ++;
|
$error++;
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($srcobject->error, 'errors');
|
setEventMessage($srcobject->error, 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessage($object->error, 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Required extrafield left blank, error message already defined by setOptionalsFromPost()
|
// Required extrafield left blank, error message already defined by setOptionalsFromPost()
|
||||||
@ -365,10 +367,10 @@ if (empty($reshook))
|
|||||||
} else {
|
} else {
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
if ($ret < 0)
|
if ($ret < 0) $error++;
|
||||||
$error ++;
|
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error)
|
||||||
|
{
|
||||||
$object_id = $object->create($user);
|
$object_id = $object->create($user);
|
||||||
|
|
||||||
// If some invoice's lines already known
|
// If some invoice's lines already known
|
||||||
@ -390,7 +392,7 @@ if (empty($reshook))
|
|||||||
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
|
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,24 +556,24 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
|
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
|
||||||
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
|
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
|
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
|
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
if ($qty == '') {
|
if ($qty == '') {
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
|
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
|
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
|
||||||
@ -826,7 +828,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
||||||
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
|
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$type = GETPOST('type');
|
$type = GETPOST('type');
|
||||||
@ -835,7 +837,7 @@ if (empty($reshook))
|
|||||||
// Check parameters
|
// Check parameters
|
||||||
if (GETPOST('type') < 0) {
|
if (GETPOST('type') < 0) {
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1073,16 +1075,17 @@ if (empty($reshook))
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate order document (define into /core/modules/commande/modules_commande.php)
|
||||||
else if ($action == 'builddoc') // In get or post
|
else if ($action == 'builddoc') // In get or post
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Generate order document
|
|
||||||
* define into /core/modules/commande/modules_commande.php
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Save last template used to generate document
|
// Save last template used to generate document
|
||||||
if (GETPOST('model'))
|
if (GETPOST('model'))
|
||||||
$object->setDocModel($user, GETPOST('model', 'alpha'));
|
$object->setDocModel($user, GETPOST('model', 'alpha'));
|
||||||
|
if (GETPOST('fk_bank')) { // this field may come from an external module
|
||||||
|
$object->fk_bank = GETPOST('fk_bank');
|
||||||
|
} else {
|
||||||
|
$object->fk_bank = $object->fk_account;
|
||||||
|
}
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
@ -1124,8 +1127,7 @@ if (empty($reshook))
|
|||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||||
if ($ret < 0)
|
if ($ret < 0) $error++;
|
||||||
$error ++;
|
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
@ -1137,10 +1139,10 @@ if (empty($reshook))
|
|||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$result = $object->insertExtraFields();
|
$result = $object->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
} else if ($reshook < 0)
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
@ -1279,7 +1281,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
$demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0));
|
$demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0));
|
||||||
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
||||||
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'';
|
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:'';
|
||||||
|
|
||||||
$datedelivery = (! empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
|
$datedelivery = (! empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
|
||||||
|
|
||||||
@ -1300,7 +1302,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
$demand_reason_id = $soc->demand_reason_id;
|
$demand_reason_id = $soc->demand_reason_id;
|
||||||
$remise_percent = $soc->remise_percent;
|
$remise_percent = $soc->remise_percent;
|
||||||
$remise_absolue = 0;
|
$remise_absolue = 0;
|
||||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'';
|
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:'';
|
||||||
$projectid = 0;
|
$projectid = 0;
|
||||||
}
|
}
|
||||||
$absolute_discount=$soc->getAvailableDiscounts();
|
$absolute_discount=$soc->getAvailableDiscounts();
|
||||||
@ -1368,7 +1370,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
}
|
}
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
|
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
|
||||||
$form->select_date('', 're', '', '', '', "crea_commande", 1, 1);
|
//$form->select_date($dateorder, 're', '', '', '', "crea_commande", 1, 1);
|
||||||
|
$form->select_date('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date de livraison
|
// Date de livraison
|
||||||
@ -1376,7 +1379,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
if (empty($datedelivery))
|
if (empty($datedelivery))
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
|
if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
|
||||||
else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'';
|
else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE_DELIVERY)?-1:'';
|
||||||
}
|
}
|
||||||
$form->select_date($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
|
$form->select_date($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -2180,7 +2183,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reopen a closed order
|
// Reopen a closed order
|
||||||
if ($object->statut == 3 && $user->rights->commande->creer) {
|
if (($object->statut == 3 || $object->statut == -1) && $user->rights->commande->creer) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
@ -60,7 +60,7 @@ class Commande extends CommonOrder
|
|||||||
var $ref_int;
|
var $ref_int;
|
||||||
var $contactid;
|
var $contactid;
|
||||||
var $fk_project;
|
var $fk_project;
|
||||||
var $statut; // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not)
|
var $statut; // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Delivered=Sent/Received, billed or not)
|
||||||
var $facturee; // deprecated
|
var $facturee; // deprecated
|
||||||
var $billed; // billed or not
|
var $billed; // billed or not
|
||||||
|
|
||||||
@ -110,6 +110,11 @@ class Commande extends CommonOrder
|
|||||||
var $nbtodo;
|
var $nbtodo;
|
||||||
var $nbtodolate;
|
var $nbtodolate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERR Not engouch stock
|
||||||
|
*/
|
||||||
|
const STOCK_NOT_ENOUGH_FOR_ORDER = -3;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -162,7 +167,6 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
$obj = new $classname();
|
$obj = new $classname();
|
||||||
$numref = "";
|
|
||||||
$numref = $obj->getNextValue($soc,$this);
|
$numref = $obj->getNextValue($soc,$this);
|
||||||
|
|
||||||
if ($numref != "")
|
if ($numref != "")
|
||||||
@ -295,7 +299,7 @@ class Commande extends CommonOrder
|
|||||||
// Rename directory if dir was a temporary ref
|
// Rename directory if dir was a temporary ref
|
||||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||||
{
|
{
|
||||||
// On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref)
|
// On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref)
|
||||||
// in order not to lose the attachments
|
// in order not to lose the attachments
|
||||||
$oldref = dol_sanitizeFileName($this->ref);
|
$oldref = dol_sanitizeFileName($this->ref);
|
||||||
$newref = dol_sanitizeFileName($num);
|
$newref = dol_sanitizeFileName($num);
|
||||||
@ -433,7 +437,7 @@ class Commande extends CommonOrder
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
if ($this->statut != 3)
|
if ($this->statut != -1 && $this->statut != 3)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::set_reopen order has not status closed", LOG_WARNING);
|
dol_syslog(get_class($this)."::set_reopen order has not status closed", LOG_WARNING);
|
||||||
return 0;
|
return 0;
|
||||||
@ -457,7 +461,7 @@ class Commande extends CommonOrder
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -745,9 +749,12 @@ class Commande extends CommonOrder
|
|||||||
$this->lines[$i]->array_options
|
$this->lines[$i]->array_options
|
||||||
);
|
);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -879,6 +886,8 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
$this->context['createfromclone'] = 'createfromclone';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// get extrafields so they will be clone
|
// get extrafields so they will be clone
|
||||||
@ -943,6 +952,8 @@ class Commande extends CommonOrder
|
|||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($this->context['createfromclone']);
|
||||||
|
|
||||||
// End
|
// End
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -1079,19 +1090,19 @@ class Commande extends CommonOrder
|
|||||||
* Add an order line into database (linked to product/service or not)
|
* Add an order line into database (linked to product/service or not)
|
||||||
*
|
*
|
||||||
* @param string $desc Description of line
|
* @param string $desc Description of line
|
||||||
* @param double $pu_ht Unit price (without tax)
|
* @param float $pu_ht Unit price (without tax)
|
||||||
* @param double $qty Quantite
|
* @param float $qty Quantite
|
||||||
* @param double $txtva Taux de tva force, sinon -1
|
* @param float $txtva Taux de tva force, sinon -1
|
||||||
* @param double $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate
|
||||||
* @param double $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate
|
||||||
* @param int $fk_product Id du produit/service predefini
|
* @param int $fk_product Id du produit/service predefini
|
||||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||||
* @param int $info_bits Bits de type de lignes
|
* @param int $info_bits Bits de type de lignes
|
||||||
* @param int $fk_remise_except Id remise
|
* @param int $fk_remise_except Id remise
|
||||||
* @param string $price_base_type HT or TTC
|
* @param string $price_base_type HT or TTC
|
||||||
* @param double $pu_ttc Prix unitaire TTC
|
* @param float $pu_ttc Prix unitaire TTC
|
||||||
* @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
* @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||||
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
* @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||||
* @param int $type Type of line (0=product, 1=service)
|
* @param int $type Type of line (0=product, 1=service)
|
||||||
* @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!)
|
||||||
@ -1182,10 +1193,12 @@ class Commande extends CommonOrder
|
|||||||
$result=$product->fetch($fk_product);
|
$result=$product->fetch($fk_product);
|
||||||
$product_type=$product->type;
|
$product_type=$product->type;
|
||||||
|
|
||||||
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) {
|
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty)
|
||||||
|
{
|
||||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||||
|
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -3;
|
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1202,6 +1215,8 @@ class Commande extends CommonOrder
|
|||||||
// Insert line
|
// Insert line
|
||||||
$this->line=new OrderLine($this->db);
|
$this->line=new OrderLine($this->db);
|
||||||
|
|
||||||
|
$this->line->context = $this->context;
|
||||||
|
|
||||||
$this->line->fk_commande=$this->id;
|
$this->line->fk_commande=$this->id;
|
||||||
$this->line->label=$label;
|
$this->line->label=$label;
|
||||||
$this->line->desc=$desc;
|
$this->line->desc=$desc;
|
||||||
@ -1285,16 +1300,16 @@ class Commande extends CommonOrder
|
|||||||
* $this->client must be loaded
|
* $this->client must be loaded
|
||||||
*
|
*
|
||||||
* @param int $idproduct Product Id
|
* @param int $idproduct Product Id
|
||||||
* @param double $qty Quantity
|
* @param float $qty Quantity
|
||||||
* @param double $remise_percent Product discount relative
|
* @param float $remise_percent Product discount relative
|
||||||
* @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
* @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||||
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
* @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
||||||
* insere dans tableau $this->products
|
* insere dans tableau $this->products
|
||||||
*/
|
*/
|
||||||
function add_product($idproduct, $qty, $remise_percent=0, $date_start='', $date_end='')
|
function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='')
|
||||||
{
|
{
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
@ -1316,6 +1331,8 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
$line=new OrderLine($this->db);
|
$line=new OrderLine($this->db);
|
||||||
|
|
||||||
|
$line->context = $this->context;
|
||||||
|
|
||||||
$line->fk_product=$idproduct;
|
$line->fk_product=$idproduct;
|
||||||
$line->desc=$prod->description;
|
$line->desc=$prod->description;
|
||||||
$line->qty=$qty;
|
$line->qty=$qty;
|
||||||
@ -1692,7 +1709,6 @@ class Commande extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
function loadExpeditions($filtre_statut=-1)
|
function loadExpeditions($filtre_statut=-1)
|
||||||
{
|
{
|
||||||
$num=0;
|
|
||||||
$this->expeditions = array();
|
$this->expeditions = array();
|
||||||
|
|
||||||
$sql = 'SELECT cd.rowid, cd.fk_product,';
|
$sql = 'SELECT cd.rowid, cd.fk_product,';
|
||||||
@ -1961,7 +1977,7 @@ class Commande extends CommonOrder
|
|||||||
* Set the order date
|
* Set the order date
|
||||||
*
|
*
|
||||||
* @param User $user Object user making change
|
* @param User $user Object user making change
|
||||||
* @param timestamp $date Date
|
* @param int $date Date
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_date($user, $date)
|
function set_date($user, $date)
|
||||||
@ -1995,7 +2011,7 @@ class Commande extends CommonOrder
|
|||||||
* Set the planned delivery date
|
* Set the planned delivery date
|
||||||
*
|
*
|
||||||
* @param User $user Objet utilisateur qui modifie
|
* @param User $user Objet utilisateur qui modifie
|
||||||
* @param timestamp $date_livraison Date de livraison
|
* @param int $date_livraison Date de livraison
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function set_date_livraison($user, $date_livraison)
|
function set_date_livraison($user, $date_livraison)
|
||||||
@ -2324,16 +2340,16 @@ class Commande extends CommonOrder
|
|||||||
*
|
*
|
||||||
* @param int $rowid Id of line to update
|
* @param int $rowid Id of line to update
|
||||||
* @param string $desc Description de la ligne
|
* @param string $desc Description de la ligne
|
||||||
* @param double $pu Prix unitaire
|
* @param float $pu Prix unitaire
|
||||||
* @param double $qty Quantity
|
* @param float $qty Quantity
|
||||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||||
* @param double $txtva Taux TVA
|
* @param float $txtva Taux TVA
|
||||||
* @param double $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate
|
||||||
* @param double $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate
|
||||||
* @param string $price_base_type HT or TTC
|
* @param string $price_base_type HT or TTC
|
||||||
* @param int $info_bits Miscellaneous informations on line
|
* @param int $info_bits Miscellaneous informations on line
|
||||||
* @param timestamp $date_start Start date of the line
|
* @param int $date_start Start date of the line
|
||||||
* @param timestamp $date_end End date of the line
|
* @param int $date_end End date of the line
|
||||||
* @param int $type Type of line (0=product, 1=service)
|
* @param int $type Type of line (0=product, 1=service)
|
||||||
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
|
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
|
||||||
* @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules)
|
* @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules)
|
||||||
@ -2344,7 +2360,7 @@ class Commande extends CommonOrder
|
|||||||
* @param array $array_option extrafields array
|
* @param array $array_option extrafields array
|
||||||
* @return int < 0 if KO, > 0 if OK
|
* @return int < 0 if KO, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
|
||||||
{
|
{
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
@ -2399,6 +2415,8 @@ class Commande extends CommonOrder
|
|||||||
// Update line
|
// Update line
|
||||||
$this->line=new OrderLine($this->db);
|
$this->line=new OrderLine($this->db);
|
||||||
|
|
||||||
|
$this->line->context = $this->context;
|
||||||
|
|
||||||
// Stock previous line records
|
// Stock previous line records
|
||||||
$staticline=new OrderLine($this->db);
|
$staticline=new OrderLine($this->db);
|
||||||
$staticline->fetch($rowid);
|
$staticline->fetch($rowid);
|
||||||
@ -2578,6 +2596,8 @@ class Commande extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
function update_extrafields($user)
|
function update_extrafields($user)
|
||||||
{
|
{
|
||||||
|
global $hookmanager, $conf;
|
||||||
|
|
||||||
$action='create';
|
$action='create';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
@ -3167,7 +3187,7 @@ class Commande extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$hookmanager;
|
global $conf,$langs;
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
|
|||||||
@ -221,5 +221,5 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$db->close();
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -43,7 +44,7 @@ $orderyear=GETPOST("orderyear","int");
|
|||||||
$ordermonth=GETPOST("ordermonth","int");
|
$ordermonth=GETPOST("ordermonth","int");
|
||||||
$deliveryyear=GETPOST("deliveryyear","int");
|
$deliveryyear=GETPOST("deliveryyear","int");
|
||||||
$deliverymonth=GETPOST("deliverymonth","int");
|
$deliverymonth=GETPOST("deliverymonth","int");
|
||||||
$search_ref=GETPOST('search_ref','alpha');
|
$search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha');
|
||||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||||
$search_company=GETPOST('search_company','alpha');
|
$search_company=GETPOST('search_company','alpha');
|
||||||
$sall=GETPOST('sall');
|
$sall=GETPOST('sall');
|
||||||
@ -110,7 +111,7 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped
|
|||||||
llxHeader('',$langs->trans("Orders"),$help_url);
|
llxHeader('',$langs->trans("Orders"),$help_url);
|
||||||
|
|
||||||
$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
|
$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
|
||||||
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee';
|
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as facturee';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||||
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||||
// We'll need this table joined to the select in order to filter by sale
|
// We'll need this table joined to the select in order to filter by sale
|
||||||
@ -361,19 +362,22 @@ if ($resql)
|
|||||||
// stock order and stock order_supplier
|
// stock order and stock order_supplier
|
||||||
$stock_order=0;
|
$stock_order=0;
|
||||||
$stock_order_supplier=0;
|
$stock_order_supplier=0;
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
||||||
if (! empty($conf->commande->enabled)) {
|
{
|
||||||
|
if (! empty($conf->commande->enabled))
|
||||||
|
{
|
||||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
|
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
|
||||||
$generic_product->load_stats_commande(0,'1,2',true);
|
$generic_product->load_stats_commande(0,'1,2');
|
||||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
|
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
|
||||||
} else {
|
} else {
|
||||||
$generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
|
$generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
|
||||||
}
|
}
|
||||||
$stock_order=$generic_product->stats_commande['qty'];
|
$stock_order=$generic_product->stats_commande['qty'];
|
||||||
}
|
}
|
||||||
if (! empty($conf->fournisseur->enabled)) {
|
if (! empty($conf->fournisseur->enabled))
|
||||||
|
{
|
||||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
|
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
|
||||||
$generic_product->load_stats_commande_fournisseur(0,'3',true);
|
$generic_product->load_stats_commande_fournisseur(0,'3');
|
||||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
||||||
} else {
|
} else {
|
||||||
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
|
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
|
||||||
@ -412,7 +416,7 @@ if ($resql)
|
|||||||
|
|
||||||
// warning late icon
|
// warning late icon
|
||||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||||
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
|
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_delivery)) < ($now - $conf->commande->client->warning_delay))
|
||||||
print img_picto($langs->trans("Late"),"warning");
|
print img_picto($langs->trans("Late"),"warning");
|
||||||
if(!empty($objp->note_private))
|
if(!empty($objp->note_private))
|
||||||
{
|
{
|
||||||
@ -463,7 +467,7 @@ if ($resql)
|
|||||||
|
|
||||||
// Delivery date
|
// Delivery date
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($objp->date_livraison), 'day');
|
print dol_print_date($db->jdate($objp->date_delivery), 'day');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Amount HT
|
// Amount HT
|
||||||
@ -500,7 +504,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -696,7 +696,7 @@ if (($action != 'create' && $action != 'add') || !$error)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -432,7 +432,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
|
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
|
||||||
$filtertype='';
|
$filtertype='';
|
||||||
print $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
|
$form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
|
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
|
||||||
print '<td><input type="text" class="flat" name="req_desc" value="'.$req_desc.'" size="24"></td>';
|
print '<td><input type="text" class="flat" name="req_desc" value="'.$req_desc.'" size="24"></td>';
|
||||||
|
|||||||
@ -250,7 +250,7 @@ if ($action == 'create')
|
|||||||
// Type
|
// Type
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
$formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
@ -547,7 +547,7 @@ else
|
|||||||
// Type
|
// Type
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
|
$formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
|
|||||||
@ -36,7 +36,12 @@ class Account extends CommonObject
|
|||||||
public $element='bank_account';
|
public $element='bank_account';
|
||||||
public $table_element='bank_account';
|
public $table_element='bank_account';
|
||||||
|
|
||||||
var $rowid; // deprecated
|
/**
|
||||||
|
* //TODO: Discuss this. $rowid is preferred over $id
|
||||||
|
* @var
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
var $rowid;
|
||||||
var $id;
|
var $id;
|
||||||
var $ref;
|
var $ref;
|
||||||
var $label;
|
var $label;
|
||||||
@ -220,7 +225,7 @@ class Account extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
||||||
*
|
*
|
||||||
* @param timestamp $date Date operation
|
* @param int $date Date operation
|
||||||
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
|
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
|
||||||
* @param string $label Descripton
|
* @param string $label Descripton
|
||||||
* @param float $amount Amount
|
* @param float $amount Amount
|
||||||
@ -1288,7 +1293,7 @@ class AccountLine extends CommonObject
|
|||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$this->db->query($sql);
|
||||||
|
|
||||||
// No error check. Can fail if category already affected
|
// No error check. Can fail if category already affected
|
||||||
}
|
}
|
||||||
|
|||||||
@ -300,6 +300,8 @@ class BankCateg // extends CommonObject
|
|||||||
|
|
||||||
$object=new BankCateg($this->db);
|
$object=new BankCateg($this->db);
|
||||||
|
|
||||||
|
$object->context['createfromclone'] = 'createfromclone';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
@ -327,6 +329,8 @@ class BankCateg // extends CommonObject
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($object->context['createfromclone']);
|
||||||
|
|
||||||
// End
|
// End
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -129,7 +129,7 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
|
|||||||
// Total
|
// Total
|
||||||
foreach ($total as $key=>$solde)
|
foreach ($total as $key=>$solde)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total ").$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
|
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -178,7 +178,7 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
|
|||||||
// Total
|
// Total
|
||||||
foreach ($total as $key=>$solde)
|
foreach ($total as $key=>$solde)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total ").$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
|
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -241,7 +241,7 @@ if (! $found)
|
|||||||
// Total
|
// Total
|
||||||
foreach ($total as $key=>$solde)
|
foreach ($total as $key=>$solde)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total ").$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
|
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|||||||
@ -384,7 +384,7 @@ if ($result)
|
|||||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||||
{
|
{
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $form->select_types_paiements($objp->fk_type,"value",'',2);
|
$form->select_types_paiements($objp->fk_type,"value",'',2);
|
||||||
print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
|
print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
|
||||||
if ($objp->receiptid)
|
if ($objp->receiptid)
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user