Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop_multi_warehouse
Fix Conflicts:
This commit is contained in:
commit
51b08f579b
19
.gitattributes
vendored
19
.gitattributes
vendored
@ -31,3 +31,22 @@
|
||||
*.frm binary
|
||||
*.MYD binary
|
||||
*.MYI binary
|
||||
|
||||
# Export ignores to generate clean production tarballs
|
||||
/build export-ignore
|
||||
/dev export-ignore
|
||||
/doc export-ignore
|
||||
/test export-ignore
|
||||
.buildpath export-ignore
|
||||
/build.xml export-ignore
|
||||
.codeclimate.yml export-ignore
|
||||
Dockerfile export-ignore
|
||||
.dockerignore export-ignore
|
||||
.editorconfig export-ignore
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.mailmap export-ignore
|
||||
.scrutinizer.yml export-ignore
|
||||
.settings export-ignore
|
||||
.travis.yml export-ignore
|
||||
.tx export-ignore
|
||||
|
||||
18
.travis.yml
18
.travis.yml
@ -113,6 +113,7 @@ before_script:
|
||||
echo Start travis
|
||||
echo Current dir is `pwd`
|
||||
echo Home dir is `echo ~`
|
||||
echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR
|
||||
|
||||
- |
|
||||
echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit"
|
||||
@ -154,7 +155,7 @@ before_script:
|
||||
mysql -e "SELECT VERSION();"
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
- |
|
||||
echo "Setting up database"
|
||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
|
||||
@ -171,8 +172,8 @@ before_script:
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Setting up Dolibarr"
|
||||
export CONF_FILE=htdocs/conf/conf.php
|
||||
echo "Setting up Dolibarr $CONF_FILE"
|
||||
echo '<?php ' > $CONF_FILE
|
||||
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
|
||||
@ -189,15 +190,9 @@ before_script:
|
||||
#fi
|
||||
# TODO: SQLite
|
||||
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
|
||||
cat $CONF_FILE
|
||||
echo
|
||||
|
||||
- |
|
||||
if [ "$DEBUG" = true ]; then
|
||||
echo "Debugging informations"
|
||||
cat $CONF_FILE
|
||||
echo
|
||||
fi
|
||||
|
||||
- |
|
||||
echo "Create documents directory and set permissions"
|
||||
# and admin/temp subdirectory needed for unit tests
|
||||
@ -274,12 +269,16 @@ script:
|
||||
cd htdocs/install
|
||||
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
|
||||
php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log
|
||||
php step5.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-3.log
|
||||
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
|
||||
php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log
|
||||
php step5.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-3.log
|
||||
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
|
||||
php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log
|
||||
php step5.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-3.log
|
||||
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log
|
||||
php upgrade2.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-2.log
|
||||
php step5.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-3.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
@ -311,3 +310,4 @@ after_failure:
|
||||
fi
|
||||
|
||||
after_script:
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ Feel free to express technical details, use cases or anything relevant to the cu
|
||||
|
||||
This section can span multiple lines.
|
||||
|
||||
Try to keep lines under 72 characters.
|
||||
Try to keep lines under 120 characters.
|
||||
|
||||
#### Samples
|
||||
<pre>
|
||||
|
||||
@ -14,7 +14,7 @@ Component Version License GPL Compatible
|
||||
PHP libraries:
|
||||
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
|
||||
ChromePHP 4.1.0 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.5.6 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||
Escpos-php MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||
FPDI 1.5.2 Apache Software License 2.0 Yes PDF templates management
|
||||
|
||||
227
ChangeLog
227
ChangeLog
@ -26,7 +26,6 @@ NEW: Add a tab "document" in donation card
|
||||
NEW: Add cancel button on thirdparty create page
|
||||
NEW: Add chart of product statistics
|
||||
NEW: Add color on categories
|
||||
NEW: Add css class and ids on column of detail lines to allow module to easily manipulate fields.
|
||||
NEW: Add date value filter on account records list
|
||||
NEW: Add __PROJECT_NAME__ tag for customer invoice emails
|
||||
NEW: Add option PDF_ALLOW_HTML_FOR_FREE_TEXT to be able to enter pdf footer text with wysiwyg editor.
|
||||
@ -36,99 +35,89 @@ NEW: Add filter on status on shipments
|
||||
NEW: Add gender property managed on user card FIX: Better error messages when uploading photo of user when permission to write are not granted
|
||||
NEW: Add help tooltips on fields of dictionary edit pages.
|
||||
NEW: Add hidden option MAIN_MAILFORM_DISABLE_ENTERKEY to disable the key enter into the form to send email.
|
||||
NEW: Add hook in send mail
|
||||
NEW: Add hooks on list of members to allow an external module to add more fields into list view.
|
||||
NEW: Add hooks to allow an external module to complete list of events into calendar views.
|
||||
NEW: Add $ID$ into extrafields management to allow use of current object id on filter for select list from table and checkbox list from table
|
||||
NEW: Add info page on product card
|
||||
NEW: Add into about page, a sample text to use to promote new version release (visible only if version is last stable)
|
||||
NEW: Add none/all selection into list of files for FTP browser module
|
||||
NEW: Add opportunity amount on project card.
|
||||
NEW: Add parameter to add a link to use "date of invoice" in one click when fille a payment card.
|
||||
NEW: Add link "date of invoice" to select date of invoice when creating a payment in one click.
|
||||
NEW: Add planned workload and declared progress on project summary list on project home page (data aggregated from tasks of project)
|
||||
NEW: Add "productpricecard" hook and uniformize code
|
||||
NEW: Add ref and label of project into export
|
||||
NEW: Add status into filters of graph
|
||||
NEW: Add tab document on salaries payment
|
||||
NEW: Add thumb of users into thumbs stats on home page
|
||||
NEW: A link to the bugtracker can be enabled in the GUI
|
||||
NEW: Add thumb of users into stats box on home page
|
||||
NEW: A link to the bugtracker report tool can be enabled in the GUI
|
||||
NEW: Better look for POS. More responsive design.
|
||||
NEW: Can add project search on left menu search area
|
||||
NEW: Can assign a task to yourself to have it appear on timesheet
|
||||
NEW: Can choose fields to show on project list
|
||||
NEW: Can assign a task to yourself to have it appear on timesheet.
|
||||
NEW: Can close a project that has draft status with no need to switch it to validate status before.
|
||||
NEW: Can edit Background color for Top menu and Background color for table title line.
|
||||
NEW: Can edit email template using WYSIWYG editor
|
||||
NEW: Can edit list of prospect status for customers/prospects. Add a new entry into dictionary table to manage list fo status. Removed deprecated files.
|
||||
NEW: Can edit email templates using WYSIWYG editor.
|
||||
NEW: Can edit list of prospect status for customers/prospects. Add a new entry into dictionary table to manage list fo status.
|
||||
NEW: Can filter on contact status in prospect list. Removed deprecated menu entry.
|
||||
NEW: Can filter proposal on a tag of a product Enhance also the prototype test_arrays to include select form before table.
|
||||
NEW: Can filter proposal on a tag of a product.
|
||||
NEW: Can filter proposal, orders or invoices with criteria "contain at least one product with following tag"
|
||||
NEW: Can select fields to show in product list. Extrafields are also supported.
|
||||
NEW: Can select fields to show into the contact list. Extrafields are also supported.
|
||||
NEW: Can select which field to show into list of users. Extrafields are also supported.
|
||||
NEW: Can set default value of event type when creating an event (if type of event option is used).
|
||||
NEW: Can choose fields to show on project list.
|
||||
NEW: Can choose fields to show in product list. Extrafields are also supported.
|
||||
NEW: Can choose fields to show into the contact list. Extrafields are also supported.
|
||||
NEW: Can choose fields to show into list of users. Extrafields are also supported.
|
||||
NEW: Can set default value of event type when creating an event (if option "manage type of event" is used).
|
||||
NEW: Can upload files on leave requests. Use more standard permissions.
|
||||
NEW: Can use a "|" to make a OR search on several different criterias into text filters of tables.
|
||||
NEW: Can use the * as a joker characters into search boxes of lists
|
||||
NEW: Clean code into salary module, debug and add indexes NEW: Can filter on user list and salary payments on user with naural search.
|
||||
NEW: clone action on agenda events
|
||||
NEW: Can use a "|" to make a OR search on several different criterias into search text filters of tables.
|
||||
NEW: Can use the * as a joker characters into search boxes of lists.
|
||||
NEW: Clean code into salary module, debug and add indexes
|
||||
NEW: Can filter on user list and salary payments on user with naural search.
|
||||
NEW: Can clone agenda events.
|
||||
NEW: Color category is visible onto the thumb of tags on thirdparty, or products cards.
|
||||
NEW: conf to use next product/service ref when we clone a product/service
|
||||
NEW: Conf to use next product/service ref when we clone a product/service
|
||||
NEW: Contract module can be used to follow both sold and bought contracts/recurring subscriptions.
|
||||
NEW: Enhance prototype, project list and proposal list with new hooks to have an external module able to add more fields.
|
||||
NEW: Enhance style engine. Add option to set color of links.
|
||||
NEW: Enter amount for withdraws requests
|
||||
NEW: Can change amount when creating withdraws requests.
|
||||
NEW: FEATURE PROPOSAL: on proposal, order or invoice creation from scratch, reload page after customer selection so its informations can be loaded
|
||||
NEW: Filter "active" by default on user list. Fix label of permission of project module.
|
||||
NEW: Forms are using the tab look, even in creation mode.
|
||||
NEW: Forms are using the "tab look", even in creation mode.
|
||||
NEW: Free text for cheque deposit receipt can be HTML content.
|
||||
NEW: Hidden option THEME_ELDY_USE_HOVER is stable enough to become officialy visible into setup.
|
||||
NEW: If module salaries is on, you can set a hourly value for time consumed by users. Each time a user enter its time consumed on a project, a calculation is done to provide the cost for human services. This value appears into the "Transversal view" of project.
|
||||
NEW: Import Sales representatives of third parties
|
||||
NEW: If module salaries is on, you can set a hourly value for time consumed by users. When a user enter its time consumed on a project, a calculation is done to provide the cost for human services. This value appears into the "Overview" of project.
|
||||
NEW: Add import profile to import sales representatives of third parties.
|
||||
NEW: Increase length of bank code to 128 char #3704
|
||||
NEW: info function for product card
|
||||
NEW: Into the overview of projects, the name of thirdparty appears into combo lists of elements to link to project.
|
||||
NEW: Introduce a "code" into fiels to describe vat. This will allow to suggest different vat lines with same value with ability to differentiate them.
|
||||
NEW: Introduce cost price on product.
|
||||
NEW: Introduce a "code" into table of vats to describe VAT. This will allow to suggest different vat lines with same value with ability to differentiate them.
|
||||
NEW: Introduce cost price on products.
|
||||
NEW: Introduce hidden option MAIN_LANDING_PAGE to decide the home page visible just after login.
|
||||
NEW: Introduce hidden option MAIN_REPLACE_TRANS_xx_XX to allow simple replacement of translated string on the fly.
|
||||
NEW: Introduce hidden option MAIN_REPLACE_TRANS_xx_XX to allow simple replacement of translated string on the fly. Prefer to use next method.
|
||||
NEW: Introduce table llx_overwrite_trans to be able to overwrite translations by simple database edition.
|
||||
NEW: Introduce use of cache for thumbs images of users
|
||||
NEW: Experimental level multiprice generator based on per cent variations over base price
|
||||
NEW: List of projects of a thirdparty are visible on a project tab
|
||||
NEW: Introduce use of cache for thumbs images of users to save bandwith.
|
||||
NEW: Experimental level multiprice generator based on per cent variations over base price.
|
||||
NEW: List of projects of a thirdparty are visible on a project tab for the thirdparty.
|
||||
NEW: Merge all left menu search boxes into one.
|
||||
NEW: Merge all search fields of an area page into one search box
|
||||
NEW: next ref on clone doesn't need conf, it's used if mask exists
|
||||
NEW: ODT generators can set meta properties of ODT file
|
||||
NEW: On list of thirdparties, user can select fields to show. Make phpunit test working again localy. Add missing columns into llx_expedition.
|
||||
NEW: Only arrow of current sorted field is visible into table views. This save a lot of spaces. You can click on the column title to sort. This make clickable area larger and click to sort is easier.
|
||||
NEW: Merge all search fields of an area page into one search box.
|
||||
NEW: Next ref on clone doesn't need conf, it's used if mask exists.
|
||||
NEW: Only arrow of current sorted field is visible into table views. This save a lot of space. You can click on the column title to sort. This make clickable area larger and click to sort is easier.
|
||||
NEW: On page to see/edit contact of an ojbect, the status of contact is visible (for both external and internal users).
|
||||
NEW: Option encrypt password into databae is set to on by default on first install.
|
||||
NEW: print event type on third party card tab agenda list (only if AGENDA_USE_EVENT_TYPE = 1)
|
||||
NEW: Option "encrypt password" into database is set to on by default on first install.
|
||||
NEW: Print event type on third party card tab agenda list (only if AGENDA_USE_EVENT_TYPE = 1)
|
||||
NEW: Provide an easier way to understand if an order can be shipped.
|
||||
NEW: Quick searh filter works on invoice, proposal, order, intervention, contract
|
||||
NEW: Rename install "etape" into english "step"
|
||||
NEW: Quick search filter works also on invoice, proposal, order, intervention, contract and expense reports.
|
||||
NEW: Replace category edition page on members with new select2 component.
|
||||
NEW: Show photo of logged user into login top right block. NEW: If no photo is available for user, we show a generic photo depending on gender
|
||||
NEW: Show photo of user into user list. A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith.
|
||||
NEW: Show which fields are used for search when doing a generic search from the quick search form.
|
||||
NEW: Show photo of logged user into login top right block.
|
||||
NEW: If no photo is available for user, we show a generic photo depending on gender.
|
||||
NEW: Show photo of user into user list.
|
||||
NEW: Show which fields were used for search when doing a "generic search" from the "quick search" form on left menu.
|
||||
NEW: Statistic graphs on products offer a filter on product type (product / service or both)
|
||||
NEW: Support logging to a Sentry server
|
||||
NEW: Syslog displays configuration errors
|
||||
NEW: The clicktodial module is now able to provide link "tel:" on phone numbers. So it is also possible to use clicktodial with a client solution like the "xivo" local client.
|
||||
NEW: The conditional IF into ODT templates works also on not defined var so we can show data only if defined. Close #3819
|
||||
NEW: The free text in PDF footer can now be a HTML content. So the WYSIWYG editor is on by default to edit it into module setup.
|
||||
NEW: The quick search box on left menu can also search into expense reports.
|
||||
NEW: The search box and the bookmarks are now rendered by the menu manager.
|
||||
NEW: The thirdparties tabs, the contacts tabs and the members tabs are now presented using a new top banner, saving space and using a same way to show address, status and navigation arrows.
|
||||
NEW: The free text in PDF footers can now be a HTML content. So the WYSIWYG editor is on by default to edit it into module setup.
|
||||
NEW: The thirdparties tabs, the contacts tabs and the members tabs are now presented using a new "top banner", saving space and using a same way to show address, status and navigation arrows.
|
||||
NEW: Thumbs for statistics on main page are fully clicable (not only link inside the thumb)
|
||||
NEW: Translate extrafield's labels
|
||||
NEW: Uniformize way of working for search filters. One filter per object.
|
||||
NEW: Used matching icons for Material Design theme
|
||||
NEW: Translate extrafield's labels.
|
||||
NEW: Use new select2 component for juridical status, country and state selection.
|
||||
NEW: When creating order, proposal or invoice from thirdparty card, the project is asked during creation. A link to create project if it does not exists is also available. NEW: Uniformize form creation of proposal to add public and private notes during creation like done for order and invoice.
|
||||
NEW: When creating order, proposal or invoice from thirdparty card, the project is asked during creation. A link to create project if it does not exists is also available.
|
||||
NEW: Uniformize form creation of proposal to add public and private notes during creation like for order and invoice.
|
||||
NEW: More robust antiXSS engine.
|
||||
|
||||
For developers:
|
||||
NEW: The search box and the bookmarks are now rendered by the menu manager.
|
||||
NEW: Add a new widget $form->selectArrayAjax() to use combo list with content coming from an Ajax URL.
|
||||
NEW: Add doActions hook method call in contract card
|
||||
NEW: Added doActions hooks to user cards
|
||||
@ -144,10 +133,26 @@ NEW: A module can add its entries into cron module.
|
||||
NEW: Framework feature. To have a page being loaded at same scrollbar level after a click on a href link, just add the class "reposition" on this link.
|
||||
NEW: Add exemple of setup for multitail to render dolibarr log files
|
||||
NEW: Add restler framework. First step to build REST API into Dolibarr.
|
||||
|
||||
NEW: Add css class and ids on column of detail lines to allow module to easily manipulate fields.
|
||||
NEW: Add hook in send mail
|
||||
NEW: Add hooks on list of members to allow an external module to add more fields into list view.
|
||||
NEW: Add hooks to allow an external module to complete list of events into calendar views.
|
||||
NEW: Add "productpricecard" hook and uniformize code
|
||||
NEW: Enhance also the prototype test_arrays to include select form before table.
|
||||
NEW: Enhance prototype, project list and proposal list with new hooks to have an external module able to add more fields.
|
||||
NEW: Enhance style engine. Add option to set color of links.
|
||||
NEW: ODT generators can now also set meta properties of ODT file.
|
||||
NEW: Add missing columns into llx_expedition to match other tables.
|
||||
NEW: A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith.
|
||||
NEW: Support logging to a Sentry server
|
||||
NEW: Prepare database to have agenda able to store more detailed emails events.
|
||||
|
||||
WARNING:
|
||||
|
||||
Dolibarr 3.9 is not yet fully compatible with PHP 7 even if most features seems to work.
|
||||
|
||||
Mysql minimum version is now 5.0.3
|
||||
|
||||
Following changes may create regression for some external modules, but were necessary to make
|
||||
Dolibarr better:
|
||||
- Deprecated Product::setPriceExpression. Use Product::update instead
|
||||
@ -165,6 +170,84 @@ This is list of hooks modified:
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.8.3 compared to 3.8.2 *****
|
||||
FIX: #3805
|
||||
FIX: #3231 [Members] Public subscription page displays GeoIP error
|
||||
FIX: #3240
|
||||
FIX: #3293 Login page form icons not shown
|
||||
FIX: #3508 Useless tooltip in 3.8 boxes
|
||||
FIX: #3661 Margin is not selected correctly when adding a product
|
||||
FIX: #3679 Error when deleting a Localtax2 special payment
|
||||
FIX: #3707 Thirdparty bank account page table has a glitch
|
||||
FIX: #3726 When upload file, don't test if PRODUCT_USE_OLD_PATH_FOR_PHOTO variable is empty or not
|
||||
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
|
||||
FIX: #3836 Unable to upload a document to an invoice under some circunstances
|
||||
FIX: #3878 Storing and deleting files on emailing was done at wrong place
|
||||
FIX: #3880
|
||||
FIX: #3882
|
||||
FIX: #3890 Expected transactions bank account page, shows negative numbers
|
||||
FIX: #3912
|
||||
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
|
||||
FIX: #3953 Don't round supplier price
|
||||
FIX: #3953 rounding of buying price
|
||||
FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
|
||||
FIX: #3987 Undefined variable $newref in CommandeFournisseur::approve
|
||||
FIX: #3988 Undefined variable $conf and $error in CommandeFournisseur::addline
|
||||
FIX: #3989 Undefined variable $conf in CommandeFournisseur::getNomUrl
|
||||
FIX: #3990
|
||||
FIX: #3992 CommandeFournisseur::ref is marked as deprecated and it shouldn't be
|
||||
FIX: #3996 Dictionnary hooks are not working in 3.8
|
||||
FIX: #3997 Wrong permission key used for Margins > Read all
|
||||
FIX: #4016 User link is not correctly formed in emailing receivers
|
||||
FIX: #4018 SQL error if trying to access the mailing/card.php page without an ID defined
|
||||
FIX: #4036 Direct printing module without any driver configured, shows an unformatted error message
|
||||
FIX: #4043 Incorrect translation in error mesage in menu creation admin page
|
||||
FIX: #4049 PHP warning when trying to access a non-existing product/service
|
||||
FIX: #4055 SQL error when trying to access a non-existing expedition
|
||||
FIX: #4081 Added missing translation
|
||||
FIX: #4097 Public holiday calculation
|
||||
FIX: #4182 SQL error when deleting an unexisting bank entry
|
||||
FIX: #4242 Allow disabling dashes in documents
|
||||
FIX: #4243 sql injection
|
||||
FIX: #4281
|
||||
FIX: #4282 Defined shipping time were not shown in Customer order's PDF documents
|
||||
FIX: #4285 SQL query shown when accessing an unexisting invoice
|
||||
FIX: #4287 SQL error when accessing an unexisting proposal
|
||||
FIX: #4302 Undefined variable $conf in Commande::LibStatut
|
||||
FIX: Allow to search on alias name into select
|
||||
FIX: Add a protection to not make release if ChangeLog was not generated.
|
||||
FIX: autofocus on input search product
|
||||
FIX: bad calculation for stock value
|
||||
FIX: Better compatibility for users that used the not supported option MAIN_USE_JQUERY_MULTISELECT set to 1.
|
||||
FIX: Bug: $this is not accessible in static context in Mailing::libStatutDest #4050
|
||||
FIX: can not have access to the new ids or propal lines on PROPAL_CLONE
|
||||
FIX: Can't update line's duration
|
||||
FIX: Can use formated float number on old expense report module.
|
||||
FIX: change object statut on close shipping and remove erratic db commit
|
||||
FIX: change order date on clone (as everywhere else)
|
||||
FIX: event's data lost on user assign update
|
||||
FIX: export propal and order with extrafields
|
||||
FIX: export with category contact extrafields
|
||||
FIX: jquery select of project generate js error on change event
|
||||
FIX: label of line is set in description field if empty
|
||||
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
|
||||
FIX: mail isn't display in title on event in mode view
|
||||
FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
|
||||
FIX: NB task and percent progress in box project
|
||||
FIX: Not delete a product when have customer price
|
||||
FIX: Not deleting contrats on element_element table
|
||||
FIX: Not use localtaxes when invoice some orders
|
||||
FIX: only active customer should be available into select list thirdparty on invoice creation
|
||||
FIX: only active customer should be return into new invoice creation select list
|
||||
FIX: AWP calculation
|
||||
FIX: product link in project box
|
||||
FIX: Remove column creation for table llx_product_fournisseur_price, the column use un calss is fk_supplier_price_expression, and fk_price_expression does not exist into lx_product_fournisseur_price sql file declaration
|
||||
FIX: Show category selector if we have permission to view products or services
|
||||
FIX: showrefnav htmlspecialchar instead of < >
|
||||
FIX: The label hidden was not supported when using jmobile
|
||||
FIX: Too many information were hidden. A lot of users still need bank account on PDF.
|
||||
FIX: Use "WHERE true" instead of "WHERE 1" #4132
|
||||
|
||||
***** ChangeLog for 3.8.2 compared to 3.8.1 *****
|
||||
FIX: Add a protection to not make release if ChangeLog was not generated.
|
||||
FIX: 1/ update_extra() function must not be in "if(!empty(MAIN_DISABLE_CONTACTS_TAB)" test. 2/ Reindented code
|
||||
@ -509,6 +592,25 @@ Dolibarr better:
|
||||
- Function get_exdir require now 6 parameters. This is to prepare a future feature.
|
||||
|
||||
|
||||
***** ChangeLog for 3.7.3 compared to 3.7.2 *****
|
||||
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
|
||||
FIX: #3890 Expected transactions bank account page, shows negative numbers
|
||||
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
|
||||
FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
|
||||
FIX: #4081 Added missing translation
|
||||
FIX: #4097 Public holiday calculation
|
||||
FIX: #4242 Allow disabling dashes in documents
|
||||
FIX: #4243 sql injection
|
||||
FIX: Can use formated float number on old expense report module.
|
||||
FIX: Change object statut when closing shipment and remove erratic db commit
|
||||
FIX: Export with category contact extrafields
|
||||
FIX: NB task and percent progress in box project
|
||||
FIX: Not delete a product when have customer price
|
||||
FIX: Not deleting contrats on element_element table
|
||||
FIX: Not use localtaxes when invoice some orders
|
||||
FIX: Product link in project box
|
||||
FIX: Use "WHERE true" instead of "WHERE 1" #4132
|
||||
|
||||
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
|
||||
FIX: #2957 : missing $langs object for trigger
|
||||
FIX: #2983 Load gravatar avatar images securely over HTTPS
|
||||
@ -822,6 +924,17 @@ Dolibarr better:
|
||||
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
|
||||
|
||||
|
||||
***** ChangeLog for 3.6.6 compared to 3.6.5 *****
|
||||
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
|
||||
FIX: #4081 Added missing translation
|
||||
FIX: #4097 Public holiday calculation
|
||||
FIX: #4242 Allow disabling dashes in documents
|
||||
FIX: #4243 sql injection
|
||||
FIX: Add a protection to not make release if ChangeLog was not generated. Prepare package 3.6.5
|
||||
FIX: export with category contact extrafields
|
||||
FIX: Not delete a product when have customer price
|
||||
FIX: Not deleting contrats on element_element table
|
||||
|
||||
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
|
||||
FIX: #2957 : missing $langs object for trigger
|
||||
FIX: #2983 Load gravatar avatar images securely over HTTPS
|
||||
|
||||
@ -495,6 +495,8 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
||||
@ -505,7 +507,10 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||
# Removed other test files
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`; # This is a dev tool
|
||||
|
||||
@ -16,13 +16,19 @@
|
||||
"php": ">=5.3.0",
|
||||
"ext-curl": "*",
|
||||
"ccampbell/chromephp": "^4.1",
|
||||
"ckeditor/ckeditor": "dev-full/4.3.x#0b7c3f1",
|
||||
"ckeditor/ckeditor": "dev-full/stable",
|
||||
"mike42/escpos-php": "dev-master",
|
||||
"mobiledetect/mobiledetectlib": "2.8.17",
|
||||
"phpoffice/phpexcel": "1.8.1",
|
||||
"restler/framework": "^3.0",
|
||||
"tecnickcom/tcpdf": "6.2.12"
|
||||
},
|
||||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "^0",
|
||||
"jakub-onderka/php-console-highlighter": "^0",
|
||||
"phpunit/phpunit": "^4",
|
||||
"squizlabs/php_codesniffer": "^2"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mysqlnd": "To use with MySQL or MariaDB",
|
||||
"ext-mysqli": "To use with MySQL or MariaDB",
|
||||
|
||||
1128
composer.lock
generated
1128
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -124,7 +124,7 @@
|
||||
<!-- Tweaks to metrics -->
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="complexity" value="80" />
|
||||
<property name="complexity" value="120" />
|
||||
<property name="absoluteComplexity" value="250" />
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
@ -62,6 +62,13 @@ In htdocs/includes/tcpdf/tcpdf.php
|
||||
* Renamed getmypid into dol_getmypid().
|
||||
|
||||
|
||||
To avoid to have QRcode changed because generated with a random mask, replace
|
||||
define('QR_FIND_FROM_RANDOM', 2);
|
||||
with
|
||||
define('QR_FIND_FROM_RANDOM', false);
|
||||
|
||||
|
||||
|
||||
TCPDI:
|
||||
------
|
||||
Add fpdf_tpl.php 1.2
|
||||
|
||||
3
htdocs/.gitignore
vendored
3
htdocs/.gitignore
vendored
@ -20,4 +20,5 @@
|
||||
/allscreens*
|
||||
/ecommerce/
|
||||
/cabinetmed*
|
||||
/conf/conf.php
|
||||
/conf/conf.php
|
||||
/webmail*
|
||||
|
||||
@ -49,7 +49,7 @@ if (!$user->admin)
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'sortorder');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == - 1) {
|
||||
$page = 0;
|
||||
|
||||
@ -148,14 +148,14 @@ if ($action == 'create')
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
|
||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent');
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
@ -204,13 +204,13 @@ else if ($id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent');
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -31,8 +31,9 @@
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
@ -51,7 +52,10 @@ $list = array (
|
||||
'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
|
||||
'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
||||
'ACCOUNTING_LENGTH_GACCOUNT',
|
||||
'ACCOUNTING_LENGTH_AACCOUNT',
|
||||
'ACCOUNTING_LENGTH_AACCOUNT'
|
||||
);
|
||||
|
||||
$list_account = array (
|
||||
'ACCOUNTING_ACCOUNT_CUSTOMER',
|
||||
'ACCOUNTING_ACCOUNT_SUPPLIER',
|
||||
'ACCOUNTING_PRODUCT_BUY_ACCOUNT',
|
||||
@ -109,6 +113,14 @@ if ($action == 'update')
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($list_account as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
@ -151,6 +163,7 @@ if ($action == 'setlistsortdone') {
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccountancy = New FormVentilation($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup');
|
||||
@ -262,6 +275,22 @@ foreach ($list as $key)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
foreach ($list_account as $key)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
print '<tr '.$bc[$var].' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td><label for="'.$key.'">'.$label.'</label></td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
|
||||
@ -22,17 +22,18 @@
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/productaccount.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief Onglet de gestion de parametrages des ventilations
|
||||
* \brief To define accounting account on product / service
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("companies");
|
||||
@ -40,6 +41,10 @@ $langs->load("compta");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (empty($conf->accounting->enabled)) accessforbidden();
|
||||
|
||||
// search & action GETPOST
|
||||
$action = GETPOST('action');
|
||||
$codeventil_buy = GETPOST('codeventil_buy', 'array');
|
||||
@ -67,10 +72,8 @@ $pagenext = $page + 1;
|
||||
// bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed !
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
// } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
// $limit = $conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -79,7 +82,7 @@ if (! $sortfield)
|
||||
if (! $sortorder)
|
||||
$sortorder = "ASC";
|
||||
|
||||
// sales or purchase
|
||||
// Sales or Purchase mode ?
|
||||
if ($action == 'update') {
|
||||
if (! empty($btn_changetype)) {
|
||||
$error = 0;
|
||||
@ -128,12 +131,12 @@ if ($action == 'update') {
|
||||
$sql .= " SET accountancy_code_sell = " . $accounting->account_number;
|
||||
}
|
||||
$sql .= " WHERE rowid = " . $productid;
|
||||
|
||||
|
||||
dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
|
||||
$msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '</font></div>';
|
||||
} else {
|
||||
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $accounting->account_number . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,13 +150,6 @@ if ($action == 'update') {
|
||||
}
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
// TODO after adding menu
|
||||
// if (! $user->rights->accounting->ventilation->dispatch)
|
||||
// accessforbidden();
|
||||
|
||||
$form = new FormVentilation($db);
|
||||
|
||||
// Defaut AccountingAccount RowId Product / Service
|
||||
@ -179,13 +175,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_desc = '';
|
||||
}
|
||||
|
||||
// debug move header to top
|
||||
llxHeader('', $langs->trans("Accounts"));
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("Accounts"));
|
||||
|
||||
print '<script type="text/javascript">
|
||||
$(function () {
|
||||
$(\'#select-all\').click(function(event) {
|
||||
@ -209,7 +204,7 @@ $sql .= " WHERE (";
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
||||
$sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
|
||||
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
|
||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||
@ -241,28 +236,29 @@ if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
|
||||
print load_fiche_titre($langs->trans("InitAccountancy"),'','title_setup');
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("InitAccountancyDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
print '<td>' . $langs->trans('Options') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr ' . $bc[false] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_sell') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSell'));
|
||||
print '<tr ' . $bc[false] . '><td width="25%"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductSell') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSellDesc'));
|
||||
print "</td></tr>\n";
|
||||
print '<tr ' . $bc[true] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_buy') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuy')) . "</td></tr>\n";
|
||||
print '<tr ' . $bc[true] . '><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductBuy') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuyDesc')) . "</td></tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
|
||||
print '<br /><div align="right"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
@ -270,33 +266,29 @@ if ($result) {
|
||||
print $msg;
|
||||
}
|
||||
|
||||
// print '<td align="left"><b>' . $langs->trans("DescProductAccountingAccount") . '</b></td> ';
|
||||
// print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "p.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print ' ';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
/*
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_buy") . '</td>';
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>';
|
||||
print_liste_field_titre($langs->trans("Accountancy_code_buy"));
|
||||
} else {
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
|
||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
|
||||
print_liste_field_titre($langs->trans("Accountancy_code_sell"));
|
||||
}
|
||||
// print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>');
|
||||
*/
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"));
|
||||
print_liste_field_titre($langs->trans("Modify") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>','','','','','align="center"');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
|
||||
|
||||
print '<td class="liste_titre" colspan="2"> </td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<td class=liste_titre"> </td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
@ -349,13 +341,13 @@ if ($result) {
|
||||
// TODO ADJUST DESCRIPTION SIZE
|
||||
// print '<td align="left">' . $obj->description . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64;
|
||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
|
||||
// acountingaccount buy
|
||||
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
|
||||
// Accounting account buy
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY')
|
||||
{
|
||||
// print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
|
||||
// TODO: replace by select
|
||||
// print '<td align="left">' . $compta_prodbuy . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
@ -363,10 +355,11 @@ if ($result) {
|
||||
print '<td align="left">';
|
||||
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
|
||||
print '</td>';
|
||||
} else {
|
||||
|
||||
// acountingaccount sel
|
||||
print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Accounting account sell
|
||||
// print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
|
||||
// TODO: replace by select
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||
@ -383,7 +376,7 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
print '</table>';
|
||||
print '<br><div align="center"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Change_Account") . '"></div>';
|
||||
print '<br><div align="right"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Validate") . '"></div>';
|
||||
print '</form>';
|
||||
|
||||
$db->free($result);
|
||||
|
||||
@ -27,6 +27,7 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@ -41,12 +42,24 @@ $piece_num = GETPOST("piece_num");
|
||||
|
||||
$mesg = '';
|
||||
|
||||
$numero_compte = GETPOST('numero_compte');
|
||||
$account_number = GETPOST('account_number');
|
||||
$code_tiers = GETPOST('code_tiers');
|
||||
if ($code_tiers==-1) {
|
||||
$code_tiers=null;
|
||||
}
|
||||
$label_compte = GETPOST('label_compte');
|
||||
$debit = price2num(GETPOST('debit'));
|
||||
$credit = price2num(GETPOST('credit'));
|
||||
|
||||
$save=GETPOST('save');
|
||||
if (!empty($save)) {
|
||||
$action='add';
|
||||
}
|
||||
$update=GETPOST('update');
|
||||
if (!empty($update)) {
|
||||
$action='confirm_update';
|
||||
}
|
||||
|
||||
if ($action == "confirm_update") {
|
||||
|
||||
$error = 0;
|
||||
@ -63,7 +76,7 @@ if ($action == "confirm_update") {
|
||||
if ($result < 0) {
|
||||
setEventMessages($book->error, $book->errors, 'errors');
|
||||
} else {
|
||||
$book->numero_compte = $numero_compte;
|
||||
$book->numero_compte = $account_number;
|
||||
$book->code_tiers = $code_tiers;
|
||||
$book->label_compte = $label_compte;
|
||||
$book->debit = $debit;
|
||||
@ -92,15 +105,15 @@ if ($action == "confirm_update") {
|
||||
else if ($action == "add") {
|
||||
$error = 0;
|
||||
|
||||
if ((intval($debit) != 0) && (intval($credit) != 0)) {
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$book = new BookKeeping($db);
|
||||
|
||||
$book->numero_compte = $numero_compte;
|
||||
$book->numero_compte = $account_number;
|
||||
$book->code_tiers = $code_tiers;
|
||||
$book->label_compte = $label_compte;
|
||||
$book->debit = $debit;
|
||||
@ -113,11 +126,12 @@ else if ($action == "add") {
|
||||
$book->fk_doc = GETPOST('fk_doc');
|
||||
$book->fk_docdet = GETPOST('fk_docdet');
|
||||
|
||||
if (! empty($debit)) {
|
||||
if (floatval($debit) != 0.0) {
|
||||
$book->montant = $debit;
|
||||
$book->sens = 'D';
|
||||
}
|
||||
if (! empty($credit)) {
|
||||
|
||||
if (floatval($credit) != 0.0) {
|
||||
$book->montant = $credit;
|
||||
$book->sens = 'C';
|
||||
}
|
||||
@ -179,6 +193,7 @@ else if ($action == "confirm_create") {
|
||||
llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
/*
|
||||
* Confirmation to delete the command
|
||||
@ -198,6 +213,18 @@ if ($action == 'create') {
|
||||
$conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL => $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL,
|
||||
$conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL => $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL
|
||||
);
|
||||
|
||||
$sql = 'SELECT DISTINCT accountancy_journal FROM '.MAIN_DB_PREFIX.'bank_account WHERE clos=0';
|
||||
$resql=$db->query($sql);
|
||||
if (!$resql) {
|
||||
setEventMessages($db->lasterror,null,'errors');
|
||||
} else {
|
||||
while ($obj_bank=$db->fetch_object($resql)) {
|
||||
if (!empty($obj_bank->accountancy_journal)) {
|
||||
$code_journal_array[$obj_bank->accountancy_journal]=$obj_bank->accountancy_journal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$book = new BookKeeping($db);
|
||||
$next_num_mvt = $book->getNextNumMvt();
|
||||
@ -281,9 +308,21 @@ if ($action == 'create') {
|
||||
} else {
|
||||
|
||||
print load_fiche_titre($langs->trans("ListeMvts"));
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_type" value="' . $book->doc_type . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_ref" value="' . $book->doc_ref . '">' . "\n";
|
||||
print '<input type="hidden" name="code_journal" value="' . $book->code_journal . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
if (count($book->linesmvt) > 0) {
|
||||
|
||||
$total_debit=0;
|
||||
$total_credit=0;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Numerocompte"));
|
||||
@ -301,21 +340,26 @@ if ($action == 'create') {
|
||||
$var = ! $var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
$total_debit+=$line->debit;
|
||||
$total_credit+=$line->credit;
|
||||
|
||||
if ($action == 'update' && $line->id == $id) {
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
|
||||
print '<input type="hidden" name="action" value="confirm_update">' . "\n";
|
||||
print '<td><input type="text" size="6" name="numero_compte" value="' . $line->numero_compte . '"/></td>';
|
||||
print '<td><input type="text" size="15" name="code_tiers" value="' . $line->code_tiers . '"/></td>';
|
||||
|
||||
print '<td>';
|
||||
print $formventilation->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1,'');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_auxaccount($line->code_tiers, 'code_tiers',1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="debit" value="' . price($line->debit) . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>';
|
||||
print '<td>' . $line->montant . '</td>';
|
||||
print '<td>' . $line->sens . '</td>';
|
||||
print '<td>';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">';
|
||||
print '</form>';
|
||||
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
|
||||
print '<input type="submit" class="button" name="update" value="' . $langs->trans("Update") . '">';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td>' . $line->numero_compte . '</td>';
|
||||
@ -327,10 +371,10 @@ if ($action == 'create') {
|
||||
print '<td>' . $line->sens . '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_edit();
|
||||
print '</a> ';
|
||||
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
||||
@ -339,34 +383,32 @@ if ($action == 'create') {
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($total_debit!=$total_credit) {
|
||||
setEventMessages(null, array('MvtNotCorrectlyBalanced',$total_credit,$total_debit),'errors');
|
||||
}
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
$var = ! $var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="action" value="add">' . "\n";
|
||||
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_type" value="' . $book->doc_type . '">' . "\n";
|
||||
print '<input type="hidden" name="doc_ref" value="' . $book->doc_ref . '">' . "\n";
|
||||
print '<input type="hidden" name="code_journal" value="' . $book->code_journal . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
||||
print '<td><input type="text" size="6" name="numero_compte" value="' . $numero_compte . '"/></td>';
|
||||
print '<td><input type="text" size="15" name="code_tiers" value="' . $code_tiers . '"/></td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_auxaccount($code_tiers, 'code_tiers',1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $label_compte . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="debit" value="' . price($debit) . '"/></td>';
|
||||
print '<td><input type="text" size="6" name="credit" value="' . price($credit) . '"/></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print load_fiche_titre($langs->trans("NoRecords"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,18 +19,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/list.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief List operation of book keeping
|
||||
* \file htdocs/accountancy/bookkeeping/list.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief List operation of book keeping
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@ -44,7 +43,7 @@ $search_doc_ref = GETPOST("search_doc_ref");
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_thirdparty = GETPOST("search_thirdparty");
|
||||
$search_journal = GETPOST("search_journal");
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
if ($sortorder == "")
|
||||
$sortorder = "ASC";
|
||||
@ -58,11 +57,11 @@ $formother = new FormOther($db);
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_doc_type="";
|
||||
$search_doc_ref="";
|
||||
$search_account="";
|
||||
$search_thirdparty="";
|
||||
$search_journal="";
|
||||
$search_piece_num = "";
|
||||
$search_doc_ref = "";
|
||||
$search_account = "";
|
||||
$search_thirdparty = "";
|
||||
$search_journal = "";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -80,8 +79,7 @@ if ($action == 'delbookkeeping') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'delbookkeepingyear') {
|
||||
} elseif ($action == 'delbookkeepingyear') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
|
||||
@ -93,8 +91,7 @@ elseif ($action == 'delbookkeepingyear') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'delbookkeepingyear') {
|
||||
} elseif ($action == 'delbookkeepingyear') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
|
||||
@ -106,7 +103,7 @@ elseif ($action == 'delbookkeepingyear') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}// Export
|
||||
} // Export
|
||||
else if ($action == 'export_csv') {
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
@ -118,19 +115,55 @@ else if ($action == 'export_csv') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print $line->id . ',';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->montant . '",';
|
||||
print '"' . $line->sens . '",';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
// Model classic Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
|
||||
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->debit . '",';
|
||||
print '"' . $line->credit . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
// Model cegid Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) {
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print $line->id . ',';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->montant . '",';
|
||||
print '"' . $line->sens . '",';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
// Model Coala Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 3) {
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
print $line->id . ',';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $line->code_journal . '",';
|
||||
print '"' . $line->numero_compte . '",';
|
||||
print '"' . substr($line->code_journal, 0, 2) . '",';
|
||||
print '"' . substr($line->doc_ref, 0, 40) . '",';
|
||||
print '"' . $line->num_piece . '",';
|
||||
print '"' . $line->montant . '",';
|
||||
print '"' . $line->sens . '",';
|
||||
print '"' . dol_print_date($line->doc_date, '%d%m%Y') . '",';
|
||||
print '"' . $conf->currency . '",';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,16 +171,16 @@ else {
|
||||
|
||||
llxHeader('', $langs->trans("Bookkeeping"));
|
||||
|
||||
/*
|
||||
* List
|
||||
*/
|
||||
/*
|
||||
* List
|
||||
*/
|
||||
|
||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
|
||||
|
||||
if (dol_strlen(trim($search_doc_type))) {
|
||||
|
||||
$sql .= " WHERE bk.doc_type LIKE '%" . $search_doc_type . "%'";
|
||||
$sql .= " WHERE bk.piece_num LIKE '%" . $search_piece_num . "%'";
|
||||
|
||||
if (dol_strlen(trim($search_doc_ref))) {
|
||||
$sql .= " AND bk.doc_ref LIKE '%" . $search_doc_ref . "%'";
|
||||
@ -177,20 +210,20 @@ else {
|
||||
print_barre_liste($langs->trans("Bookkeeping"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num);
|
||||
|
||||
/*print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeeping">';
|
||||
|
||||
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
print '</form>';*/
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeeping">';
|
||||
|
||||
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
print '</form>';*/
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeepingyear">';
|
||||
|
||||
print $formother->select_year(GETPOST('delyear'),'delyear');
|
||||
print $formother->select_year(GETPOST('delyear'), 'delyear');
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
@ -204,7 +237,7 @@ else {
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "bk.doc_type", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("NumPiece"), $_SERVER['PHP_SELF'], "bk.piece_num", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "bk.doc_date", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "bk.doc_ref", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder);
|
||||
@ -215,12 +248,12 @@ else {
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
print '<td><input type="text" name="search_doc_type" size="8" value="' . $search_doc_type . '"></td>';
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
||||
print '<td><input type="text" name="search_doc_type" size="8" value="' . $search_piece_num . '"></td>';
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
||||
print '<td><input type="text" name="search_account" size="8" value="' . $search_account . '"></td>';
|
||||
@ -232,9 +265,9 @@ else {
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_journal" size="3" value="' . $search_journal . '"></td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</td>';
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
@ -247,7 +280,16 @@ else {
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td>' . $obj->doc_type . '</td>';
|
||||
/* if ($old_piecenum!=$obj->piece_num) {
|
||||
$total_debit=0;
|
||||
$total_credit=0;
|
||||
} else {
|
||||
$total_debit+=$obj->debit;
|
||||
$total_credit+=$obj->credit;
|
||||
}
|
||||
*/
|
||||
|
||||
print '<td>' . $obj->piece_num . '</td>';
|
||||
print '<td align="center">' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
|
||||
print '<td>' . $obj->doc_ref . '</td>';
|
||||
print '<td>' . length_accountg($obj->numero_compte) . '</td>';
|
||||
@ -260,19 +302,23 @@ else {
|
||||
print '<td>' . $obj->code_journal . '</td>';
|
||||
print '<td align="center"><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
//$old_piecenum= $obj->piece_num;
|
||||
$i ++;
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="./card.php?action=create">'.$langs->trans("NewAccountingMvt").'</a>';
|
||||
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -36,7 +36,7 @@ $langs->load("accountancy");
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
// Filter
|
||||
$year = GETPOST("year", 'int');
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -94,7 +94,7 @@ class FormVentilation extends Form
|
||||
* @param array $event Event options
|
||||
* @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1)
|
||||
* @param int $select_out set value returned by select 0=rowid (default), 1=account_number
|
||||
* @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by
|
||||
* @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
@ -126,7 +126,7 @@ class FormVentilation extends Form
|
||||
if ($num) {
|
||||
while ( $i < $num ) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$label = $obj->account_number . ' - ' . $obj->label;
|
||||
$label = length_accountg($obj->account_number) . ' - ' . $obj->label;
|
||||
$label = dol_trunc($label, $trunclength);
|
||||
if ($select_in == 0 ) $select_value_in = $obj->rowid;
|
||||
if ($select_in == 1 ) $select_value_in = $obj->account_number;
|
||||
@ -265,4 +265,81 @@ class FormVentilation extends Form
|
||||
$this->db->free($resql);
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of auxilary thirdparty accounts
|
||||
*
|
||||
* @param string $selectid Preselected pcg_type
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $event = array()) {
|
||||
global $conf;
|
||||
|
||||
$out = '';
|
||||
|
||||
$aux_account = array ();
|
||||
|
||||
// Auxiliary customer account
|
||||
$sql = "SELECT DISTINCT code_compta, nom ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe";
|
||||
$sql .= " ORDER BY code_compta";
|
||||
dol_syslog(get_class($this) . "::select_auxaccount", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
if (! empty($obj->code_compta)) {
|
||||
$aux_account[$obj->code_compta] = $obj->code_compta . ' (' . $obj->nom . ')';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_pcgsubtype " . $this->error, LOG_ERR);
|
||||
return - 1;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
// Auxiliary supplier account
|
||||
$sql = "SELECT DISTINCT code_compta_fournisseur, nom ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe";
|
||||
$sql .= " ORDER BY code_compta";
|
||||
dol_syslog(get_class($this) . "::select_auxaccount", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
if (! empty($obj->code_compta_fournisseur)) {
|
||||
$aux_account[$obj->code_compta_fournisseur] = $obj->code_compta_fournisseur . ' (' . $obj->nom . ')';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_pcgsubtype " . $this->error, LOG_ERR);
|
||||
return - 1;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
//Build select
|
||||
if (count($aux_account) > 0) {
|
||||
|
||||
$out .= ajax_combobox($htmlname, $event);
|
||||
|
||||
$out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">';
|
||||
if ($showempty)
|
||||
$out .= '<option value="-1"></option>';
|
||||
foreach ( $aux_account as $key => $val ) {
|
||||
if (($selectid != '') && $selectid == $key) {
|
||||
$out .= '<option value="' . $key . '" selected>' . $val . '</option>';
|
||||
} else {
|
||||
$out .= '<option value="' . $key . '">' . $val . '</option>';
|
||||
}
|
||||
}
|
||||
$out .= '</select>';
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,9 +61,9 @@ $pagenext = $page + 1;
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
@ -65,14 +65,14 @@ if ($page < 0)
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $sortfield)
|
||||
$sortfield = "f.facnumber";
|
||||
$sortfield = "f.datef, f.facnumber, l.rowid";
|
||||
|
||||
if (! $sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
@ -169,9 +169,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -355,7 +355,7 @@ if ($action == 'writebookkeeping')
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->doc_type = 'banque';
|
||||
$bookkeeping->doc_type = 'bank';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||
@ -577,9 +577,9 @@ else
|
||||
$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);
|
||||
|
||||
$varlink = 'id_account='.$id_bank_account;
|
||||
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
|
||||
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();" />';
|
||||
@ -675,6 +675,7 @@ else
|
||||
|
||||
print "</table>";
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
@ -487,7 +487,9 @@ if ($action == 'export_csv')
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
}
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -531,6 +531,7 @@ if ($action == 'export_csv')
|
||||
|
||||
print "</table>";
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -66,11 +66,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION))
|
||||
}
|
||||
else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0)
|
||||
{
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";
|
||||
|
||||
|
||||
@ -66,9 +66,9 @@ if ($page < 0)
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -174,9 +174,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -140,7 +140,7 @@ if (count($listofsearchfields))
|
||||
foreach($listofsearchfields as $key => $value)
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -119,7 +119,7 @@ else
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="center">'.$langs->trans("Nature").'</td>';
|
||||
print '<td align="center">'.$langs->trans("NbOfMembers").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfMembers").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -135,7 +135,7 @@ foreach ($data as $val)
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td align="center">'.$memberstatic->getmorphylib($val['label']).'</td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
|
||||
print '<td align="center">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
$oldyear=$year;
|
||||
}
|
||||
|
||||
@ -170,9 +170,9 @@ $data = $stats->getAllByYear();
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre" height="24">';
|
||||
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td align="center">'.$langs->trans("NbOfSubscriptions").'</td>';
|
||||
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfSubscriptions").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -95,7 +96,7 @@ if ($actionsave)
|
||||
// Save nb of agenda
|
||||
if (! $error)
|
||||
{
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
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;
|
||||
@ -214,9 +215,9 @@ while ($i <= $MAXAGENDA)
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key):$conf->global->$name) . '" size="28"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha'):$conf->global->$name) . '" size="28"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key):$conf->global->$src) . '" size="60"></td>';
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha'):$conf->global->$src) . '" size="60"></td>';
|
||||
// Offset TZ
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ'.$key):$conf->global->$offsettz) . '" size="2"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
|
||||
@ -89,7 +89,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* Creation of an optional field
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -103,7 +103,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -175,7 +175,7 @@ if ($action == 'edit')
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
$var=false;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . '</td></tr>';
|
||||
|
||||
@ -222,7 +222,7 @@ else
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
$var=false;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
||||
|
||||
|
||||
@ -36,11 +36,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
$langs->load("resource");
|
||||
$langs->load("holiday");
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
@ -168,7 +171,7 @@ $tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
|
||||
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
@ -232,7 +235,7 @@ $tabfield[24]= "code,label";
|
||||
$tabfield[25]= "label,type_template,position,topic,content";
|
||||
$tabfield[26]= "code,label,short_label";
|
||||
$tabfield[27]= "code,libelle";
|
||||
$tabfield[28]= "code,label,delay,newByMonth,country_id,country";
|
||||
$tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country";
|
||||
$tabfield[29]= "code,label,percent,position";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
@ -264,7 +267,7 @@ $tabfieldvalue[24]= "code,label";
|
||||
$tabfieldvalue[25]= "label,type_template,position,topic,content";
|
||||
$tabfieldvalue[26]= "code,label,short_label";
|
||||
$tabfieldvalue[27]= "code,libelle";
|
||||
$tabfieldvalue[28]= "code,label,delay,newByMonth,country";
|
||||
$tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country";
|
||||
$tabfieldvalue[29]= "code,label,percent,position";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
@ -296,7 +299,7 @@ $tabfieldinsert[24]= "code,label";
|
||||
$tabfieldinsert[25]= "label,type_template,position,topic,content";
|
||||
$tabfieldinsert[26]= "code,label,short_label";
|
||||
$tabfieldinsert[27]= "code,libelle";
|
||||
$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[29]= "code,label,percent,position";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
@ -394,7 +397,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[25] = array('type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[28] = array('delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
@ -586,6 +589,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
// Clean some parameters
|
||||
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
||||
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd'))
|
||||
@ -1308,6 +1314,9 @@ if ($id)
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
||||
$valuetoshow = length_accountg($valuetoshow);
|
||||
}
|
||||
|
||||
// Show value for field
|
||||
if ($showfield) print '<td align="'.$align.'">'.$valuetoshow.'</td>';
|
||||
@ -1461,6 +1470,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
@ -1589,6 +1599,20 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
print $form->selectarray($fieldlist[$field], $localtax_typeList, (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy')
|
||||
{
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountancy_account = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
@ -1597,9 +1621,6 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
if ($fieldlist[$field]=='position') $size='size="4" ';
|
||||
if ($fieldlist[$field]=='libelle') $size='size="32" ';
|
||||
if ($fieldlist[$field]=='tracking') $size='size="92" ';
|
||||
if ($fieldlist[$field]=='accountancy_code') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" ';
|
||||
if ($fieldlist[$field]=='sortorder') $size='size="2" ';
|
||||
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
|
||||
@ -96,7 +96,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -110,7 +110,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -96,7 +96,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -110,7 +110,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -48,13 +48,15 @@ if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
||||
|
||||
// List of supported permanent search area
|
||||
$searchform=array();
|
||||
/* deprecated
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
|
||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
|
||||
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users"));
|
||||
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
|
||||
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
|
||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
|
||||
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users"));
|
||||
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module310Name','Module400Name');
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@ -96,16 +98,6 @@ if ($action == 'update')
|
||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
|
||||
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
|
||||
|
||||
/*
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
|
||||
*/
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
||||
|
||||
@ -169,7 +169,7 @@ else
|
||||
if (empty($mysoc->country_code))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$warnpicto=img_error($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -96,7 +96,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -110,7 +110,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -96,7 +96,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -110,7 +110,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -505,7 +505,6 @@ if ($action == 'edit')
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -662,7 +661,6 @@ else
|
||||
// Run the test to connect
|
||||
if ($action == 'testconnect')
|
||||
{
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||
|
||||
// If we use SSL/TLS
|
||||
@ -688,7 +686,6 @@ else
|
||||
// Show email send test form
|
||||
if ($action == 'test' || $action == 'testhtml')
|
||||
{
|
||||
print '<br>';
|
||||
print load_fiche_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend"));
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.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
|
||||
@ -26,6 +26,7 @@ require '../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("salaries");
|
||||
@ -75,6 +76,7 @@ if ($action == 'update')
|
||||
llxHeader('',$langs->trans('SalariesSetup'));
|
||||
|
||||
$form = new Form($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup');
|
||||
@ -105,7 +107,14 @@ foreach ($list as $key)
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -115,7 +124,7 @@ print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -381,7 +381,9 @@ foreach ($dirmodels as $reldir)
|
||||
print "<td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db,$specimenthirdparty);
|
||||
print $module->description;
|
||||
if (method_exists($module,'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
// Active
|
||||
|
||||
@ -392,7 +392,8 @@ foreach ($dirmodels as $reldir)
|
||||
print "<td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db,$specimenthirdparty);
|
||||
print $module->description;
|
||||
if (method_exists($module,'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Active
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -111,7 +111,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -111,7 +111,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -297,7 +297,7 @@ jQuery(document).ready(function() {
|
||||
var compjsstring;
|
||||
getjsurl = $.ajax({
|
||||
type: "GET",
|
||||
url: \''.DOL_URL_ROOT.'/core/js/lib_head.js\',
|
||||
url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
/* crossDomain: true,*/
|
||||
|
||||
@ -26,7 +26,8 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load('admin');
|
||||
|
||||
@ -112,6 +113,7 @@ if ($action == 'update') {
|
||||
|
||||
llxHeader();
|
||||
$form=new Form($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup');
|
||||
@ -212,7 +214,14 @@ foreach ($list as $key)
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ $page = GETPOST('page','int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $user->admin)
|
||||
|
||||
@ -39,7 +39,7 @@ $page = GETPOST("page",'int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -85,7 +85,7 @@ if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty'))
|
||||
|
||||
if (empty($forbarcode) || empty($fk_barcode_type))
|
||||
{
|
||||
setEventMessages($langs->trans("DefinitionOfBarCodeForProductNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings');
|
||||
setEventMessages($langs->trans("DefinitionOfBarCodeForThirdpartyNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -387,11 +387,11 @@ print '<br>';
|
||||
|
||||
if ($producttmp->id > 0)
|
||||
{
|
||||
print $langs->trans("BarCodeDataForProduct",$producttmp->getNomUrl(1)).'<br>';
|
||||
print $langs->trans("BarCodeDataForProduct",'').' '.$producttmp->getNomUrl(1).'<br>';
|
||||
}
|
||||
if ($thirdpartytmp->id > 0)
|
||||
{
|
||||
print $langs->trans("BarCodeDataForThirdparty",$thirdpartytmp->getNomUrl(1)).'<br>';
|
||||
print $langs->trans("BarCodeDataForThirdparty",'').' '.$thirdpartytmp->getNomUrl(1).'<br>';
|
||||
}
|
||||
|
||||
print '<div class="tagtable">';
|
||||
|
||||
@ -24,12 +24,19 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
|
||||
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
||||
unset($_SESSION['serObjFacturation']);
|
||||
|
||||
$hookmanager->initHooks(array('cashdeskTplTicket'));
|
||||
|
||||
require ('tpl/ticket.tpl.php');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$obj_facturation);
|
||||
if (empty($reshook))
|
||||
{
|
||||
require ('tpl/ticket.tpl.php');
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['serObjFacturation'] = serialize($obj_facturation);
|
||||
|
||||
@ -86,8 +86,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@ -100,7 +100,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -1305,7 +1305,7 @@ class Categorie extends CommonObject
|
||||
if (is_numeric( $type )) {
|
||||
// We want to reverse lookup
|
||||
$map_type = array_flip( $this->MAP_ID );
|
||||
$type = $map_type;
|
||||
$type = $map_type[$type];
|
||||
dol_syslog( get_class( $this ) . "::rechercher(): numeric types are deprecated, please use string instead",
|
||||
LOG_WARNING );
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ $ref=GETPOST('ref');
|
||||
$type=GETPOST('type');
|
||||
$action=GETPOST('action');
|
||||
$confirm=GETPOST('confirm');
|
||||
$cancel=GETPOST('cancel');
|
||||
|
||||
$socid=GETPOST('socid','int');
|
||||
$label=GETPOST('label');
|
||||
@ -54,6 +55,10 @@ if ($id == "")
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
}
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@ -61,52 +66,56 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Action mise a jour d'une categorie
|
||||
if ($action == 'update' && $user->rights->categorie->creer)
|
||||
{
|
||||
$categorie = new Categorie($db);
|
||||
$result=$categorie->fetch($id);
|
||||
|
||||
$categorie->label = $label;
|
||||
$categorie->description = dol_htmlcleanlastbr($description);
|
||||
$categorie->color = $color;
|
||||
$categorie->socid = ($socid ? $socid : 'null');
|
||||
$categorie->visible = $visible;
|
||||
$object->label = $label;
|
||||
$object->description = dol_htmlcleanlastbr($description);
|
||||
$object->color = $color;
|
||||
$object->socid = ($socid ? $socid : 'null');
|
||||
$object->visible = $visible;
|
||||
|
||||
if ($parent != "-1")
|
||||
$categorie->fk_parent = $parent;
|
||||
$object->fk_parent = $parent;
|
||||
else
|
||||
$categorie->fk_parent = "";
|
||||
$object->fk_parent = "";
|
||||
|
||||
|
||||
if (empty($categorie->label))
|
||||
if (empty($object->label))
|
||||
{
|
||||
$error++;
|
||||
$action = 'edit';
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (! $error && empty($categorie->error))
|
||||
if (! $error && empty($object->error))
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error && $categorie->update($user) > 0)
|
||||
if (! $error && $object->update($user) > 0)
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type);
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +185,7 @@ print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
print '<div class="center"><input type="submit" class="button" name"submit" value="'.$langs->trans("Modify").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -146,6 +146,7 @@ foreach($fulltree as $key => $val)
|
||||
{
|
||||
$categstatic->id=$val['id'];
|
||||
$categstatic->ref=$val['label'];
|
||||
$categstatic->color=$val['color'];
|
||||
$categstatic->type=$type;
|
||||
$li=$categstatic->getNomUrl(1,'',60);
|
||||
$desc=dol_htmlcleanlastbr($val['description']);
|
||||
@ -153,8 +154,8 @@ foreach($fulltree as $key => $val)
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.
|
||||
'</td><td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.'</span></td>'.
|
||||
'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
|
||||
'</tr></table>'
|
||||
);
|
||||
|
||||
@ -158,10 +158,23 @@ print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
print $object->label;
|
||||
print '<td width="20%" class="notopnoleft">';
|
||||
$ways = $object->print_all_ways();
|
||||
print $langs->trans("Ref").'</td><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||
foreach ($ways as $way)
|
||||
{
|
||||
print $way."<br>\n";
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td width="20%" class="notopnoleft">';
|
||||
print $langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($action == 'edit')
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -294,6 +294,7 @@ else
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
|
||||
// List of products or services (type is type of category)
|
||||
if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
{
|
||||
@ -339,7 +340,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $prod->getNomUrl(1,'category');
|
||||
print $prod->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$prod->label."</td>\n";
|
||||
// Link to delete from category
|
||||
@ -390,7 +391,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category_supplier');
|
||||
print $soc->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
@ -444,7 +445,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category');
|
||||
print $soc->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
@ -497,7 +498,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
$member->ref=$member->login;
|
||||
print $member->getNomUrl(1,0,'category');
|
||||
print $member->getNomUrl(1,0);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$member->lastname."</td>\n";
|
||||
print '<td valign="top">'.$member->firstname."</td>\n";
|
||||
@ -526,7 +527,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
||||
}
|
||||
}
|
||||
|
||||
//Categorie contact
|
||||
// Categorie contact
|
||||
if($object->type == Categorie::TYPE_CONTACT)
|
||||
{
|
||||
$contacts = $object->getObjectsInCateg("contact");
|
||||
|
||||
@ -651,7 +651,7 @@ if ($action == 'create')
|
||||
{
|
||||
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
$default=(empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)?'':$conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
|
||||
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode","systemauto");
|
||||
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode", "systemauto", 0, -1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -1081,8 +1081,10 @@ if ($id > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Thirdparty - Contact
|
||||
|
||||
@ -157,7 +157,17 @@ class ActionComm extends CommonObject
|
||||
|
||||
var $actions=array();
|
||||
|
||||
// Fields for emails
|
||||
var $email_msgid;
|
||||
var $email_from;
|
||||
var $email_sender;
|
||||
var $email_to;
|
||||
var $email_tocc;
|
||||
var $email_tobcc;
|
||||
var $email_subject;
|
||||
var $errors_to;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -834,7 +844,7 @@ class ActionComm extends CommonObject
|
||||
if (! empty($elementtype))
|
||||
{
|
||||
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
|
||||
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
|
||||
else $sql.= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
|
||||
}
|
||||
if (! empty($filter)) $sql.= $filter;
|
||||
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
|
||||
|
||||
@ -58,7 +58,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
|
||||
@ -74,7 +74,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder)
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
|
||||
@ -41,7 +41,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="a.datep";
|
||||
|
||||
@ -87,8 +87,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@ -101,7 +101,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
|
||||
@ -34,7 +34,7 @@ $page=GETPOST('page', 'int');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.name";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$type=GETPOST('type', 'alpha');
|
||||
|
||||
@ -114,7 +114,7 @@ if (count($listofsearchfields))
|
||||
foreach($listofsearchfields as $key => $value)
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -32,7 +32,7 @@ $result=restrictedArea($user,'mailing');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -154,7 +154,7 @@ $pagenext = $page + 1;
|
||||
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
|
||||
$sql = 'SELECT';
|
||||
|
||||
@ -62,6 +62,7 @@ $formpropal=new FormPropal($db);
|
||||
|
||||
$langs->load('propal');
|
||||
$langs->load('other');
|
||||
$langs->load("companies");
|
||||
|
||||
llxHeader('', $langs->trans("ProposalsStatistics"));
|
||||
|
||||
@ -239,7 +240,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
// Company
|
||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||
$filter='s.client in (1,2,3)';
|
||||
print $form->select_company($socid,'socid',$filter,1);
|
||||
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||
|
||||
@ -325,7 +325,7 @@ if (empty($reshook))
|
||||
for($i = 0; $i < $num; $i ++)
|
||||
{
|
||||
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : '');
|
||||
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle);
|
||||
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : '');
|
||||
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
|
||||
|
||||
// Dates
|
||||
|
||||
@ -76,9 +76,41 @@ class Commande extends CommonOrder
|
||||
|
||||
var $brouillon;
|
||||
var $cond_reglement_code;
|
||||
|
||||
var $fk_account;
|
||||
|
||||
/**
|
||||
* It holds the label of the payment mode. Use it in case translation cannot be found.
|
||||
* @var string
|
||||
*/
|
||||
var $mode_reglement;
|
||||
|
||||
/**
|
||||
* Payment mode id
|
||||
* @var int
|
||||
*/
|
||||
var $mode_reglement_id;
|
||||
/**
|
||||
* Payment mode code
|
||||
* @var string
|
||||
*/
|
||||
var $mode_reglement_code;
|
||||
/**
|
||||
* Availability delivery time id
|
||||
* @var int
|
||||
*/
|
||||
var $availability_id;
|
||||
/**
|
||||
* Availability delivery time code
|
||||
* @var string
|
||||
*/
|
||||
var $availability_code;
|
||||
/**
|
||||
* Label of availability delivery time. Use it in case translation cannot be found.
|
||||
* @var string
|
||||
*/
|
||||
var $availability;
|
||||
|
||||
var $demand_reason_id;
|
||||
var $demand_reason_code;
|
||||
var $address;
|
||||
@ -1435,7 +1467,7 @@ class Commande extends CommonOrder
|
||||
$sql.= ", i.libelle as libelle_incoterms";
|
||||
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
|
||||
$sql.= ', ca.code as availability_code';
|
||||
$sql.= ', ca.code as availability_code, ca.label as availability_label';
|
||||
$sql.= ', dr.code as demand_reason_code';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)';
|
||||
@ -1492,6 +1524,7 @@ class Commande extends CommonOrder
|
||||
$this->fk_account = $obj->fk_account;
|
||||
$this->availability_id = $obj->fk_availability;
|
||||
$this->availability_code = $obj->availability_code;
|
||||
$this->availability = $obj->availability_label;
|
||||
$this->demand_reason_id = $obj->fk_input_reason;
|
||||
$this->demand_reason_code = $obj->demand_reason_code;
|
||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||
|
||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
||||
if (!$user->rights->commande->lire) accessforbidden();
|
||||
|
||||
$langs->load("orders");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
@ -67,7 +67,7 @@ $result = restrictedArea($user, 'commande', $id,'');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
|
||||
@ -256,7 +256,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid,'socid',$filter,1);
|
||||
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||
|
||||
@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbank.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("bills");
|
||||
@ -85,7 +87,8 @@ if ($_POST["action"] == 'add')
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
$account->owner_address = trim($_POST["owner_address"]);
|
||||
|
||||
$account->account_number = trim($_POST["account_number"]);
|
||||
if (GETPOST('account_number') <= 0) { $accountancy_code_number = ''; } else { $accountancy_code_number = GETPOST('account_number'); }
|
||||
$account->account_number = $accountancy_code_number;
|
||||
$account->accountancy_journal = trim($_POST["accountancy_journal"]);
|
||||
|
||||
$account->solde = $_POST["solde"];
|
||||
@ -163,7 +166,8 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
$account->owner_address = trim($_POST["owner_address"]);
|
||||
|
||||
$account->account_number = trim($_POST["account_number"]);
|
||||
if (GETPOST('account_number') <= 0) { $accountancy_code_number = ''; } else { $accountancy_code_number = GETPOST('account_number'); }
|
||||
$account->account_number = $accountancy_code_number;
|
||||
$account->accountancy_journal = trim($_POST["accountancy_journal"]);
|
||||
|
||||
$account->currency_code = trim($_POST["account_currency_code"]);
|
||||
@ -231,6 +235,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user-
|
||||
$form = new Form($db);
|
||||
$formbank = new FormBank($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||
|
||||
@ -476,14 +481,34 @@ if ($action == 'create')
|
||||
// Accountancy code
|
||||
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
|
||||
{
|
||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST('account_number'):$account->account_number).'"></td></tr>';
|
||||
}
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>';
|
||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST('account_number'):$account->account_number).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST('account_number'):$account->account_number).'"></td></tr>';
|
||||
}
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>';
|
||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST('account_number'):$account->account_number).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Accountancy journal
|
||||
if (! empty($conf->accounting->enabled))
|
||||
@ -732,7 +757,7 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
// Accountancy code
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3">'.$account->account_number.'</td></tr>';
|
||||
print '<td colspan="3">'.length_accountg($account->account_number).'</td></tr>';
|
||||
|
||||
// Accountancy journal
|
||||
if (! empty($conf->accounting->enabled))
|
||||
@ -1008,16 +1033,36 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Accountancy code
|
||||
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
|
||||
{
|
||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||
}
|
||||
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
|
||||
{
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>';
|
||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST("account_number"):$account->account_number).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>';
|
||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST("account_number"):$account->account_number).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Accountancy journal
|
||||
if (! empty($conf->accounting->enabled))
|
||||
|
||||
@ -761,11 +761,12 @@ class Account extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Delete bank account from database
|
||||
* Delete bank account from database
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User deleting
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete()
|
||||
function delete($user='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -1280,12 +1281,12 @@ class AccountLine extends CommonObject
|
||||
$nbko++;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".(int) $this->rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result) $nbko++;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".(int) $this->rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result) $nbko++;
|
||||
@ -1322,7 +1323,7 @@ class AccountLine extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".(int) $this->rowid;
|
||||
dol_syslog(get_class($this)."::delete_urls", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result) $nbko++;
|
||||
|
||||
@ -99,11 +99,14 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
|
||||
if ($action == 'del')
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($_GET["rowid"]);
|
||||
$result=$bankline->delete($user);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$bankline->error);
|
||||
|
||||
if ($bankline->fetch($_GET["rowid"]) > 0) {
|
||||
$result = $bankline->delete($user);
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $bankline->error);
|
||||
}
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='b.dateo';
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$page = $_GET["page"];
|
||||
if ($page < 0) $page = 0;
|
||||
|
||||
//$limit = $conf->liste_limit;
|
||||
//$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
//$offset = $limit * $page ;
|
||||
|
||||
if (! $sortfield) $sortfield="cs.date_ech";
|
||||
|
||||
@ -45,7 +45,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="d.dated";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -46,7 +46,7 @@ $search_company=GETPOST('search_company','alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
|
||||
@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacementstats.class.php';
|
||||
|
||||
$langs->load("trips");
|
||||
$langs->load("companies");
|
||||
|
||||
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
|
||||
@ -236,7 +237,7 @@ print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->tra
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
$filter='';
|
||||
print $form->select_company($socid,'socid',$filter,1,1);
|
||||
print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture-rec.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||
@ -810,7 +811,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Standard invoice or Deposit invoice created from a Predefined invoice
|
||||
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && $_POST['fac_rec'] > 0)
|
||||
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec') > 0)
|
||||
{
|
||||
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
if (empty($dateinvoice))
|
||||
@ -832,14 +833,14 @@ if (empty($reshook))
|
||||
$object->modelpdf = $_POST['model'];
|
||||
|
||||
// Source facture
|
||||
$object->fac_rec = $_POST['fac_rec'];
|
||||
$object->fac_rec = GETPOST('fac_rec');
|
||||
|
||||
$id = $object->create($user);
|
||||
}
|
||||
}
|
||||
|
||||
// Standard or deposit or proforma invoice
|
||||
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT || $_POST['type'] == Facture::TYPE_PROFORMA || ($_POST['type'] == Facture::TYPE_SITUATION && empty($_POST['situations']))) && $_POST['fac_rec'] <= 0)
|
||||
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT || $_POST['type'] == Facture::TYPE_PROFORMA || ($_POST['type'] == Facture::TYPE_SITUATION && empty($_POST['situations']))) && GETPOST('fac_rec') <= 0)
|
||||
{
|
||||
if (GETPOST('socid', 'int') < 1)
|
||||
{
|
||||
@ -1955,7 +1956,7 @@ if ($action == 'create')
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
|
||||
if ($soc->id > 0)
|
||||
if ($soc->id > 0 && ! GETPOST('fac_rec'))
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $soc->getNomUrl(1);
|
||||
@ -1975,7 +1976,7 @@ if ($action == 'create')
|
||||
else
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
|
||||
print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
|
||||
// Option to reload page to retrieve customer informations. Note, this clear other input
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
||||
{
|
||||
@ -1994,11 +1995,14 @@ if ($action == 'create')
|
||||
print '</tr>' . "\n";
|
||||
|
||||
// Predefined invoices
|
||||
if (empty($origin) && empty($originid) && $socid > 0)
|
||||
if (empty($origin) && empty($originid) && GETPOST('fac_rec','int') > 0)
|
||||
{
|
||||
$invoice_predefined = new FactureRec($db);
|
||||
$invoice_predefined->fetch(GETPOST('fac_rec','int'));
|
||||
|
||||
$sql = 'SELECT r.rowid, r.titre, r.total_ttc';
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
|
||||
$sql .= ' WHERE r.fk_soc = ' . $soc->id;
|
||||
$sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -87,9 +87,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
@ -101,9 +101,9 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
|
||||
@ -1040,7 +1040,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql;
|
||||
$this->error='Bill with id '.$rowid.' or ref '.$ref.' not found';
|
||||
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
|
||||
return 0;
|
||||
}
|
||||
@ -2094,8 +2094,8 @@ class Facture extends CommonInvoice
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($fk_prev_id)) $fk_prev_id = 'null';
|
||||
if (is_null($situation_percent) || $situation_percent > 100) $situation_percent = 100;
|
||||
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
@ -2282,7 +2282,7 @@ class Facture extends CommonInvoice
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($special_code) || $special_code == 3) $special_code=0;
|
||||
if ($situation_percent > 100 || is_null($situation_percent) || $situation_percent == "") $situation_percent = 100;
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent = price2num($remise_percent);
|
||||
$qty = price2num($qty);
|
||||
@ -3881,7 +3881,8 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->fk_prev_id)) $this->fk_prev_id = 'null';
|
||||
if (empty($this->situation_percent)) $this->situation_percent = 0;
|
||||
if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
// if buy price not defined, define buyprice as configured in margin admin
|
||||
@ -4076,9 +4077,9 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (is_null($this->situation_percent)) $this->situation_percent=100;
|
||||
if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) return -1;
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ if ($page == -1)
|
||||
{
|
||||
$page = 0 ;
|
||||
}
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if ($sortorder == "")
|
||||
|
||||
@ -77,7 +77,7 @@ if ($option == 'late') $filter = 'paye:0';
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
@ -743,7 +743,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Taxes'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
|
||||
@ -866,7 +866,7 @@ if ($resql)
|
||||
|
||||
// Payment mode
|
||||
print '<td>';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->total_ht,0,$langs).'</td>';
|
||||
|
||||
@ -545,7 +545,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="f.date_lim_reglement";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email";
|
||||
$sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
|
||||
@ -605,7 +605,7 @@ if ($search_user > 0)
|
||||
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
|
||||
}
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,";
|
||||
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement";
|
||||
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, f.fk_mode_reglement";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " ORDER BY ";
|
||||
$listfield=explode(',',$sortfield);
|
||||
@ -807,7 +807,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
@ -941,7 +941,7 @@ if ($resql)
|
||||
|
||||
// Payment mode
|
||||
print '<td>';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
|
||||
print '</td>';
|
||||
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"');
|
||||
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
||||
|
||||
@ -96,7 +96,7 @@ if (count($listofsearchfields))
|
||||
foreach($listofsearchfields as $key => $value)
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
@ -140,7 +140,82 @@ $max=10;
|
||||
|
||||
$langs->load("boxes");
|
||||
|
||||
// Last trips
|
||||
|
||||
|
||||
// Last leave requests
|
||||
if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
|
||||
{
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.rowid = x.fk_user";
|
||||
$sql.= " AND x.entity = ".$conf->entity;
|
||||
if (empty($user->rights->holiday->read_all)) $sql.=' AND x.fk_user IN ('.join(',',$childids).')';
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
//if (!empty($socid)) $sql.= " AND x.fk_soc = ".$socid;
|
||||
$sql.= $db->order("x.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$var=false;
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$holidaystatic=new Holiday($db);
|
||||
$userstatic=new User($db);
|
||||
|
||||
$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
|
||||
$typeleaves=$holidaystatic->getTypes(1,-1);
|
||||
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("BoxTitleLastLeaveRequests",min($max,$num)).'</td>';
|
||||
print '<td>'.$langs->trans("from").'</td>';
|
||||
print '<td>'.$langs->trans("to").'</td>';
|
||||
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
||||
print '<td width="16"> </td>';
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num && $i < $max)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$holidaystatic->id=$obj->rowid;
|
||||
$holidaystatic->ref=$obj->ref;
|
||||
$userstatic->id=$obj->uid;
|
||||
$userstatic->lastname=$obj->lastname;
|
||||
$userstatic->firstname=$obj->firstname;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$holidaystatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$typeleaves[$obj->fk_type]['label'].'</td>';
|
||||
|
||||
$starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
|
||||
$endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
|
||||
|
||||
print '<td>'.dol_print_date($obj->date_start,'day').' '.$langs->trans($listhalfday[$endhalfday]);
|
||||
print '<td>'.dol_print_date($obj->date_end,'day').' '.$langs->trans($listhalfday[$endhalfday]);
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
|
||||
print '<td>'.$holidaystatic->LibStatut($obj->status,3).'</td>';
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td colspan="7">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</table><br>';
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
// Last expense report (old module)
|
||||
if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
||||
{
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut";
|
||||
@ -204,6 +279,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
// Last expense report (new module)
|
||||
if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
|
||||
{
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
|
||||
|
||||
@ -115,7 +115,7 @@ if (count($listofsearchfields))
|
||||
foreach($listofsearchfields as $key => $value)
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -673,7 +673,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (! GETPOST('action'))
|
||||
{
|
||||
if ($page == -1) $page = 0 ;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
@ -53,7 +53,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
$sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut";
|
||||
$sql.=", c.libelle as paiement_type, p.num_paiement";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user