Merge branch 'develop' into new_mass_generate
This commit is contained in:
commit
83efdee7d3
4
.mailmap
4
.mailmap
@ -6,8 +6,8 @@ Laurent Destailleur <eldy@destailleur.fr> eldy <eldy@destailleur.fr>
|
|||||||
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ldestailleur@teclib.com>
|
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ldestailleur@teclib.com>
|
||||||
Laurent Destailleur <eldy@destailleur.fr> eldy10 <eldy10@master8.(none)>
|
Laurent Destailleur <eldy@destailleur.fr> eldy10 <eldy10@master8.(none)>
|
||||||
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ephpcsdy@destailleur.fr>
|
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ephpcsdy@destailleur.fr>
|
||||||
Regis Houssin <regis.houssin@capnetworks.com> Regis Houssin <regis@dolibarr.fr>
|
Regis Houssin <regis.houssin@inodbox.com> Regis Houssin <regis@dolibarr.fr>
|
||||||
Regis Houssin <regis.houssin@capnetworks.com> Régis Houssin <regishoussin@device5.home>
|
Regis Houssin <regis.houssin@inodbox.com> Régis Houssin <regishoussin@device5.home>
|
||||||
Juanjo Menent <jmenent@2byte.es> simnandez <jmenent@2byte.es>
|
Juanjo Menent <jmenent@2byte.es> simnandez <jmenent@2byte.es>
|
||||||
Juanjo Menent <jmenent@2byte.es> Juanjo Menent <simnandez@gmail.com>
|
Juanjo Menent <jmenent@2byte.es> Juanjo Menent <simnandez@gmail.com>
|
||||||
Juanjo Menent <jmenent@2byte.es> Simnandez <jmenent@2byte.es>
|
Juanjo Menent <jmenent@2byte.es> Simnandez <jmenent@2byte.es>
|
||||||
|
|||||||
@ -288,7 +288,8 @@ script:
|
|||||||
echo "Checking PHP syntax errors"
|
echo "Checking PHP syntax errors"
|
||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
parallel-lint --exclude htdocs/includes --blame .
|
#parallel-lint --exclude htdocs/includes --blame .
|
||||||
|
parallel-lint --exclude htdocs/includes/sabre --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -341,6 +342,9 @@ script:
|
|||||||
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
|
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
|
||||||
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
|
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
|
||||||
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
|
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
|
||||||
|
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
|
||||||
|
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
|
||||||
|
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
|
||||||
cd -
|
cd -
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|||||||
277
ChangeLog
277
ChangeLog
@ -5,29 +5,204 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
|
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
|
||||||
For Users:
|
For Users:
|
||||||
|
NEW: Stable module: DAV (WebDAV only for the moment)
|
||||||
|
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more services.
|
||||||
|
NEW: Stable module "Module Builder"
|
||||||
NEW: Stable module: Website
|
NEW: Stable module: Website
|
||||||
NEW: Stable module: WebDAV
|
|
||||||
NEW: Stable module: Module Builder
|
|
||||||
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
|
|
||||||
NEW: Experimental module "TakePos"
|
NEW: Experimental module "TakePos"
|
||||||
|
NEW: Experimental module "Ticket"
|
||||||
|
NEW: Experimental module "Data Privacy"
|
||||||
|
NEW: Experimental module "Email Collector"
|
||||||
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
||||||
Android application like DoliDroid able to provide native features for multicompany module.
|
Android application like DoliDroid able to provide native features for multicompany module.
|
||||||
NEW: Compatibility with PHP 7.3
|
NEW: Compatibility with PHP 7.3 =>
|
||||||
|
NEW: Add admin page for modulebuilder
|
||||||
|
NEW: Add civility in list of members. Close #9251
|
||||||
|
NEW: Add configuration to disable "customer/prospect" thirdparty type
|
||||||
|
NEW: Add CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY and CONTRACT_HIDE_UNSELECTABLES by SELECT_HIDE_UNSELECTABLES
|
||||||
|
NEW: Add __DAY_TEXT__ and __MONTH_TEXT__ substitutions vars
|
||||||
|
NEW: Add due date column in payment lists
|
||||||
|
NEW: Add email in event history, for reminder email of expired subsription
|
||||||
|
NEW: Add event tab on resource record
|
||||||
|
NEW: Add FEC Export in accountancy
|
||||||
|
NEW: Add filter on staff range in list of thirdparties
|
||||||
|
NEW: Add a first complete template of website
|
||||||
|
NEW: Add format code into exported filename of ledger
|
||||||
|
NEW: Add hidden option EXPENSEREPORT_DEFAULT_VALIDATOR_UNCHANGEABLE
|
||||||
|
NEW: Add hidden option MAIN_DOCUMENTS_DESCRIPTION_FIRST
|
||||||
|
NEW: Add link to inventory code
|
||||||
|
NEW: Add more common social networks fields for business
|
||||||
|
NEW: Add option PDF_DISABLE_MYCOMPANY_LOGO to disable logo on PDF
|
||||||
|
NEW: add option PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT
|
||||||
|
NEW: Add option to display thirdparty adress in combolist
|
||||||
|
NEW: Add option to swap sender/recipient address on PDF
|
||||||
|
NEW: Add option to display thirdparty adress in combolist
|
||||||
|
NEW: Add project on pament of salaries
|
||||||
|
NEW: Add SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME and
|
||||||
|
NEW: Add somes hooks in bank planned entries
|
||||||
|
NEW: Add supplier ref in item reception page
|
||||||
|
NEW: Advanced permission to ignore price min
|
||||||
|
NEW: Allow to enter a timespent with a numeric value
|
||||||
|
NEW: Automatic position of scroll when creating an extrafield
|
||||||
|
NEW: Can add autorefresh=X in any URLs to refresh page after X seconds
|
||||||
|
NEW: can add project's task to agenda on create event form
|
||||||
|
NEW: Can delete a website in experimental website module
|
||||||
|
NEW: Can disable meteo on smartphone only
|
||||||
|
NEW: Can export/import a website template
|
||||||
|
NEW: Can filter on EEC, not EEC, etc... in binding step of accountancy
|
||||||
|
NEW: Can mix offset before and after with rules for due date of invoices
|
||||||
|
NEW: Can record the supplier product description
|
||||||
|
NEW: Can select several prospect level in thirdparty filter.
|
||||||
|
NEW: Can set 2 url in url field of thirdparty
|
||||||
|
NEW: Can set if a field is mandatory on form level.
|
||||||
|
NEW: Can set the default focus of each page.
|
||||||
|
NEW: Add category filter on user list
|
||||||
|
NEW: Change forgotten password link in general parameters
|
||||||
|
NEW: Child label of variants change if parent label changes
|
||||||
|
NEW: Compatibility with new Paybox HMAC requirement
|
||||||
|
NEW: Each user can set its prefered default calendar page
|
||||||
|
NEW: Enhancement in process to make manual bank conciliation
|
||||||
|
NEW: Enhancement in the generic file manager
|
||||||
|
NEW: Extrafield totalizable
|
||||||
|
NEW: Hidden conf INVOICE_USE_DEFAULT_DOCUMENT
|
||||||
|
NEW: hidden conf to search product by supplier ref
|
||||||
|
NEW: hidden constant to be able to use a thirdparty for donation
|
||||||
|
NEW: hidden option to define an invoice template for each invoice type
|
||||||
|
NEW: Highlight lines on lists when they are checked
|
||||||
|
NEW: Notification module support expense report+holiday validation and approval
|
||||||
|
NEW: On customer/supplier card, add simple tooltip to amount boxes
|
||||||
|
NEW: Page to check if the operations/items created between two dates have attached item(s) and possibility to download all attachements
|
||||||
|
NEW: possibility to add all rights of all modules in one time
|
||||||
|
NEW: redirect if only one result on global search on card
|
||||||
|
NEW: Permission to ignore price min
|
||||||
|
NEW: Can build an archive of full documents directory from backup page
|
||||||
|
NEW: tag odt line_product_ref_fourn for supplier doc lines
|
||||||
|
NEW: The binding step in accountancy has a country filter with autocompletion
|
||||||
|
NEW: Top menu is always on screen with MD theme.
|
||||||
|
NEW: Withdraw request massaction can include already partially paid invoices
|
||||||
|
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
* Code changes to be more compatible with PSR2
|
NEW: Add lib for multiselect with checkboxes
|
||||||
* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
|
NEW: Add function isValidMXRecord
|
||||||
|
NEW: Add hook changeRoundingMode in update_price
|
||||||
|
NEW: Add hook formconfirm to contractcard
|
||||||
|
NEW: Add hook for virtual stock
|
||||||
|
NEW: ADD url to see the last version of a external module
|
||||||
|
NEW: Can enable a module, even external module, from command line
|
||||||
|
NEW: Can set a tooltip help text on extrafields
|
||||||
|
NEW: Add product search from barcode via REST api
|
||||||
|
NEW: can add documents on agenda events using API REST
|
||||||
|
NEW: Can set the datestart and dateend of cron job into module descriptor
|
||||||
|
NEW: Close #9296 Add field ref_ext into llx_categorie
|
||||||
|
NEW: move ticket dictionary in API /setup
|
||||||
|
NEW: PHPUnitTest on Loan class #3163
|
||||||
|
NEW: Code changes to be more compatible with PSR2
|
||||||
|
NEW: Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
|
||||||
|
NEW: Add agenda documents in API REST
|
||||||
|
NEW: Add "checked" field for new list engine compatibility
|
||||||
|
NEW: REST API improvements
|
||||||
|
NEW: Save external payment IDs into table of payment
|
||||||
|
NEW: triggers add commercial and del commercial
|
||||||
|
NEW: #9236 Allow to import shipment lines via API
|
||||||
|
NEW: ADD civility list in API
|
||||||
|
NEW: support selllist in the module builder
|
||||||
|
NEW: optional param to show a specific extrafield
|
||||||
|
NEW: hook formConfirm always called if hooked
|
||||||
|
NEW: hook on dispatch order fourn
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
|
* If you use some links like viewimages.php?modulepart=mycompany&file=... in your external modules, you must
|
||||||
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
|
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
|
||||||
modulepart=mycompany that now works like others).
|
modulepart=mycompany that now works like others).
|
||||||
|
* Hidden option MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT has been renamed into SHIPPING_PDF_DISPLAY_AMOUNT_HT
|
||||||
|
* Remove the no more used and deprecated dol_print_graph function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 8.0.3 compared to 8.0.2 *****
|
||||||
|
FIX: #9161
|
||||||
|
FIX: #9432
|
||||||
|
FIX: #9432 Assign yourself as a commercial when you don't have permission to see all thirds
|
||||||
|
FIX: #9510
|
||||||
|
FIX: #9567
|
||||||
|
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
|
||||||
|
FIX: Amount when using mutlicurrency on PDF
|
||||||
|
FIX: Backup of database without mysqladmin available from cron.
|
||||||
|
FIX: Bad label on delete button
|
||||||
|
FIX: bad link in notification
|
||||||
|
FIX: Bad position of hook formattachOptions call
|
||||||
|
FIX: Can't create shipping if have shipping line's extrafields
|
||||||
|
FIX: check !empty exclude select element
|
||||||
|
FIX: content lost when editing a label with "
|
||||||
|
FIX: correct migration of old postgresql unique key
|
||||||
|
FIX: credit note progression
|
||||||
|
FIX: default accounting accounts on loan creation #9643
|
||||||
|
FIX: Delete of draft invoice
|
||||||
|
FIX: deletion on draft is allowed if we are allwoed to create
|
||||||
|
FIX: Do not show check box if not applicable
|
||||||
|
FIX: exclude element of the select
|
||||||
|
FIX: extrafields of taks not visible in creation
|
||||||
|
FIX: filter on employee
|
||||||
|
FIX: invoice stats: situation invoices were not counted
|
||||||
|
FIX: keep external module element when adding resource
|
||||||
|
FIX: langs fr
|
||||||
|
FIX: Link template invoice to contract
|
||||||
|
FIX: Look and feel v8. Missing button "Create category"
|
||||||
|
FIX: Menu to show/edit Users categories was missing
|
||||||
|
FIX: missing name alias field in societe import/export #9091
|
||||||
|
FIX: missing symbol for indian rupies
|
||||||
|
FIX: Missing transaction around action
|
||||||
|
FIX: modify parenting before task deletion
|
||||||
|
FIX: nb of session in title
|
||||||
|
FIX: need to filter on current entity on replenish
|
||||||
|
FIX: number mailing for a contact with multicompany
|
||||||
|
FIX: Option for prof id mandatory not working with custom type of company
|
||||||
|
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
|
||||||
|
FIX: Pagination stats
|
||||||
|
FIX: pdf typhon: order reference duplicate
|
||||||
|
FIX: position 0 for emails templates
|
||||||
|
FIX: previous situation invoice selection
|
||||||
|
FIX: Product marge tabs on product card
|
||||||
|
FIX: Product margin tab and credit note
|
||||||
|
FIX: propal pdf: missing parenthesis for customs code
|
||||||
|
FIX: properties on proposal must not be modified if error
|
||||||
|
FIX: qty not visible for a lot when making shipment on a dedicated stock
|
||||||
|
FIX: Quick hack to solve pb of bad definition of public holidays
|
||||||
|
FIX: remain to pay for credit note was wrong on invoice list
|
||||||
|
FIX: replenish wasn't caring about supplier price min quantity #9561
|
||||||
|
FIX: Required extrafield value numeric should accept '0'
|
||||||
|
FIX: ressource list with extrafields
|
||||||
|
FIX: restore last seach criteria
|
||||||
|
FIX: Selection of addmaindocfile is lost on error
|
||||||
|
FIX: Sending of reminder for expired subscriptions
|
||||||
|
FIX: shared link ko on proposals
|
||||||
|
FIX: showOptionals: column mismatches
|
||||||
|
FIX: situation invoice total with credit note
|
||||||
|
FIX: situation invoice prev percent
|
||||||
|
FIX: special code on create supplier invoice from supplier order
|
||||||
|
FIX: Symbol of currency in substitution variables
|
||||||
|
FIX: The max size for upload file was not corectly shown
|
||||||
|
FIX: the member e-mail on resign and validation.
|
||||||
|
FIX: thirdparty property of object not loaded when only one record
|
||||||
|
FIX: title
|
||||||
|
FIX: Title problem on admin RSS module
|
||||||
|
FIX: Tooltip on invoice widget
|
||||||
|
FIX: Total of timespent
|
||||||
|
FIX: trackid into email sent from member module.
|
||||||
|
FIX: translation in select unit form
|
||||||
|
FIX: use discount with multicurrency
|
||||||
|
FIX: Variable name
|
||||||
|
FIX: When we delete a product, llx_product_association rows are not deleted
|
||||||
|
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
|
||||||
|
FIX: wrong function name
|
||||||
|
FIX: wrong occurence number of contract on contact card, we must only count externals
|
||||||
|
FIX: wrong value for module part and return access denied
|
||||||
|
FIX: Wrong variable name
|
||||||
|
FIX: XSS vulnerability reported by Mary Princy E
|
||||||
|
|
||||||
***** ChangeLog for 8.0.2 compared to 8.0.1 *****
|
***** ChangeLog for 8.0.2 compared to 8.0.1 *****
|
||||||
FIX: #8452
|
FIX: #8452
|
||||||
FIX: #9043
|
FIX: #9043
|
||||||
@ -284,6 +459,68 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
|
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 7.0.4 compared to 7.0.3 *****
|
||||||
|
FIX: #8984 button create expense report
|
||||||
|
FIX: #9032
|
||||||
|
FIX: #9161
|
||||||
|
FIX: #9328
|
||||||
|
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
|
||||||
|
FIX: Add calls to fetchComments function
|
||||||
|
FIX: better compatibility with multicompany
|
||||||
|
FIX: case when we valid form with keyboard
|
||||||
|
FIX: character making error on bill list
|
||||||
|
FIX: check !empty exclude select element
|
||||||
|
FIX: combo into popup become crazy with IE10
|
||||||
|
FIX: combo of stock in popup are crazy in IE
|
||||||
|
FIX: Deletion of files in migration
|
||||||
|
FIX: exclude element of the select
|
||||||
|
FIX: extrafieldkey
|
||||||
|
FIX: Fetch function will fetch comments
|
||||||
|
FIX: Fetch task will now fetch comments
|
||||||
|
FIX: filter supplier invoice list by societe name.
|
||||||
|
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||||
|
FIX: Force stripe api version to avoid trouble if we update stripe api
|
||||||
|
FIX: getEntity project and not projet
|
||||||
|
FIX: Get templates in a forced language
|
||||||
|
FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281)
|
||||||
|
FIX: Injection
|
||||||
|
FIX: invoice stats: situation invoices were not counted
|
||||||
|
FIX: keep context filter on contact list on change column displayed
|
||||||
|
FIX: Keep same project when creating shipping from order
|
||||||
|
FIX: langs fr
|
||||||
|
FIX: Lose filter on payment type or category after a sort on invoice list
|
||||||
|
FIX: Missing behavior
|
||||||
|
FIX: missing hook to edit sql
|
||||||
|
FIX: multicompany compatibility !
|
||||||
|
FIX: need to filter on current entity on replenish
|
||||||
|
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
|
||||||
|
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
|
||||||
|
FIX: Pagination on related item pages
|
||||||
|
FIX: Pagination on withdraw request list
|
||||||
|
FIX: PDF address: handle when contact thirdparty different from document thirdparty
|
||||||
|
FIX: PHP warning, undefined index notnull
|
||||||
|
FIX: Product marge tabs on product card
|
||||||
|
FIX: Product margin tab and credit note
|
||||||
|
FIX: propal: correctly preset project when creating with origin/originid
|
||||||
|
FIX: remain to pay for credit note was wrong on invoice list
|
||||||
|
FIX: remove debug
|
||||||
|
FIX: Remove fetchComments from project and task fetch function
|
||||||
|
FIX: remove rowid for multicompany compatibility
|
||||||
|
FIX: Search on Ref project on order list
|
||||||
|
FIX: search on ref project on propal list
|
||||||
|
FIX: showOptionals: column mismatches
|
||||||
|
FIX: SQL Injections reported by mu shcor (ADLab of Venustech)
|
||||||
|
FIX: stock replenish with multientity
|
||||||
|
FIX: table llx_chargessociales doesn't exists
|
||||||
|
FIX: we must see number of all shared projects
|
||||||
|
FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing
|
||||||
|
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
|
||||||
|
FIX: wrong function name
|
||||||
|
FIX: Wrong position of firstname lastname
|
||||||
|
FIX: wrong value for module part and return access denied
|
||||||
|
FIX: Wrong variable and trigger name
|
||||||
|
|
||||||
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
|
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
|
||||||
FIX: 7.0 task contact card without withproject parameters
|
FIX: 7.0 task contact card without withproject parameters
|
||||||
FIX: #8722
|
FIX: #8722
|
||||||
@ -766,6 +1003,32 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
multicompany module to a version that support Dolibarr v7, everything should work as expected.
|
multicompany module to a version that support Dolibarr v7, everything should work as expected.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.8 compared to 6.0.7 *****
|
||||||
|
FIX: #8762
|
||||||
|
FIX: #9032
|
||||||
|
FIX: case when we valid form with keyboard
|
||||||
|
FIX: clause must not be there
|
||||||
|
FIX: dol_delete_file must work in a context without db handler loaded
|
||||||
|
FIX: entity test must be on product_fourn_price table and not product table
|
||||||
|
FIX: Fetch shipping will now fetch project id
|
||||||
|
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||||
|
FIX: getEntity project and not projet
|
||||||
|
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
|
||||||
|
FIX: Keep supplier proposal price for supplier order
|
||||||
|
FIX: langs fr
|
||||||
|
FIX: missing filters during reordering
|
||||||
|
FIX: need to filter on aa.entity for same accounting accounts available in several entities
|
||||||
|
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
|
||||||
|
FIX: PDF address: handle when contact thirdparty different from document thirdparty
|
||||||
|
FIX: propal: correctly preset project when creating with origin/originid
|
||||||
|
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
|
||||||
|
FIX: remain to pay for credit note was wrong on invoice list
|
||||||
|
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
|
||||||
|
FIX: showOptionals: column mismatches
|
||||||
|
FIX: sometimes amounts are identical but php find them different.
|
||||||
|
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
|
||||||
|
FIX: we must see number of all shared projects
|
||||||
|
FIX: wrong var name
|
||||||
|
|
||||||
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
|
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
|
||||||
FIX: #8023
|
FIX: #8023
|
||||||
|
|||||||
32
README-FR.md
32
README-FR.md
@ -16,8 +16,8 @@ Dolibarr est distribué sous les termes de la licence GNU General Public License
|
|||||||
## INSTALLER DOLIBARR
|
## INSTALLER DOLIBARR
|
||||||
|
|
||||||
Si vous n'avez pas de connaissances techniques, et que vous recherchez
|
Si vous n'avez pas de connaissances techniques, et que vous recherchez
|
||||||
un programme d'installation qui install Dolibarr ERP/CRM en quelques clics,
|
un programme d'installation qui installe Dolibarr ERP/CRM en quelques clics,
|
||||||
vous devez vous réorienter vers DoliWamp (la version tout-en-un
|
vous devez vous ré-orienter vers DoliWamp (la version tout-en-un
|
||||||
de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou
|
de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou
|
||||||
Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
|
Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
|
||||||
OpenSuse, Mandriva ou Mageia).
|
OpenSuse, Mandriva ou Mageia).
|
||||||
@ -25,39 +25,39 @@ OpenSuse, Mandriva ou Mageia).
|
|||||||
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
||||||
https://www.dolibarr.org/
|
https://www.dolibarr.org/
|
||||||
|
|
||||||
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (MariaDb/MySql/PostgreSql),
|
Si vous avez déjà installé un serveur Web avec PHP et une base de données (MariaDb/MySql/PostgreSql),
|
||||||
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
||||||
|
|
||||||
- Copier le répertoire "dolibarr" et son contenu dans la racine de votre serveur
|
- Copiez le répertoire "dolibarr" et son contenu dans la racine de votre serveur
|
||||||
web, ou bien copier le répertoire sur le serveur et configurer ce serveur pour
|
web, ou bien copiez le répertoire sur le serveur et configurez ce serveur pour
|
||||||
utiliser "dolibarr/htdocs" comme racine d'un nouveau virtual host (ce second
|
utiliser "dolibarr/htdocs" comme racine d'un nouveau virtual host (ce second
|
||||||
choix requiert des compétences et habilitations en administration du serveur
|
choix requiert des compétences et habilitations en administration du serveur
|
||||||
web).
|
web).
|
||||||
|
|
||||||
- Créer un fichier vide "htdocs/conf/conf.php" et attribuer les permissions
|
- Créez un fichier vide "htdocs/conf/conf.php" et attribuez les permissions
|
||||||
en lecture et écriture pour le user du serveur web (les permissions en
|
en lecture et écriture pour le user du serveur web (les permissions en
|
||||||
écriture seront supprimées une fois l'installation terminée).
|
écriture seront supprimées une fois l'installation terminée).
|
||||||
|
|
||||||
- Depuis votre navigateur, appeler la page "install/" de dolibarr. L'url dépend
|
- Depuis votre navigateur, appelez la page "install/" de dolibarr. L'url dépend
|
||||||
du choix fait à la première etape:
|
du choix fait à la première étape:
|
||||||
http://localhost/dolibarr/htdocs/install/
|
http://localhost/dolibarr/htdocs/install/
|
||||||
ou
|
ou
|
||||||
http://yourdolibarrvirtualhost/install/
|
http://yourdolibarrvirtualhost/install/
|
||||||
|
|
||||||
- Suivez les instructions fournies par l'installeur...
|
- Suivez les instructions fournies par l'installateur...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## METTRE A JOUR DOLIBARR
|
## METTRE A JOUR DOLIBARR
|
||||||
|
|
||||||
Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
|
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
||||||
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
- Ecrasez les vieux fichiers dans le vieux répertoire 'dolibarr' par les fichiers
|
||||||
fournis dans ce nouveau package.
|
fournis dans ce nouveau package.
|
||||||
|
|
||||||
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
|
- Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire).
|
||||||
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||||
|
|
||||||
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||||
|
|
||||||
|
|
||||||
## CE QUI EST NOUVEAU
|
## CE QUI EST NOUVEAU
|
||||||
@ -136,7 +136,7 @@ Dolibarr peut aussi être étendu à volonté avec l'ajout de module/application
|
|||||||
|
|
||||||
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
||||||
|
|
||||||
Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
|
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
|
||||||
- Dolibarr ne contient pas de module de Gestion de la paie.
|
- Dolibarr ne contient pas de module de Gestion de la paie.
|
||||||
- Les tâches du module de gestion de projets n'ont pas de dépendances entre elle.
|
- Les tâches du module de gestion de projets n'ont pas de dépendances entre elle.
|
||||||
- Dolibarr n'embarque pas de Webmail intégré nativement.
|
- Dolibarr n'embarque pas de Webmail intégré nativement.
|
||||||
@ -145,7 +145,7 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
|
|||||||
|
|
||||||
## DOCUMENTATION
|
## DOCUMENTATION
|
||||||
|
|
||||||
Les documentations utilisateur, développeur et traducteur sont disponible sous forme de ressources de la communautés via la site [Wiki](https://wiki.dolibarr.org).
|
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
|
||||||
|
|
||||||
|
|
||||||
## CONTRIBUER
|
## CONTRIBUER
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# DOLIBARR ERP & CRM
|
# DOLIBARR ERP & CRM
|
||||||
|
|
||||||

|

|
||||||
|
[](https://houndci.com)
|
||||||
|
|
||||||
|6|7|8|develop|
|
|6|7|8|develop|
|
||||||
|----------|----------|----------|----------|
|
|----------|----------|----------|----------|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|||||||
2003-2006, Jean-Louis Bergamo <jlb@j1b.org>
|
2003-2006, Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
2003-2013, Laurent Destailleur <eldy@users.sourceforge.net>
|
2003-2013, Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
2003, Xavier Dutoit <doli@sydesy.com>
|
2003, Xavier Dutoit <doli@sydesy.com>
|
||||||
2004-2013, Regis Houssin <regis.houssin@capnetworks.com>
|
2004-2013, Regis Houssin <regis.houssin@inodbox.com>
|
||||||
2004, Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
2004, Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
2004, Benoit Mortier <benoit.mortier@opensides.be>
|
2004, Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
2004, Christophe Combelles <ccomb@free.fr>
|
2004, Christophe Combelles <ccomb@free.fr>
|
||||||
|
|||||||
1
build/debian/source/include-binaries
Normal file
1
build/debian/source/include-binaries
Normal file
@ -0,0 +1 @@
|
|||||||
|
htdocs/install/doctemplates/websites/website_template-corporate.zip
|
||||||
@ -3,18 +3,30 @@ FROM php:7.0-apache
|
|||||||
ENV HOST_USER_ID 33
|
ENV HOST_USER_ID 33
|
||||||
ENV PHP_INI_DATE_TIMEZONE 'UTC'
|
ENV PHP_INI_DATE_TIMEZONE 'UTC'
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
|
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
||||||
&& docker-php-ext-install gd \
|
&& docker-php-ext-install gd \
|
||||||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
||||||
&& docker-php-ext-install ldap \
|
&& docker-php-ext-install ldap \
|
||||||
&& docker-php-ext-install mysqli \
|
&& docker-php-ext-install mysqli \
|
||||||
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
|
&& apt-get purge -y libjpeg-dev libldap2-dev
|
||||||
|
|
||||||
COPY docker-run.sh /usr/local/bin/
|
COPY docker-run.sh /usr/local/bin/
|
||||||
RUN chmod +x /usr/local/bin/docker-run.sh
|
RUN chmod +x /usr/local/bin/docker-run.sh
|
||||||
|
|
||||||
|
RUN pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug
|
||||||
|
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.remote_autostart=0' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.default_enable=0' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.remote_host=docker.for.mac.host.internal' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.profiler_enable=0' >> /usr/local/etc/php/php.ini
|
||||||
|
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
ENTRYPOINT ["docker-run.sh"]
|
ENTRYPOINT ["docker-run.sh"]
|
||||||
|
|||||||
@ -3,42 +3,27 @@ File added into doxygen generated documentation
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<!-- Google analytics -->
|
|
||||||
<script>
|
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
||||||
|
|
||||||
ga('create', 'UA-9049390-16', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<!-- End google analytics -->
|
|
||||||
|
|
||||||
|
|
||||||
<hr class="footer" />
|
<hr class="footer" />
|
||||||
<address class="footer"><small>Generated on $datetime
|
<address class="footer"><small>Generated on $datetime for <a href="https://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
|
||||||
for <a href="https://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Google AdSense -->
|
|
||||||
<div class="center">
|
|
||||||
<script type="text/javascript"><!--
|
|
||||||
google_ad_client = "pub-1071905880519467";
|
|
||||||
/* PUBBANDEAUDOLIBARR */
|
|
||||||
google_ad_slot = "1421205532";
|
|
||||||
google_ad_width = 468;
|
|
||||||
google_ad_height = 60;
|
|
||||||
//-->
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
|
|
||||||
</div>
|
|
||||||
<!-- End google adsense -->
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-9049390-16"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'UA-9049390-16');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- Twitter ad collector -->
|
<!-- Twitter ad collector -->
|
||||||
<script src="//platform.twitter.com/oct.js" type="text/javascript"></script>
|
<script src="//platform.twitter.com/oct.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">twttr.conversion.trackPid('ntm4n', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
|
<script type="text/javascript">twttr.conversion.trackPid('ntm4n', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
|
||||||
|
|||||||
@ -522,12 +522,21 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
|
||||||
|
|
||||||
# Security to avoid to package data files
|
# Security to avoid to package data files
|
||||||
|
print "Remove documents dir\n";
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
||||||
|
|
||||||
|
print "Remove subdir of custom dir\n";
|
||||||
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||||
|
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
||||||
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
||||||
|
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
|
||||||
|
|
||||||
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/abricot*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
|
||||||
@ -542,12 +551,14 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ndf*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ndf*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nomenclature*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/of/`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/oscim*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/oscim*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||||
# Removed other test files
|
# Removed other test files
|
||||||
@ -591,13 +602,6 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||||
|
|
||||||
|
|
||||||
print "Remove subdir of custom dir\n";
|
|
||||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
|
||||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
|
||||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
|
||||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
|
|||||||
@ -30,7 +30,7 @@ return "Regis Houssin";
|
|||||||
# script_dolibarr_versions()
|
# script_dolibarr_versions()
|
||||||
sub script_dolibarr_versions
|
sub script_dolibarr_versions
|
||||||
{
|
{
|
||||||
return ( "7.0.0", "6.0.5", "5.0.7" );
|
return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub script_dolibarr_release
|
sub script_dolibarr_release
|
||||||
@ -263,15 +263,16 @@ if ($upgrade) {
|
|||||||
local @params = ( [ "action", "upgrade" ],
|
local @params = ( [ "action", "upgrade" ],
|
||||||
[ "versionfrom", $upgrade->{'version'} ],
|
[ "versionfrom", $upgrade->{'version'} ],
|
||||||
[ "versionto", $ver ],
|
[ "versionto", $ver ],
|
||||||
|
[ "installlock", "444" ],
|
||||||
);
|
);
|
||||||
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
||||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||||
|
|
||||||
# Remove the installation directory.
|
# Remove the installation directory. (deprecated)
|
||||||
local $dinstall = "$opts->{'dir'}/install";
|
# local $dinstall = "$opts->{'dir'}/install";
|
||||||
$dinstall =~ s/\/$//;
|
# $dinstall =~ s/\/$//;
|
||||||
$out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
# $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -306,15 +307,18 @@ else {
|
|||||||
[ "login", "admin" ],
|
[ "login", "admin" ],
|
||||||
[ "pass", $dompass ],
|
[ "pass", $dompass ],
|
||||||
[ "pass_verif", $dompass ],
|
[ "pass_verif", $dompass ],
|
||||||
|
[ "installlock", "444" ],
|
||||||
);
|
);
|
||||||
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
||||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||||
|
|
||||||
# Remove the installation directory and protect config file.
|
# Remove the installation directory (deprecated)
|
||||||
local $dinstall = "$opts->{'dir'}/install";
|
# local $dinstall = "$opts->{'dir'}/install";
|
||||||
$dinstall =~ s/\/$//;
|
# $dinstall =~ s/\/$//;
|
||||||
$out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
# $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
||||||
|
|
||||||
|
# Protect config file
|
||||||
&set_permissions_as_domain_user($d, 0644, $cfile);
|
&set_permissions_as_domain_user($d, 0644, $cfile);
|
||||||
&set_permissions_as_domain_user($d, 0755, $cfiledir);
|
&set_permissions_as_domain_user($d, 0755, $cfiledir);
|
||||||
}
|
}
|
||||||
@ -386,6 +390,8 @@ sub script_dolibarr_check_latest
|
|||||||
{
|
{
|
||||||
local ($ver) = @_;
|
local ($ver) = @_;
|
||||||
local @vers = &osdn_package_versions("dolibarr",
|
local @vers = &osdn_package_versions("dolibarr",
|
||||||
|
$ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
|
$ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
|
|||||||
@ -177,9 +177,11 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/core
|
%_datadir/dolibarr/htdocs/core
|
||||||
%_datadir/dolibarr/htdocs/cron
|
%_datadir/dolibarr/htdocs/cron
|
||||||
%_datadir/dolibarr/htdocs/custom
|
%_datadir/dolibarr/htdocs/custom
|
||||||
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
%_datadir/dolibarr/htdocs/expedition
|
%_datadir/dolibarr/htdocs/expedition
|
||||||
%_datadir/dolibarr/htdocs/expensereport
|
%_datadir/dolibarr/htdocs/expensereport
|
||||||
%_datadir/dolibarr/htdocs/exports
|
%_datadir/dolibarr/htdocs/exports
|
||||||
@ -212,6 +214,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/takepos
|
||||||
%_datadir/dolibarr/htdocs/ticket
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
|
|||||||
@ -54,7 +54,7 @@ BuildRequires: desktop-file-utils
|
|||||||
Group: Applications/Productivity
|
Group: Applications/Productivity
|
||||||
Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu
|
Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu
|
||||||
Requires: mysql, mysql-client
|
Requires: mysql, mysql-client
|
||||||
%else
|
%else%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
|
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
|
||||||
Group: Productivity/Office/Management
|
Group: Productivity/Office/Management
|
||||||
@ -124,7 +124,7 @@ cui hai bisogno ed essere facile da usare.
|
|||||||
|
|
||||||
%if 0%{?sles_version}
|
%if 0%{?sles_version}
|
||||||
%{__rm} -rf $RPM_BUILD_ROOT
|
%{__rm} -rf $RPM_BUILD_ROOT
|
||||||
%{__mkdir} $RPM_BUILD_ROOT
|
%{__mkdir} $RPM_BUILD_ROOT%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}
|
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}
|
||||||
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
||||||
%else
|
%else
|
||||||
@ -257,9 +257,11 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/core
|
%_datadir/dolibarr/htdocs/core
|
||||||
%_datadir/dolibarr/htdocs/cron
|
%_datadir/dolibarr/htdocs/cron
|
||||||
%_datadir/dolibarr/htdocs/custom
|
%_datadir/dolibarr/htdocs/custom
|
||||||
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
%_datadir/dolibarr/htdocs/expedition
|
%_datadir/dolibarr/htdocs/expedition
|
||||||
%_datadir/dolibarr/htdocs/expensereport
|
%_datadir/dolibarr/htdocs/expensereport
|
||||||
%_datadir/dolibarr/htdocs/exports
|
%_datadir/dolibarr/htdocs/exports
|
||||||
@ -292,6 +294,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/takepos
|
||||||
%_datadir/dolibarr/htdocs/ticket
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
|
|||||||
@ -174,9 +174,11 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/core
|
%_datadir/dolibarr/htdocs/core
|
||||||
%_datadir/dolibarr/htdocs/cron
|
%_datadir/dolibarr/htdocs/cron
|
||||||
%_datadir/dolibarr/htdocs/custom
|
%_datadir/dolibarr/htdocs/custom
|
||||||
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
%_datadir/dolibarr/htdocs/expedition
|
%_datadir/dolibarr/htdocs/expedition
|
||||||
%_datadir/dolibarr/htdocs/expensereport
|
%_datadir/dolibarr/htdocs/expensereport
|
||||||
%_datadir/dolibarr/htdocs/exports
|
%_datadir/dolibarr/htdocs/exports
|
||||||
@ -209,6 +211,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/takepos
|
||||||
%_datadir/dolibarr/htdocs/ticket
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
|
|||||||
@ -185,9 +185,11 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/core
|
%_datadir/dolibarr/htdocs/core
|
||||||
%_datadir/dolibarr/htdocs/cron
|
%_datadir/dolibarr/htdocs/cron
|
||||||
%_datadir/dolibarr/htdocs/custom
|
%_datadir/dolibarr/htdocs/custom
|
||||||
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
%_datadir/dolibarr/htdocs/expedition
|
%_datadir/dolibarr/htdocs/expedition
|
||||||
%_datadir/dolibarr/htdocs/expensereport
|
%_datadir/dolibarr/htdocs/expensereport
|
||||||
%_datadir/dolibarr/htdocs/exports
|
%_datadir/dolibarr/htdocs/exports
|
||||||
@ -220,6 +222,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||||
%_datadir/dolibarr/htdocs/support
|
%_datadir/dolibarr/htdocs/support
|
||||||
%_datadir/dolibarr/htdocs/theme
|
%_datadir/dolibarr/htdocs/theme
|
||||||
|
%_datadir/dolibarr/htdocs/takepos
|
||||||
%_datadir/dolibarr/htdocs/ticket
|
%_datadir/dolibarr/htdocs/ticket
|
||||||
%_datadir/dolibarr/htdocs/user
|
%_datadir/dolibarr/htdocs/user
|
||||||
%_datadir/dolibarr/htdocs/variants
|
%_datadir/dolibarr/htdocs/variants
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
This file describe changes made on external library after beeing included
|
This file describes changes made on external libraries after being included
|
||||||
in Dolibarr root.
|
in Dolibarr root.
|
||||||
|
|
||||||
|
|
||||||
@ -79,16 +79,23 @@ In htdocs/includes/tcpdf/tcpdf.php
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TCPDI:
|
TCPDI:
|
||||||
------
|
------
|
||||||
Add fpdf_tpl.php 1.2
|
Add fpdf_tpl.php 1.2
|
||||||
Add tcpdi.php
|
Add tcpdi.php
|
||||||
|
|
||||||
Add tcpdi_parser.php and replace:
|
Add tcpdi_parser.php and replace:
|
||||||
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
|
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
|
||||||
with:
|
with:
|
||||||
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
|
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
|
||||||
|
|
||||||
|
|
||||||
|
* Fix by replacing
|
||||||
|
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
|
||||||
|
with
|
||||||
|
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JSGANTT:
|
JSGANTT:
|
||||||
|
|||||||
@ -4,4 +4,4 @@ X-Mailer: Dolibarr version 2.7.0-beta (using php mail)
|
|||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
Content-Type: text/html; charset=UTF-8
|
Content-Type: text/html; charset=UTF-8
|
||||||
Content-Transfer-Encoding: 8bit
|
Content-Transfer-Encoding: 8bit
|
||||||
<html><head><title></title></head><body>Testé<br />fdsfsdf<br />fsdf<strong>sfd</strong>s<br />fssdfsd<br /></body></html>
|
<html><head><title></title></head><body>Testé<br>fdsfsdf<br>fsdf<strong>sfd</strong>s<br>fssdfsd<br></body></html>
|
||||||
|
|||||||
@ -185,7 +185,4 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
|||||||
{
|
{
|
||||||
dol_print_error($db,$object->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -218,6 +218,4 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
|||||||
{
|
{
|
||||||
dol_print_error($db,$object->error);
|
dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
# WARNING: This script erase all data of database
|
# WARNING: This script erase all data of database
|
||||||
# with data into dump file
|
# with data into dump file
|
||||||
#
|
#
|
||||||
# Regis Houssin - regis.houssin@capnetworks.com
|
# Regis Houssin - regis.houssin@inodbox.com
|
||||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# Usage: initdemo.sh
|
# Usage: initdemo.sh
|
||||||
|
|||||||
14172
dev/initdemo/mysqldump_dolibarr_8.0.0.sql
Normal file
14172
dev/initdemo/mysqldump_dolibarr_8.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
14215
dev/initdemo/mysqldump_dolibarr_9.0.0.sql
Normal file
14215
dev/initdemo/mysqldump_dolibarr_9.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
|||||||
# Script to remove setup of a Dolibarr installation.
|
# Script to remove setup of a Dolibarr installation.
|
||||||
# Note: "dialog" tool need to be available.
|
# Note: "dialog" tool need to be available.
|
||||||
#
|
#
|
||||||
# Regis Houssin - regis.houssin@capnetworks.com
|
# Regis Houssin - regis.houssin@inodbox.com
|
||||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# WARNING: This script erase setup of instance,
|
# WARNING: This script erase setup of instance,
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# Script to extrac a database with demo values.
|
# Script to extrac a database with demo values.
|
||||||
# Note: "dialog" tool need to be available if no parameter provided.
|
# Note: "dialog" tool need to be available if no parameter provided.
|
||||||
#
|
#
|
||||||
# Regis Houssin - regis.houssin@capnetworks.com
|
# Regis Houssin - regis.houssin@inodbox.com
|
||||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# Usage: savedemo.sh
|
# Usage: savedemo.sh
|
||||||
@ -171,6 +171,8 @@ export list="
|
|||||||
--ignore-table=$base.llx_abonne_extrafields
|
--ignore-table=$base.llx_abonne_extrafields
|
||||||
--ignore-table=$base.llx_abonne_type
|
--ignore-table=$base.llx_abonne_type
|
||||||
--ignore-table=$base.llx_abonnement
|
--ignore-table=$base.llx_abonnement
|
||||||
|
--ignore-table=$base.llx_accountingaccount
|
||||||
|
--ignore-table=$base.llx_accountingsystem
|
||||||
--ignore-table=$base.llx_advanced_extrafields
|
--ignore-table=$base.llx_advanced_extrafields
|
||||||
--ignore-table=$base.llx_advanced_extrafields_options
|
--ignore-table=$base.llx_advanced_extrafields_options
|
||||||
--ignore-table=$base.llx_advanced_extrafields_values
|
--ignore-table=$base.llx_advanced_extrafields_values
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_qb8akM37EdqwVrslYOdUDA">
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_w8IxIM37EdqwVrslYOdUDA" name="dolibarr">
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_T5aZ4FK9Ed60vaZbVikprw" name="OrdersModule"/>
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_ZhuGMlK9Ed60vaZbVikprw" name="InvoiceModule"/>
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_cf3SUlK9Ed60vaZbVikprw" name="UserModule"/>
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_maM0glK9Ed60vaZbVikprw" name="FoundationModule"/>
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_oqTO4lK9Ed60vaZbVikprw" name="ContractsModule"/>
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_rEq_klK9Ed60vaZbVikprw" name="ProposalsModule"/>
|
|
||||||
<packagedElement xmi:type="uml:Package" xmi:id="_vxYmUlK9Ed60vaZbVikprw" name="EMailingManagement"/>
|
|
||||||
</packagedElement>
|
|
||||||
</uml:Model>
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<diagrams:Diagrams xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.topcased.org/DI/1.0" xmlns:diagrams="http://www.topcased.org/Diagrams/1.0" xmi:id="_SI6FkFK9Ed60vaZbVikprw" activeDiagram="_SI6FkVK9Ed60vaZbVikprw">
|
|
||||||
<model href="dolibarr.uml#_w8IxIM37EdqwVrslYOdUDA"/>
|
|
||||||
<diagrams xmi:id="_SI6FkVK9Ed60vaZbVikprw" position="0,0" size="100,100" name="dolibarr" viewport="0,0">
|
|
||||||
<property xmi:id="_SJ9OcFK9Ed60vaZbVikprw" key="pageFormatName" value="A4"/>
|
|
||||||
<property xmi:id="_SJ9OcVK9Ed60vaZbVikprw" key="diagramWidth" value="840"/>
|
|
||||||
<property xmi:id="_SJ9OclK9Ed60vaZbVikprw" key="diagramHeight" value="1188"/>
|
|
||||||
<property xmi:id="_SJ9Oc1K9Ed60vaZbVikprw" key="pageMarginName" value="Small Margin"/>
|
|
||||||
<property xmi:id="_SJ9OdFK9Ed60vaZbVikprw" key="diagramTopMargin" value="20"/>
|
|
||||||
<property xmi:id="_SJ9OdVK9Ed60vaZbVikprw" key="diagramBottomMargin" value="20"/>
|
|
||||||
<property xmi:id="_SJ9OdlK9Ed60vaZbVikprw" key="diagramLeftMargin" value="20"/>
|
|
||||||
<property xmi:id="_SJ9Od1K9Ed60vaZbVikprw" key="diagramRightMargin" value="20"/>
|
|
||||||
<property xmi:id="_SJ9OeFK9Ed60vaZbVikprw" key="orientation" value="portrait"/>
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_SI6FklK9Ed60vaZbVikprw" presentation="org.topcased.modeler.uml.classdiagram">
|
|
||||||
<element href="dolibarr.uml#_w8IxIM37EdqwVrslYOdUDA"/>
|
|
||||||
</semanticModel>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_T2b-YFK9Ed60vaZbVikprw" position="15,190" size="176,81">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_T2b-YVK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_T5aZ4FK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_ZhuGMFK9Ed60vaZbVikprw" position="15,118" size="177,68">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_ZhuGMVK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_ZhuGMlK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_cf3SUFK9Ed60vaZbVikprw" position="15,10" size="174,81">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_cf3SUVK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_cf3SUlK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_maM0gFK9Ed60vaZbVikprw" position="291,118" size="145,73">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_maM0gVK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_maM0glK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_oqTO4FK9Ed60vaZbVikprw" position="15,274" size="179,80">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_oqTO4VK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_oqTO4lK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_rEq_kFK9Ed60vaZbVikprw" position="15,358" size="181,73">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_rEq_kVK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_rEq_klK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
<contained xsi:type="di:GraphNode" xmi:id="_vxYmUFK9Ed60vaZbVikprw" position="15,490" size="181,80">
|
|
||||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_vxYmUVK9Ed60vaZbVikprw" presentation="default">
|
|
||||||
<element href="dolibarr.uml#_vxYmUlK9Ed60vaZbVikprw"/>
|
|
||||||
</semanticModel>
|
|
||||||
</contained>
|
|
||||||
</diagrams>
|
|
||||||
</diagrams:Diagrams>
|
|
||||||
Binary file not shown.
@ -173,6 +173,7 @@
|
|||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
||||||
|
|
||||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
||||||
|
|
||||||
|
|||||||
@ -11,15 +11,15 @@ informations on Dolibarr.<br>
|
|||||||
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this
|
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this
|
||||||
on Internet on web following sites:<br>
|
on Internet on web following sites:<br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="http://wiki.dolibarr.org">Dolibarr wiki (documentation)</a><br>
|
* <a href="https://wiki.dolibarr.org">Dolibarr wiki (documentation)</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="http://www.dolibarr.org">Dolibarr portal (official website)</a><br>
|
* <a href="https://www.dolibarr.org">Dolibarr portal (official website)</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="http://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="http://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
|
* <a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="http://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -7,12 +7,12 @@ Download
|
|||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
||||||
http://sourceforge.net/projects/dolibarr/files
|
https://sourceforge.net/projects/dolibarr/files
|
||||||
or from Dolibarr official web site:
|
or from Dolibarr official web site:
|
||||||
http://www.dolibarr.org
|
https://www.dolibarr.org
|
||||||
|
|
||||||
* Most external modules are only available on DoliStore:
|
* Most external modules are only available on DoliStore:
|
||||||
http://www.dolistore.org
|
https://www.dolistore.com
|
||||||
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@ -22,4 +22,4 @@ Install
|
|||||||
* For a Quick guide, take a look at README file into root directory.
|
* For a Quick guide, take a look at README file into root directory.
|
||||||
|
|
||||||
* More complete documentations are also available on line on the Dolibarr Wiki:
|
* More complete documentations are also available on line on the Dolibarr Wiki:
|
||||||
http://wiki.dolibarr.org
|
https://wiki.dolibarr.org
|
||||||
|
|||||||
33
doc/install/README-DE
Normal file
33
doc/install/README-DE
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
README (deutsch / german / allemand)
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
Download / Herunterladen
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
|
||||||
|
https://www.dolibarr.org/downloads
|
||||||
|
oder direkt von Sourceforge
|
||||||
|
https://sourceforge.net/projects/dolibarr/files/
|
||||||
|
herunterladen.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* Die meisten externen Module/Themens sind über den DoliStore verfügbar:
|
||||||
|
https://www.dolistore.com/de/
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
Installation
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
|
||||||
|
|
||||||
|
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||||
|
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||||
|
|
||||||
|
* eine Deutsche Community bietet der Dolibarr e.V. unter
|
||||||
|
https://www.dolibarr.de/
|
||||||
|
|
||||||
|
|
||||||
@ -9,19 +9,19 @@ Téléchargement
|
|||||||
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
||||||
http://sourceforge.net/projects/dolibarr/files
|
http://sourceforge.net/projects/dolibarr/files
|
||||||
or from Dolibarr official web site:
|
or from Dolibarr official web site:
|
||||||
http://www.dolibarr.org
|
https://www.dolibarr.org
|
||||||
|
|
||||||
* Most external modules are only available on DoliStore:
|
* Most external modules are only available on DoliStore:
|
||||||
http://www.dolistore.org
|
https://www.dolistore.org
|
||||||
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
Documentation utilisateur
|
Documentation utilisateur
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
* Pour une prise en main et installation rapide, consulter le fichier
|
* Pour une prise en main et installation rapide, consultez le fichier
|
||||||
README-FR à la racine.
|
README-FR à la racine.
|
||||||
|
|
||||||
* Une documentation utilisateur francophone plus consistente est disponible en
|
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||||
ligne sur le wiki de Dolibarr à l'adresse:
|
ligne sur le wiki de Dolibarr à l'adresse:
|
||||||
http://wiki.dolibarr.org
|
https://wiki.dolibarr.org
|
||||||
|
|||||||
@ -4,4 +4,4 @@ User guide
|
|||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
||||||
http://www.dolibarr.org
|
https://www.dolibarr.org
|
||||||
|
|||||||
@ -3,9 +3,9 @@ README (french)
|
|||||||
Documentation utilisateur
|
Documentation utilisateur
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
* Pour une prise en main et installation rapide, consulter le fichier
|
* Pour une prise en main et installation rapide, consultez le fichier
|
||||||
README-FR à la racine.
|
README-FR à la racine.
|
||||||
|
|
||||||
* Une documentation utilisateur francophone plus consistente est disponible en
|
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||||
ligne sur le site Web de Dolibarr à l'adresse:
|
ligne sur le site Web de Dolibarr à l'adresse:
|
||||||
http://www.dolibarr.fr
|
https://www.dolibarr.fr
|
||||||
|
|||||||
6
htdocs/.gitignore
vendored
6
htdocs/.gitignore
vendored
@ -23,4 +23,8 @@
|
|||||||
/cabinetmed*
|
/cabinetmed*
|
||||||
/webmail*
|
/webmail*
|
||||||
/conf/conf.php
|
/conf/conf.php
|
||||||
/subtotal/
|
/subtotal*
|
||||||
|
/abricot*
|
||||||
|
/nomenclature*
|
||||||
|
/of/
|
||||||
|
/workstation/
|
||||||
|
|||||||
@ -38,11 +38,11 @@ $id = GETPOST('id', 'int');
|
|||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist'; // To manage different context of search
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist'; // To manage different context of search
|
||||||
|
|
||||||
$search_account = GETPOST("search_account");
|
$search_account = GETPOST('search_account','alpha');
|
||||||
$search_label = GETPOST("search_label");
|
$search_label = GETPOST('search_label','alpha');
|
||||||
$search_accountparent = GETPOST("search_accountparent");
|
$search_accountparent = GETPOST('search_accountparent','alpha');
|
||||||
$search_pcgtype = GETPOST("search_pcgtype");
|
$search_pcgtype = GETPOST('search_pcgtype','alpha');
|
||||||
$search_pcgsubtype = GETPOST("search_pcgsubtype");
|
$search_pcgsubtype = GETPOST('search_pcgsubtype','alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->societe_id > 0) accessforbidden();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||||
@ -44,7 +44,7 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm"));
|
$langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm"));
|
||||||
|
|
||||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view';
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$id=31;
|
$id=31;
|
||||||
$rowid=GETPOST('rowid','alpha');
|
$rowid=GETPOST('rowid','alpha');
|
||||||
@ -55,8 +55,8 @@ $acts[1] = "disable";
|
|||||||
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
|
||||||
$listoffset=GETPOST('listoffset');
|
$listoffset=GETPOST('listoffset','alpha');
|
||||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
|
$listlimit=GETPOST('listlimit','int')>0?GETPOST('listlimit','int'):1000;
|
||||||
$active = 1;
|
$active = 1;
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'aZ09comma');
|
$sortfield = GETPOST("sortfield",'aZ09comma');
|
||||||
@ -139,13 +139,13 @@ $sourceList=array();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
|
if (GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter_x','alpha'))
|
||||||
{
|
{
|
||||||
$search_country_id = '';
|
$search_country_id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions add or modify an entry into a dictionary
|
// Actions add or modify an entry into a dictionary
|
||||||
if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
|
||||||
{
|
{
|
||||||
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
||||||
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
||||||
@ -235,7 +235,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // 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
|
// Si verif ok et action add, on ajoute la ligne
|
||||||
if ($ok && GETPOST('actionadd'))
|
if ($ok && GETPOST('actionadd','alpha'))
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id])
|
if ($tabrowid[$id])
|
||||||
{
|
{
|
||||||
@ -247,7 +247,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$newid=($obj->newid + 1);
|
$newid=($obj->newid + 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -300,7 +299,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
// Si verif ok et action modify, on modifie la ligne
|
||||||
if ($ok && GETPOST('actionmodify'))
|
if ($ok && GETPOST('actionmodify','alpha'))
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
else { $rowidcol="rowid"; }
|
else { $rowidcol="rowid"; }
|
||||||
@ -341,7 +340,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('actioncancel'))
|
if (GETPOST('actioncancel','alpha'))
|
||||||
{
|
{
|
||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
@ -560,7 +559,7 @@ if ($id)
|
|||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd'))
|
if (GETPOST('actionadd','alpha'))
|
||||||
{
|
{
|
||||||
foreach ($fieldlist as $key=>$val)
|
foreach ($fieldlist as $key=>$val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -41,6 +41,7 @@ $id = GETPOST('id', 'int');
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
|
$accountingaccount = GETPOST('accountingaccount','alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
|
||||||
@ -73,25 +74,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||||||
// To manage zero or not at the end of the accounting account
|
// To manage zero or not at the end of the accounting account
|
||||||
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
||||||
{
|
{
|
||||||
$account_number = GETPOST('account_number');
|
$account_number = GETPOST('account_number','string');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$account_number = clean_account(GETPOST('account_number'));
|
$account_number = clean_account(GETPOST('account_number','string'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('account_parent') <= 0) {
|
if (GETPOST('account_parent','int') <= 0)
|
||||||
|
{
|
||||||
$account_parent = 0;
|
$account_parent = 0;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$account_parent = GETPOST('account_parent','int');
|
$account_parent = GETPOST('account_parent','int');
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->fk_pcg_version = $obj->pcg_version;
|
$object->fk_pcg_version = $obj->pcg_version;
|
||||||
$object->pcg_type = GETPOST('pcg_type');
|
$object->pcg_type = GETPOST('pcg_type','alpha');
|
||||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
$object->pcg_subtype = GETPOST('pcg_subtype','alpha');
|
||||||
$object->account_number = $account_number;
|
$object->account_number = $account_number;
|
||||||
$object->account_parent = $account_parent;
|
$object->account_parent = $account_parent;
|
||||||
$object->account_category = GETPOST('account_category');
|
$object->account_category = GETPOST('account_category','alpha');
|
||||||
$object->label = GETPOST('label', 'alpha');
|
$object->label = GETPOST('label', 'alpha');
|
||||||
$object->active = 1;
|
$object->active = 1;
|
||||||
|
|
||||||
@ -135,25 +139,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||||||
// To manage zero or not at the end of the accounting account
|
// To manage zero or not at the end of the accounting account
|
||||||
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
||||||
{
|
{
|
||||||
$account_number = GETPOST('account_number');
|
$account_number = GETPOST('account_number','string');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$account_number = clean_account(GETPOST('account_number'));
|
$account_number = clean_account(GETPOST('account_number','string'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('account_parent') <= 0) {
|
if (GETPOST('account_parent','int') <= 0)
|
||||||
|
{
|
||||||
$account_parent = 0;
|
$account_parent = 0;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$account_parent = GETPOST('account_parent','int');
|
$account_parent = GETPOST('account_parent','int');
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->fk_pcg_version = $obj->pcg_version;
|
$object->fk_pcg_version = $obj->pcg_version;
|
||||||
$object->pcg_type = GETPOST('pcg_type');
|
$object->pcg_type = GETPOST('pcg_type','alpha');
|
||||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
$object->pcg_subtype = GETPOST('pcg_subtype','alpha');
|
||||||
$object->account_number = $account_number;
|
$object->account_number = $account_number;
|
||||||
$object->account_parent = $account_parent;
|
$object->account_parent = $account_parent;
|
||||||
$object->account_category = GETPOST('account_category');
|
$object->account_category = GETPOST('account_category','alpha');
|
||||||
$object->label = GETPOST('label', 'alpha');
|
$object->label = GETPOST('label', 'alpha');
|
||||||
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
@ -223,7 +230,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||||
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"></td></tr>';
|
print '<td><input name="account_number" size="30" value="' . $accountingaccount . '"></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||||
|
|||||||
@ -37,9 +37,9 @@ $id = GETPOST('id', 'int');
|
|||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
$action = GETPOST('action','aZ09');
|
$action = GETPOST('action','aZ09');
|
||||||
$cat_id = GETPOST('account_category');
|
$cat_id = GETPOST('account_category','int');
|
||||||
$selectcpt = GETPOST('cpt_bk', 'array');
|
$selectcpt = GETPOST('cpt_bk', 'array');
|
||||||
$cpt_id = GETPOST('cptid');
|
$cpt_id = GETPOST('cptid','int');
|
||||||
|
|
||||||
if ($cat_id == 0) {
|
if ($cat_id == 0) {
|
||||||
$cat_id = null;
|
$cat_id = null;
|
||||||
|
|||||||
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("errors","admin","companies","resource","holiday","accountancy","hrm"));
|
$langs->loadLangs(array("errors","admin","companies","resource","holiday","accountancy","hrm"));
|
||||||
|
|
||||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view';
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$id=32;
|
$id=32;
|
||||||
$rowid=GETPOST('rowid','alpha');
|
$rowid=GETPOST('rowid','alpha');
|
||||||
@ -51,8 +51,8 @@ $acts[1] = "disable";
|
|||||||
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
|
||||||
$listoffset=GETPOST('listoffset');
|
$listoffset=GETPOST('listoffset','alpha');
|
||||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
|
$listlimit=GETPOST('listlimit','int')>0?GETPOST('listlimit','int'):1000;
|
||||||
$active = 1;
|
$active = 1;
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'aZ09comma');
|
$sortfield = GETPOST("sortfield",'aZ09comma');
|
||||||
@ -134,13 +134,13 @@ $sourceList=array();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
|
if (GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter_x','alpha'))
|
||||||
{
|
{
|
||||||
$search_country_id = '';
|
$search_country_id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions add or modify an entry into a dictionary
|
// Actions add or modify an entry into a dictionary
|
||||||
if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
|
||||||
{
|
{
|
||||||
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
||||||
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
||||||
@ -202,7 +202,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$newid=($obj->newid + 1);
|
$newid=($obj->newid + 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -250,7 +249,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
// Si verif ok et action modify, on modifie la ligne
|
||||||
if ($ok && GETPOST('actionmodify'))
|
if ($ok && GETPOST('actionmodify','alpha'))
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
else { $rowidcol="rowid"; }
|
else { $rowidcol="rowid"; }
|
||||||
@ -291,7 +290,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('actioncancel'))
|
if (GETPOST('actioncancel','alpha'))
|
||||||
{
|
{
|
||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
@ -513,7 +512,7 @@ if ($id)
|
|||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd'))
|
if (GETPOST('actionadd','alpha'))
|
||||||
{
|
{
|
||||||
foreach ($fieldlist as $key=>$val)
|
foreach ($fieldlist as $key=>$val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (empty($user->rights->accounting->chartofaccount))
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
|
|
||||||
$list_account_main = array (
|
$list_account_main = array (
|
||||||
@ -76,7 +76,7 @@ $list_account = array (
|
|||||||
$accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
|
$accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
|
||||||
|
|
||||||
|
|
||||||
if (GETPOST('change_chart'))
|
if (GETPOST('change_chart', 'alpha'))
|
||||||
{
|
{
|
||||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||||
|
|
||||||
|
|||||||
@ -41,10 +41,10 @@ if (empty($user->rights->accounting->chartofaccount))
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Parameters ACCOUNTING_EXPORT_*
|
// Parameters ACCOUNTING_EXPORT_*
|
||||||
$main_option = array (
|
$main_option = array(
|
||||||
'ACCOUNTING_EXPORT_PREFIX_SPEC',
|
'ACCOUNTING_EXPORT_PREFIX_SPEC',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ if (empty($user->rights->accounting->fiscalyear))
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ if ($action == 'create')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Label") . '</td><td><input name="label" size="32" value="' . GETPOST("label") . '"></td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Label") . '</td><td><input name="label" size="32" value="' . GETPOST('label', 'alpha') . '"></td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
||||||
@ -183,7 +183,7 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">' . $langs->trans("Status") . '</td>';
|
print '<td class="fieldrequired">' . $langs->trans("Status") . '</td>';
|
||||||
print '<td class="valeur">';
|
print '<td class="valeur">';
|
||||||
print $form->selectarray('statut', $statut2label, GETPOST('statut'));
|
print $form->selectarray('statut', $statut2label, GETPOST('statut', 'int'));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -71,10 +72,10 @@ if ($_POST["action"] == 'import') {
|
|||||||
|
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
|
|
||||||
$monLabel = GETPOST('label' . $maLigneCochee);
|
$monLabel = (string) GETPOST('label' . $maLigneCochee);
|
||||||
$monParentAccount = GETPOST('AccountParent' . $maLigneCochee);
|
$monParentAccount = (string) GETPOST('AccountParent' . $maLigneCochee);
|
||||||
$monType = GETPOST('pcgType' . $maLigneCochee);
|
$monType = (string) GETPOST('pcgType' . $maLigneCochee);
|
||||||
$monSubType = GETPOST('pcgSubType' . $maLigneCochee);
|
$monSubType = (string) GETPOST('pcgSubType' . $maLigneCochee);
|
||||||
|
|
||||||
$accounting->fk_pcg_version = $obj->pcg_version;
|
$accounting->fk_pcg_version = $obj->pcg_version;
|
||||||
$accounting->account_number = $maLigneCochee;
|
$accounting->account_number = $maLigneCochee;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ if (empty($user->rights->accounting->chartofaccount))
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Parameters ACCOUNTING_* and others
|
// Parameters ACCOUNTING_* and others
|
||||||
$list = array (
|
$list = array (
|
||||||
|
|||||||
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("admin","compta","accountancy"));
|
$langs->loadLangs(array("admin","compta","accountancy"));
|
||||||
|
|
||||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view';
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$id=35;
|
$id=35;
|
||||||
$rowid=GETPOST('rowid','alpha');
|
$rowid=GETPOST('rowid','alpha');
|
||||||
@ -51,8 +51,8 @@ $acts[1] = "disable";
|
|||||||
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
|
||||||
$listoffset=GETPOST('listoffset');
|
$listoffset=GETPOST('listoffset', 'alpha');
|
||||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
|
$listlimit=GETPOST('listlimit', 'int')>0?GETPOST('listlimit', 'int'):1000;
|
||||||
$active = 1;
|
$active = 1;
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -143,13 +143,13 @@ $sourceList = array(
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
|
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha'))
|
||||||
{
|
{
|
||||||
$search_country_id = '';
|
$search_country_id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions add or modify an entry into a dictionary
|
// Actions add or modify an entry into a dictionary
|
||||||
if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
||||||
{
|
{
|
||||||
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
||||||
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
||||||
@ -190,7 +190,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // 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
|
// Si verif ok et action add, on ajoute la ligne
|
||||||
if ($ok && GETPOST('actionadd'))
|
if ($ok && GETPOST('actionadd', 'alpha'))
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id])
|
if ($tabrowid[$id])
|
||||||
{
|
{
|
||||||
@ -202,7 +202,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$newid=($obj->newid + 1);
|
$newid=($obj->newid + 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -252,7 +251,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
// Si verif ok et action modify, on modifie la ligne
|
||||||
if ($ok && GETPOST('actionmodify'))
|
if ($ok && GETPOST('actionmodify', 'alpha'))
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
else { $rowidcol="rowid"; }
|
else { $rowidcol="rowid"; }
|
||||||
@ -294,7 +293,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (GETPOST('actioncancel'))
|
//if (GETPOST('actioncancel', 'alpha'))
|
||||||
//{
|
//{
|
||||||
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
//}
|
//}
|
||||||
@ -462,7 +461,7 @@ if ($id)
|
|||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd'))
|
if (GETPOST('actionadd', 'alpha'))
|
||||||
{
|
{
|
||||||
foreach ($fieldlist as $key=>$val)
|
foreach ($fieldlist as $key=>$val)
|
||||||
{
|
{
|
||||||
@ -504,7 +503,7 @@ if ($id)
|
|||||||
$paramwithsearch = $param;
|
$paramwithsearch = $param;
|
||||||
if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder;
|
if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder;
|
||||||
if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield;
|
if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield;
|
||||||
if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha');
|
if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.GETPOST('from','alpha');
|
||||||
|
|
||||||
// There is several pages
|
// There is several pages
|
||||||
if ($num > $listlimit)
|
if ($num > $listlimit)
|
||||||
|
|||||||
@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// search & action GETPOST
|
// search & action GETPOST
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$codeventil_buy = GETPOST('codeventil_buy', 'array');
|
$codeventil_buy = GETPOST('codeventil_buy', 'array');
|
||||||
$codeventil_sell = GETPOST('codeventil_sell', 'array');
|
$codeventil_sell = GETPOST('codeventil_sell', 'array');
|
||||||
$chk_prod = GETPOST('chk_prod', 'array');
|
$chk_prod = GETPOST('chk_prod', 'array');
|
||||||
@ -62,8 +62,8 @@ $search_current_account_valid = GETPOST('search_current_account_valid', 'alpha')
|
|||||||
if ($search_current_account_valid == '') $search_current_account_valid='withoutvalidaccount';
|
if ($search_current_account_valid == '') $search_current_account_valid='withoutvalidaccount';
|
||||||
|
|
||||||
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
|
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
|
||||||
$btn_changeaccount = GETPOST('changeaccount');
|
$btn_changeaccount = GETPOST('changeaccount', 'alpha');
|
||||||
$btn_changetype = GETPOST('changetype');
|
$btn_changetype = GETPOST('changetype', 'alpha');
|
||||||
|
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -173,7 +173,6 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
$cpt++;
|
$cpt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ko) setEventMessages($langs->trans("XLineFailedToBeBinded", $ko), null, 'errors');
|
if ($ko) setEventMessages($langs->trans("XLineFailedToBeBinded", $ko), null, 'errors');
|
||||||
|
|||||||
@ -41,9 +41,24 @@ $langs->loadLangs(array("accountancy"));
|
|||||||
$page = GETPOST("page");
|
$page = GETPOST("page");
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
||||||
|
|
||||||
|
// Load variable for pagination
|
||||||
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
|
$page = GETPOST('page','int');
|
||||||
|
if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
//if (! $sortfield) $sortfield="p.date_fin";
|
||||||
|
//if (! $sortorder) $sortorder="DESC";
|
||||||
|
|
||||||
|
|
||||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||||
|
|
||||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||||
if ($search_accountancy_code_start == - 1) {
|
if ($search_accountancy_code_start == - 1) {
|
||||||
@ -54,14 +69,6 @@ if ($search_accountancy_code_end == - 1) {
|
|||||||
$search_accountancy_code_end = '';
|
$search_accountancy_code_end = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
|
||||||
|
|
||||||
|
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
|
||||||
|
|
||||||
$offset = $limit * $page;
|
|
||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
@ -97,26 +104,29 @@ if ($sortorder == "")
|
|||||||
if ($sortfield == "")
|
if ($sortfield == "")
|
||||||
$sortfield = "t.numero_compte";
|
$sortfield = "t.numero_compte";
|
||||||
|
|
||||||
$options = '';
|
|
||||||
|
$param='';
|
||||||
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
|
|
||||||
$filter = array ();
|
$filter = array ();
|
||||||
if (! empty($search_date_start)) {
|
if (! empty($search_date_start)) {
|
||||||
$filter['t.doc_date>='] = $search_date_start;
|
$filter['t.doc_date>='] = $search_date_start;
|
||||||
$options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||||
}
|
}
|
||||||
if (! empty($search_date_end)) {
|
if (! empty($search_date_end)) {
|
||||||
$filter['t.doc_date<='] = $search_date_end;
|
$filter['t.doc_date<='] = $search_date_end;
|
||||||
$options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||||
}
|
}
|
||||||
if (! empty($search_accountancy_code_start)) {
|
if (! empty($search_accountancy_code_start)) {
|
||||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||||
$options .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
$param .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
||||||
}
|
}
|
||||||
if (! empty($search_accountancy_code_end)) {
|
if (! empty($search_accountancy_code_end)) {
|
||||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||||
$options .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
|
$param .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
@ -130,14 +140,20 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
$filter = array();
|
$filter = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'export_csv') {
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($action == 'export_csv')
|
||||||
|
{
|
||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
$filename = 'balance';
|
$filename = 'balance';
|
||||||
|
$type_export = 'balance';
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
$result = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
$result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
@ -156,11 +172,6 @@ if ($action == 'export_csv') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
$title_page = $langs->trans("AccountBalance");
|
$title_page = $langs->trans("AccountBalance");
|
||||||
|
|
||||||
llxHeader('', $title_page);
|
llxHeader('', $title_page);
|
||||||
@ -193,7 +204,8 @@ if ($action != 'export_csv')
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0);
|
|
||||||
|
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
@ -231,12 +243,12 @@ if ($action != 'export_csv')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$total_debit = 0;
|
$total_debit = 0;
|
||||||
@ -253,7 +265,7 @@ if ($action != 'export_csv')
|
|||||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||||
if (empty($description)) {
|
if (empty($description)) {
|
||||||
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
$link = '<a href="../admin/card.php?action=create&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -262,7 +274,7 @@ if ($action != 'export_csv')
|
|||||||
{
|
{
|
||||||
// Affiche un Sous-Total par compte comptable
|
// Affiche un Sous-Total par compte comptable
|
||||||
if ($displayed_account != "") {
|
if ($displayed_account != "") {
|
||||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit - $sous_total_debit) . '</td>';
|
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
|
||||||
print "<td> </td>\n";
|
print "<td> </td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -293,17 +305,16 @@ if ($action != 'export_csv')
|
|||||||
$sous_total_credit += $line->credit;
|
$sous_total_credit += $line->credit;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit - $sous_total_debit) . '</td>';
|
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
|
||||||
print "<td> </td>\n";
|
print "<td> </td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">' . price($total_debit) . '</td><td class="nowrap" align="right">' . price($total_credit) . '</td><td class="nowrap" align="right">' . price($total_credit - $total_debit) . '</td>';
|
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">' . price($total_debit) . '</td><td class="nowrap" align="right">' . price($total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($total_credit - $total_debit)) . '</td>';
|
||||||
print "<td> </td>\n";
|
print "<td> </td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -85,7 +85,7 @@ print '<td align="center">' . $langs->trans("SeptemberMin") . '</td>';
|
|||||||
print '<td align="center">' . $langs->trans("OctoberMin") . '</td>';
|
print '<td align="center">' . $langs->trans("OctoberMin") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("NovemberMin") . '</td>';
|
print '<td align="center">' . $langs->trans("NovemberMin") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("DecemberMin") . '</td>';
|
print '<td align="center">' . $langs->trans("DecemberMin") . '</td>';
|
||||||
print '<td align="center"><b>Total</b></td>';
|
print '<td align="center"><strong>Total</strong></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$sql = "SELECT bk.numero_compte AS 'compte',";
|
$sql = "SELECT bk.numero_compte AS 'compte',";
|
||||||
@ -129,7 +129,7 @@ if ($resql) {
|
|||||||
print '<td align="right" width="6.5%">' . price($row[10]) . '</td>';
|
print '<td align="right" width="6.5%">' . price($row[10]) . '</td>';
|
||||||
print '<td align="right" width="6.5%">' . price($row[11]) . '</td>';
|
print '<td align="right" width="6.5%">' . price($row[11]) . '</td>';
|
||||||
print '<td align="right" width="6.5%">' . price($row[12]) . '</td>';
|
print '<td align="right" width="6.5%">' . price($row[12]) . '</td>';
|
||||||
print '<td align="right" width="8%"><b>' . price($row[13]) . '</b></td>';
|
print '<td align="right" width="8%"><strong>' . price($row[13]) . '</strong></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i ++;
|
$i ++;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("accountancy", "bills", "compta"));
|
$langs->loadLangs(array("accountancy", "bills", "compta"));
|
||||||
@ -49,12 +50,21 @@ if ($user->societe_id > 0) {
|
|||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$account_number = GETPOST('account_number','alphanohtml');
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
$accountingjournal = new AccountingJournal($db);
|
||||||
|
|
||||||
|
$accountingaccount_number = GETPOST('accountingaccount_number','alphanohtml');
|
||||||
|
$accountingaccount->fetch(null, $accountingaccount_number, true);
|
||||||
|
$accountingaccount_label = $accountingaccount->label;
|
||||||
|
|
||||||
|
$journal_code = GETPOST('code_journal','alpha');
|
||||||
|
$accountingjournal->fetch(null, $journal_code);
|
||||||
|
$journal_label = $accountingjournal->label;
|
||||||
|
|
||||||
$subledger_account = GETPOST('subledger_account','alphanohtml');
|
$subledger_account = GETPOST('subledger_account','alphanohtml');
|
||||||
if ($subledger_account == - 1) {
|
if ($subledger_account == - 1) {
|
||||||
$subledger_account = null;
|
$subledger_account = null;
|
||||||
}
|
}
|
||||||
$label_compte = GETPOST('label_compte','alphanohtml');
|
|
||||||
$label_operation= GETPOST('label_operation','alphanohtml');
|
$label_operation= GETPOST('label_operation','alphanohtml');
|
||||||
$debit = price2num(GETPOST('debit','alpha'));
|
$debit = price2num(GETPOST('debit','alpha'));
|
||||||
$credit = price2num(GETPOST('credit','alpha'));
|
$credit = price2num(GETPOST('credit','alpha'));
|
||||||
@ -80,7 +90,7 @@ if ($action == "confirm_update") {
|
|||||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||||
$action='update';
|
$action='update';
|
||||||
}
|
}
|
||||||
if (empty($account_number) || $account_number == '-1')
|
if (empty($accountingaccount_number) || $accountingaccount_number == '-1')
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||||
@ -96,9 +106,9 @@ if ($action == "confirm_update") {
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
$object->numero_compte = $account_number;
|
$object->numero_compte = $accountingaccount_number;
|
||||||
$object->subledger_account = $subledger_account;
|
$object->subledger_account = $subledger_account;
|
||||||
$object->label_compte = $label_compte;
|
$object->label_compte = $accountingaccount_label;
|
||||||
$object->label_operation= $label_operation;
|
$object->label_operation= $label_operation;
|
||||||
$object->debit = $debit;
|
$object->debit = $debit;
|
||||||
$object->credit = $credit;
|
$object->credit = $credit;
|
||||||
@ -139,7 +149,7 @@ else if ($action == "add") {
|
|||||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
if (empty($account_number) || $account_number == '-1')
|
if (empty($accountingaccount_number) || $accountingaccount_number == '-1')
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||||
@ -149,9 +159,9 @@ else if ($action == "add") {
|
|||||||
if (! $error) {
|
if (! $error) {
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
$object->numero_compte = $account_number;
|
$object->numero_compte = $accountingaccount_number;
|
||||||
$object->subledger_account = $subledger_account;
|
$object->subledger_account = $subledger_account;
|
||||||
$object->label_compte = $label_compte;
|
$object->label_compte = $accountingaccount_label;
|
||||||
$object->label_operation= $label_operation;
|
$object->label_operation= $label_operation;
|
||||||
$object->debit = $debit;
|
$object->debit = $debit;
|
||||||
$object->credit = $credit;
|
$object->credit = $credit;
|
||||||
@ -159,7 +169,8 @@ else if ($action == "add") {
|
|||||||
$object->doc_type = GETPOST('doc_type','alpha');
|
$object->doc_type = GETPOST('doc_type','alpha');
|
||||||
$object->piece_num = $piece_num;
|
$object->piece_num = $piece_num;
|
||||||
$object->doc_ref = GETPOST('doc_ref','alpha');
|
$object->doc_ref = GETPOST('doc_ref','alpha');
|
||||||
$object->code_journal = GETPOST('code_journal','alpha');
|
$object->code_journal = $journal_code;
|
||||||
|
$object->journal_label = $journal_label;
|
||||||
$object->fk_doc = GETPOST('fk_doc','alpha');
|
$object->fk_doc = GETPOST('fk_doc','alpha');
|
||||||
$object->fk_docdet = GETPOST('fk_docdet','alpha');
|
$object->fk_docdet = GETPOST('fk_docdet','alpha');
|
||||||
|
|
||||||
@ -212,12 +223,12 @@ else if ($action == "confirm_create") {
|
|||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
if (! GETPOST('code_journal','alpha') || GETPOST('code_journal','alpha') == '-1') {
|
if (! $journal_code || $journal_code == '-1') {
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors');
|
||||||
$action='create';
|
$action='create';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (! GETPOST('next_num_mvt'))
|
if (! GETPOST('next_num_mvt', 'alpha'))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumPiece")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumPiece")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -232,7 +243,8 @@ else if ($action == "confirm_create") {
|
|||||||
$object->doc_type = GETPOST('doc_type','alpha');
|
$object->doc_type = GETPOST('doc_type','alpha');
|
||||||
$object->piece_num = GETPOST('next_num_mvt','alpha');
|
$object->piece_num = GETPOST('next_num_mvt','alpha');
|
||||||
$object->doc_ref = GETPOST('doc_ref','alpha');
|
$object->doc_ref = GETPOST('doc_ref','alpha');
|
||||||
$object->code_journal = GETPOST('code_journal','alpha');
|
$object->code_journal = $journal_code;
|
||||||
|
$object->journal_label = $journal_label;
|
||||||
$object->fk_doc = 0;
|
$object->fk_doc = 0;
|
||||||
$object->fk_docdet = 0;
|
$object->fk_docdet = 0;
|
||||||
$object->montant = 0;
|
$object->montant = 0;
|
||||||
@ -253,7 +265,7 @@ else if ($action == "confirm_create") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setdate') {
|
if ($action == 'setdate') {
|
||||||
$datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth'), GETPOST('doc_dateday'), GETPOST('doc_dateyear'));
|
$datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||||
$result = $object->updateByMvt($piece_num,'doc_date',$db->idate($datedoc),$mode);
|
$result = $object->updateByMvt($piece_num,'doc_date',$db->idate($datedoc),$mode);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -267,8 +279,8 @@ if ($action == 'setdate') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setjournal') {
|
if ($action == 'setjournal') {
|
||||||
$journaldoc = trim(GETPOST('code_journal','alpha'));
|
$result = $object->updateByMvt($piece_num, 'code_journal', $journal_code, $mode);
|
||||||
$result = $object->updateByMvt($piece_num, 'code_journal', $journaldoc, $mode);
|
$result = $object->updateByMvt($piece_num, 'journal_label', $journal_label, $mode);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
@ -312,7 +324,6 @@ if ($action == 'valid') {
|
|||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$accountjournal = new AccountingJournal($db);
|
|
||||||
|
|
||||||
llxHeader('', $langs->trans("CreateMvts"));
|
llxHeader('', $langs->trans("CreateMvts"));
|
||||||
|
|
||||||
@ -357,7 +368,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">' . $langs->trans("Codejournal") . '</td>';
|
print '<td class="fieldrequired">' . $langs->trans("Codejournal") . '</td>';
|
||||||
print '<td>' . $formaccounting->select_journal(GETPOST('code_journal'),'code_journal',0,1,array(),1,1) . '</td>';
|
print '<td>' . $formaccounting->select_journal($journal_code,'code_journal',0,0,1,1) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -460,7 +471,7 @@ if ($action == 'create')
|
|||||||
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $object->code_journal ;
|
print $object->code_journal ;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -590,7 +601,6 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print_liste_field_titre("AccountAccountingShort");
|
print_liste_field_titre("AccountAccountingShort");
|
||||||
print_liste_field_titre("SubledgerAccount");
|
print_liste_field_titre("SubledgerAccount");
|
||||||
print_liste_field_titre("LabelAccount");
|
|
||||||
print_liste_field_titre("LabelOperation");
|
print_liste_field_titre("LabelOperation");
|
||||||
print_liste_field_titre("Debit", "", "", "", "", 'align="right"');
|
print_liste_field_titre("Debit", "", "", "", "", 'align="right"');
|
||||||
print_liste_field_titre("Credit", "", "", "", "", 'align="right"');
|
print_liste_field_titre("Credit", "", "", "", "", 'align="right"');
|
||||||
@ -605,7 +615,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
if ($action == 'update' && $line->id == $id) {
|
if ($action == 'update' && $line->id == $id) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccounting->select_account($line->numero_compte, 'account_number', 1, array (), 1, 1, '');
|
print $formaccounting->select_account($line->numero_compte, 'accountingaccount_number', 1, array (), 1, 1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
|
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
|
||||||
@ -619,7 +629,6 @@ if ($action == 'create')
|
|||||||
print '<input type="text" name="subledger_account" value="'.$line->subledger_account.'">';
|
print '<input type="text" name="subledger_account" value="'.$line->subledger_account.'">';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" class="minwidth100" name="label_compte" value="' . $line->label_compte . '"/></td>';
|
|
||||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $line->label_operation. '"/></td>';
|
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $line->label_operation. '"/></td>';
|
||||||
print '<td align="right"><input type="text" size="6" class="right" name="debit" value="' . price($line->debit) . '"/></td>';
|
print '<td align="right"><input type="text" size="6" class="right" name="debit" value="' . price($line->debit) . '"/></td>';
|
||||||
print '<td align="right"><input type="text" size="6" class="right" name="credit" value="' . price($line->credit) . '"/></td>';
|
print '<td align="right"><input type="text" size="6" class="right" name="credit" value="' . price($line->credit) . '"/></td>';
|
||||||
@ -628,9 +637,9 @@ if ($action == 'create')
|
|||||||
print '<input type="submit" class="button" name="update" value="' . $langs->trans("Update") . '">';
|
print '<input type="submit" class="button" name="update" value="' . $langs->trans("Update") . '">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
$accountingaccount->fetch(null, $line->numero_compte, true);
|
||||||
|
print '<td>' . $accountingaccount->getNomUrl(0,1,1,'',0) . '</td>';
|
||||||
print '<td>' . length_accounta($line->subledger_account) . '</td>';
|
print '<td>' . length_accounta($line->subledger_account) . '</td>';
|
||||||
print '<td>' . $line->label_compte . '</td>';
|
|
||||||
print '<td>' . $line->label_operation. '</td>';
|
print '<td>' . $line->label_operation. '</td>';
|
||||||
print '<td align="right">' . price($line->debit) . '</td>';
|
print '<td align="right">' . price($line->debit) . '</td>';
|
||||||
print '<td align="right">' . price($line->credit) . '</td>';
|
print '<td align="right">' . price($line->credit) . '</td>';
|
||||||
@ -663,7 +672,7 @@ if ($action == 'create')
|
|||||||
if ($action == "" || $action == 'add') {
|
if ($action == "" || $action == 'add') {
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccounting->select_account($account_number, 'account_number', 1, array (), 1, 1, '');
|
print $formaccounting->select_account($accountingaccount_number, 'accountingaccount_number', 1, array (), 1, 1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
|
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
|
||||||
@ -677,7 +686,6 @@ if ($action == 'create')
|
|||||||
print '<input type="text" name="subledger_account" value="">';
|
print '<input type="text" name="subledger_account" value="">';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" class="minwidth100" name="label_compte" value=""/></td>';
|
|
||||||
print '<td><input type="text" class="minwidth200" name="label_operation" value=""/></td>';
|
print '<td><input type="text" class="minwidth200" name="label_operation" value=""/></td>';
|
||||||
print '<td align="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
print '<td align="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||||
print '<td align="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
print '<td align="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -36,10 +36,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("accountancy"));
|
$langs->loadLangs(array("accountancy"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||||
$search_doc_type = GETPOST("search_doc_type");
|
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||||
$search_doc_ref = GETPOST("search_doc_ref");
|
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||||
@ -79,6 +79,7 @@ $search_direction = GETPOST('search_direction', 'alpha');
|
|||||||
$search_debit = GETPOST('search_debit', 'alpha');
|
$search_debit = GETPOST('search_debit', 'alpha');
|
||||||
$search_credit = GETPOST('search_credit', 'alpha');
|
$search_credit = GETPOST('search_credit', 'alpha');
|
||||||
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
||||||
|
$search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
@ -138,11 +139,14 @@ $arrayfields=array(
|
|||||||
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
|
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
|
||||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||||
|
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||||
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
|
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
|
||||||
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
||||||
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -176,6 +180,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
$search_date_modification_end = '';
|
$search_date_modification_end = '';
|
||||||
$search_debit = '';
|
$search_debit = '';
|
||||||
$search_credit = '';
|
$search_credit = '';
|
||||||
|
$search_lettering_code = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must be after the remove filter action, before the export.
|
// Must be after the remove filter action, before the export.
|
||||||
@ -272,6 +277,10 @@ if (! empty($search_credit)) {
|
|||||||
$filter['t.credit'] = $search_credit;
|
$filter['t.credit'] = $search_credit;
|
||||||
$param .= '&search_credit=' . urlencode($search_credit);
|
$param .= '&search_credit=' . urlencode($search_credit);
|
||||||
}
|
}
|
||||||
|
if (! empty($search_lettering_code)) {
|
||||||
|
$filter['t.lettering_code'] = $search_lettering_code;
|
||||||
|
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'delbookkeeping') {
|
if ($action == 'delbookkeeping') {
|
||||||
@ -337,7 +346,7 @@ if ($action == 'delmouvconfirm') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export into a file with format defined into setup
|
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||||
if ($action == 'export_file') {
|
if ($action == 'export_file') {
|
||||||
|
|
||||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||||
@ -350,7 +359,9 @@ if ($action == 'export_file') {
|
|||||||
{
|
{
|
||||||
$accountancyexport = new AccountancyExport($db);
|
$accountancyexport = new AccountancyExport($db);
|
||||||
$accountancyexport->export($object->lines);
|
$accountancyexport->export($object->lines);
|
||||||
if (!empty($accountancyexport->errors)) {
|
|
||||||
|
if (!empty($accountancyexport->errors))
|
||||||
|
{
|
||||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
@ -546,6 +557,13 @@ if (! empty($arrayfields['t.credit']['checked']))
|
|||||||
print '<input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'">';
|
print '<input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Lettering code
|
||||||
|
if (! empty($arrayfields['t.lettering_code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre center">';
|
||||||
|
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="' . $search_lettering_code . '"/>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Code journal
|
// Code journal
|
||||||
if (! empty($arrayfields['t.code_journal']['checked']))
|
if (! empty($arrayfields['t.code_journal']['checked']))
|
||||||
{
|
{
|
||||||
@ -595,6 +613,7 @@ if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_t
|
|||||||
if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
|
if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
@ -680,6 +699,13 @@ if ($num > 0)
|
|||||||
$totalarray['totalcredit'] += $line->credit;
|
$totalarray['totalcredit'] += $line->credit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lettering code
|
||||||
|
if (! empty($arrayfields['t.lettering_code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">' . $line->lettering_code . '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Journal code
|
// Journal code
|
||||||
if (! empty($arrayfields['t.code_journal']['checked']))
|
if (! empty($arrayfields['t.code_journal']['checked']))
|
||||||
{
|
{
|
||||||
@ -734,7 +760,6 @@ if ($num > 0)
|
|||||||
else print '<td></td>';
|
else print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -21,12 +22,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file accountancy/bookkeeping/thirdparty_lettrage.php
|
* \file htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup accountancy
|
||||||
* \brief Onglet de gestion de parametrages des ventilations
|
* \brief Tab to manage customer lettering
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||||
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta"));
|
$langs->loadLangs(array("compta","accountancy"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
@ -61,11 +61,10 @@ $search_year = GETPOST("search_year", 'int');
|
|||||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||||
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||||
|
|
||||||
$lettering = GETPOST('lettering');
|
$lettering = GETPOST('lettering', 'alpha');
|
||||||
if (! empty($lettering)) {
|
if (! empty($lettering)) {
|
||||||
$action = $lettering;
|
$action = $lettering;
|
||||||
}
|
}
|
||||||
$toselect = GETPOST('toselect', 'array');
|
|
||||||
|
|
||||||
// Did we click on purge search criteria ?
|
// Did we click on purge search criteria ?
|
||||||
// All tests are required to be compatible with all browsers
|
// All tests are required to be compatible with all browsers
|
||||||
@ -79,6 +78,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$socid = GETPOST("socid", 'int');
|
$socid = GETPOST("socid", 'int');
|
||||||
// if ($user->societe_id) $socid=$user->societe_id;
|
// if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
|
||||||
|
$lettering = new Lettering($db);
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
$object->id = $socid;
|
$object->id = $socid;
|
||||||
$result = $object->fetch($socid);
|
$result = $object->fetch($socid);
|
||||||
@ -87,9 +87,6 @@ if ($result < 0)
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
$BookKeeping = new lettering($db);
|
|
||||||
$formaccounting = new FormAccounting($db);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
@ -97,82 +94,49 @@ $formaccounting = new FormAccounting($db);
|
|||||||
|
|
||||||
if ($action == 'lettering') {
|
if ($action == 'lettering') {
|
||||||
|
|
||||||
$result = $BookKeeping->updateLettrage($toselect);
|
$result = $lettering->updateLettering($toselect);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages('', $BookKeeping->errors, 'errors');
|
setEventMessages('', $lettering->errors, 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'autolettrage') {
|
if ($action == 'autolettrage') {
|
||||||
|
|
||||||
$result = $BookKeeping->lettrageTiers($socid);
|
$result = $lettering->letteringThirdparty($socid);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages('', $BookKeeping->errors, 'errors');
|
setEventMessages('', $lettering->errors, 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader('', 'Compta - Grand Livre');
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage onglets
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
|
$title=$object->name." - ".$langs->trans('TabLetteringCustomer');
|
||||||
|
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
|
llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
|
|
||||||
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
||||||
|
|
||||||
dol_fiche_head($head, 'accounting', $langs->trans("ThirdParty"), 0, 'company');
|
dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company');
|
||||||
|
|
||||||
print '<table width="100%" class="border">';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
print '<tr><td width="30%">' . $langs->trans("ThirdPartyName") . '</td><td width="70%" colspan="3">';
|
|
||||||
$object->next_prev_filter = "te.fournisseur = 1";
|
|
||||||
print $form->showrefnav($object, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', '');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||||
{
|
|
||||||
print '<tr><td>' . $langs->trans('Prefix') . '</td><td colspan="3">' . $object->prefix_comm . '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr>';
|
dol_fiche_end();
|
||||||
print '<td class="nowrap">' . $langs->trans("CustomerCode") . '</td><td colspan="3">';
|
|
||||||
print $object->code_client;
|
|
||||||
if ($object->check_codeclient() != 0)
|
|
||||||
print ' <font class="error">(' . $langs->trans("WrongCustomerCode") . ')</font>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<tr>';
|
print '<br>';
|
||||||
print '<td>';
|
|
||||||
print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer);
|
|
||||||
print '</td><td colspan="3">';
|
|
||||||
print $form->editfieldval("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer);
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Address
|
|
||||||
print '<tr><td valign="top">' . $langs->trans("Address") . '</td><td colspan="3">';
|
|
||||||
dol_print_address($object->address, 'gmap', 'thirdparty', $object->id);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Zip / Town
|
|
||||||
print '<tr><td class="nowrap">' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td colspan="3">' . $object->zip . (($object->zip && $object->town) ? ' / ' : '') . $object->town . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Country
|
|
||||||
print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">';
|
|
||||||
// $img=picto_from_langcode($object->country_code);
|
|
||||||
$img = '';
|
|
||||||
if ($object->isInEEC())
|
|
||||||
print $form->textwithpicto(($img ? $img . ' ' : '') . $object->country, $langs->trans("CountryIsInEEC"), 1, 0);
|
|
||||||
else
|
|
||||||
print ($img ? $img . ' ' : '') . $object->country;
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
|
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
|
||||||
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
|
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
|
||||||
@ -209,7 +173,7 @@ while ( $obj = $db->fetch_object($resql) ) {
|
|||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage.php", LOG_DEBUG);
|
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -218,7 +182,7 @@ if (! $resql) {
|
|||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage.php", LOG_DEBUG);
|
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
@ -232,21 +196,19 @@ if ($resql) {
|
|||||||
print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Labelcompte", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "bk.montant", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Sens", $_SERVER["PHP_SELF"], "bk.sens", "", $param, "", $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder);
|
||||||
print '<td></td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
||||||
print '<td><input type="text" name="search_year" value="' . $search_year . '"></td>';
|
print '<td><input type="text" name="search_year" value="' . $search_year . '"></td>';
|
||||||
print '<td><input type="text" name="search_doc_refe" value="' . $search_doc_ref . '"></td>';
|
print '<td><input type="text" name="search_doc_refe" value="' . $search_doc_ref . '"></td>';
|
||||||
print '<td colspan="7"> </td>';
|
print '<td colspan="5"> </td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
$searchpicto = $form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
@ -257,12 +219,8 @@ if ($resql) {
|
|||||||
$tmp = '';
|
$tmp = '';
|
||||||
while ( $obj = $db->fetch_object($resql) ) {
|
while ( $obj = $db->fetch_object($resql) ) {
|
||||||
|
|
||||||
if ($tmp != $obj->lettering_code || empty($tmp))
|
if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code;
|
||||||
$tmp = $obj->lettering_code;
|
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
||||||
|
|
||||||
if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
|
|
||||||
|
|
||||||
$solde += ($obj->credit - $obj->debit);
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -270,44 +228,44 @@ if ($resql) {
|
|||||||
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
|
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a> ' . $obj->doc_type . '</td>' . "\n";
|
print '</a> ' . $obj->doc_type . '</td>' . "\n";
|
||||||
} else
|
} else {
|
||||||
print '<td>' . $obj->doc_type . '</td>' . "\n";
|
print '<td>' . $obj->doc_type . '</td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
|
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
|
||||||
print '<td>' . $obj->doc_ref . '</td>';
|
print '<td>' . $obj->doc_ref . '</td>';
|
||||||
print '<td>' . $obj->label_compte . '</td>';
|
print '<td>' . $obj->label_compte . '</td>';
|
||||||
print '<td>' . price($obj->debit) . '</td>';
|
print '<td align="right">' . price($obj->debit) . '</td>';
|
||||||
print '<td>' . price($obj->credit) . '</td>';
|
print '<td align="right">' . price($obj->credit) . '</td>';
|
||||||
print '<td>' . price($obj->montant) . '</td>';
|
print '<td align="right">' . price(round($solde, 2)) . '</td>';
|
||||||
print '<td>' . $obj->sens . '</td>';
|
print '<td align="center">' . $obj->code_journal . '</td>';
|
||||||
print '<td>' . $obj->code_journal . '</td>';
|
|
||||||
print '<td>' . round($solde, 2) . '</td>';
|
|
||||||
|
|
||||||
if (empty($obj->lettering_code)) {
|
if (empty($obj->lettering_code)) {
|
||||||
print '<td class="nowrap" align="center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
|
print '<td class="nowrap" align="center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
|
||||||
} else
|
} else
|
||||||
print '<td>' . $obj->lettering_code . '</td>';
|
print '<td align="center">' . $obj->lettering_code . '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td colspan="4">Mouvement totaux</td>' . "\n";
|
print '<td align="right" colspan="4">'.$langs->trans("Total").':</td>' . "\n";
|
||||||
print '<td><strong>' . price($debit) . '</strong></td>';
|
print '<td align="right"><strong>' . price($debit) . '</strong></td>';
|
||||||
print '<td><strong>' . price($credit) . '</strong></td>';
|
print '<td align="right"><strong>' . price($credit) . '</strong></td>';
|
||||||
print '<td colspan="5"></td>';
|
print '<td colspan="5"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td colspan="9">Solde Comptable</td>' . "\n";
|
print '<td align="right" colspan="4">'.$langs->trans("Balancing").':</td>' . "\n";
|
||||||
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
|
print '<td colspan="2"> </td>';
|
||||||
print '<td colspan="5"></td>';
|
print '<td align="right"><strong>' . price($credit - $debit) . '</strong></td>';
|
||||||
|
print '<td colspan="3"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '<input class="butAction" type="submit" value="lettering" name="lettering" id="lettering">';
|
print '<input class="butAction" type="submit" value="lettering" name="lettering" id="lettering">';
|
||||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '&action=autolettrage">' . $langs->trans('AccountancyAutoLettering') . '</a>';
|
//print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '&action=autolettering">' . $langs->trans('AccountancyAutoLettering') . '</a>';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
@ -317,4 +275,3 @@ if ($resql) {
|
|||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
@ -3,7 +3,8 @@
|
|||||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -21,14 +22,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file accountancy/bookkeeping/thirdparty_lettrage_supplier.php
|
* \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Tab to setup lettering
|
* \brief Tab to setup lettering
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Dolibarr environment
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||||
@ -36,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta"));
|
$langs->loadLangs(array("compta","accountancy"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
@ -63,11 +61,10 @@ $search_year = GETPOST("search_year",'int');
|
|||||||
$search_doc_type = GETPOST("search_doc_type",'alpha');
|
$search_doc_type = GETPOST("search_doc_type",'alpha');
|
||||||
$search_doc_ref = GETPOST("search_doc_ref",'alpha');
|
$search_doc_ref = GETPOST("search_doc_ref",'alpha');
|
||||||
|
|
||||||
$lettering = GETPOST('lettering');
|
$lettering = GETPOST('lettering', 'alpha');
|
||||||
if (!empty($lettering)) {
|
if (!empty($lettering)) {
|
||||||
$action=$lettering;
|
$action=$lettering;
|
||||||
}
|
}
|
||||||
$toselect = GETPOST('toselect','array');
|
|
||||||
|
|
||||||
// Did we click on purge search criteria ?
|
// Did we click on purge search criteria ?
|
||||||
// All tests are required to be compatible with all browsers
|
// All tests are required to be compatible with all browsers
|
||||||
@ -83,6 +80,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
$socid = GETPOST("socid", 'int');
|
$socid = GETPOST("socid", 'int');
|
||||||
// if ($user->societe_id) $socid=$user->societe_id;
|
// if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
|
||||||
|
$lettering = new Lettering($db);
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
$object->id = $socid;
|
$object->id = $socid;
|
||||||
$result = $object->fetch($socid);
|
$result = $object->fetch($socid);
|
||||||
@ -91,104 +89,53 @@ if ($result<0)
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
$BookKeeping = new lettering($db);
|
|
||||||
$formaccounting = new FormAccounting($db);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
if ($action == 'lettering') {
|
if ($action == 'lettering') {
|
||||||
|
|
||||||
$result = $BookKeeping->updateLettrage($toselect);
|
$result = $lettering->updateLettering($toselect);
|
||||||
|
|
||||||
// var_dump($result);
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages('', $BookKeeping->errors, 'errors');
|
setEventMessages('', $lettering->errors, 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'autolettrage') {
|
if ($action == 'autolettrage') {
|
||||||
|
|
||||||
$result = $BookKeeping->lettrageTiers($socid);
|
$result = $lettering->letteringThirdparty($socid);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages('', $BookKeeping->errors, 'errors');
|
setEventMessages('', $lettering->errors, 'errors');
|
||||||
$error ++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = 'AccountancyLettrage';
|
|
||||||
|
|
||||||
llxHeader('', $title);
|
|
||||||
|
|
||||||
|
|
||||||
$param='';
|
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
|
||||||
if (!empty($search_year)) $param.='&search_year='.$search_year;
|
|
||||||
if (!empty($socid)) $param.='&socid='.$socid;
|
|
||||||
if (!empty($search_doc_type)) $param.='&search_doc_type='.$search_doc_type;
|
|
||||||
if (!empty($search_doc_ref)) $param.='&search_doc_ref='.$search_doc_ref;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Display tabs
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
|
$title=$object->name." - ".$langs->trans('TabLetteringSupplier');
|
||||||
|
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
|
llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
|
|
||||||
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
||||||
|
|
||||||
dol_fiche_head($head, 'accounting_supplier', $langs->trans("ThirdParty"), 0, 'company');
|
dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company');
|
||||||
|
|
||||||
print '<table width="100%" class="border">';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
print '<tr><td width="30%">' . $langs->trans("ThirdPartyName") . '</td><td width="70%" colspan="3">';
|
|
||||||
$object->next_prev_filter = "te.fournisseur = 1";
|
|
||||||
print $form->showrefnav($object, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', '');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||||
{
|
|
||||||
print '<tr><td>' . $langs->trans('Prefix') . '</td><td colspan="3">' . $object->prefix_comm . '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr>';
|
dol_fiche_end();
|
||||||
print '<td class="nowrap">' . $langs->trans("SupplierCode") . '</td><td colspan="3">';
|
|
||||||
print $object->code_fournisseur;
|
|
||||||
if ($object->check_codefournisseur() != 0)
|
|
||||||
print ' <font class="error">(' . $langs->trans("WrongSupplierCode") . ')</font>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>';
|
|
||||||
print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
|
|
||||||
print '</td><td colspan="3">';
|
|
||||||
print $form->editfieldval("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Address
|
|
||||||
print '<tr><td valign="top">' . $langs->trans("Address") . '</td><td colspan="3">';
|
|
||||||
dol_print_address($object->address, 'gmap', 'thirdparty', $object->id);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Zip / Town
|
|
||||||
print '<tr><td class="nowrap">' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td colspan="3">' . $object->zip . (($object->zip && $object->town) ? ' / ' : '') . $object->town . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Country
|
|
||||||
print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">';
|
|
||||||
// $img=picto_from_langcode($object->country_code);
|
|
||||||
$img = '';
|
|
||||||
if ($object->isInEEC())
|
|
||||||
print $form->textwithpicto(($img ? $img . ' ' : '') . $object->country, $langs->trans("CountryIsInEEC"), 1, 0);
|
|
||||||
else
|
|
||||||
print ($img ? $img . ' ' : '') . $object->country;
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
|
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
|
||||||
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
|
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
|
||||||
@ -252,21 +199,19 @@ if ($resql) {
|
|||||||
print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Labelcompte", $_SERVER["PHP_SELF"], "bk.label_compte","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "bk.montant","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Sens", $_SERVER["PHP_SELF"], "bk.sens","",$param,"",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder);
|
||||||
print '<td></td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
print '<td><input type="text" name="search_doc_type" value="' . $search_doc_type . '"></td>';
|
||||||
print '<td><input type="text" name="search_year" value="' . $search_year . '"></td>';
|
print '<td><input type="text" name="search_year" value="' . $search_year . '"></td>';
|
||||||
print '<td><input type="text" name="search_doc_refe" value="' . $search_doc_ref . '"></td>';
|
print '<td><input type="text" name="search_doc_refe" value="' . $search_doc_ref . '"></td>';
|
||||||
print '<td colspan="7"> </td>';
|
print '<td colspan="6"> </td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
$searchpicto=$form->showFilterButtons();
|
$searchpicto=$form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
@ -277,12 +222,8 @@ if ($resql) {
|
|||||||
$tmp = '';
|
$tmp = '';
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
|
||||||
if ($tmp != $obj->lettering_code || empty($tmp))
|
if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code;
|
||||||
$tmp = $obj->lettering_code;
|
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
||||||
|
|
||||||
if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
|
|
||||||
|
|
||||||
$solde += ($obj->credit - $obj->debit);
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -290,45 +231,44 @@ if ($resql) {
|
|||||||
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
|
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a> ' . $obj->doc_type . '</td>' . "\n";
|
print '</a> ' . $obj->doc_type . '</td>' . "\n";
|
||||||
} else
|
} else {
|
||||||
print '<td>' . $obj->doc_type . '</td>' . "\n";
|
print '<td>' . $obj->doc_type . '</td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
|
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
|
||||||
print '<td>' . $obj->doc_ref . '</td>';
|
print '<td>' . $obj->doc_ref . '</td>';
|
||||||
print '<td>' . $obj->label_compte . '</td>';
|
print '<td>' . $obj->label_compte . '</td>';
|
||||||
print '<td>' . price($obj->debit) . '</td>';
|
print '<td align="right">' . price($obj->debit) . '</td>';
|
||||||
print '<td>' . price($obj->credit) . '</td>';
|
print '<td align="right">' . price($obj->credit) . '</td>';
|
||||||
print '<td>' . price($obj->montant) . '</td>';
|
print '<td align="right">' . price(round($solde, 2)) . '</td>';
|
||||||
print '<td>' . $obj->sens . '</td>';
|
print '<td align="center">' . $obj->code_journal . '</td>';
|
||||||
print '<td>' . $obj->code_journal . '</td>';
|
|
||||||
print '<td>' . round($solde, 2) . '</td>';
|
|
||||||
|
|
||||||
if (empty($obj->lettering_code)) {
|
if (empty($obj->lettering_code)) {
|
||||||
print '<td class="nowrap" align="center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
|
print '<td class="nowrap" align="center"><input type="checkbox" class="flat checkforselect" name="toselect[]" id="toselect[]" value="' . $obj->rowid . '" /></td>';
|
||||||
} else
|
} else
|
||||||
print '<td>' . $obj->lettering_code . '</td>';
|
print '<td align="center">' . $obj->lettering_code . '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
print '<td align="right" colspan="4">'.$langs->trans("Total").':</td>' . "\n";
|
||||||
print '<td colspan="4">Mouvement totaux</td>' . "\n";
|
print '<td align="right"><strong>' . price($debit) . '</strong></td>';
|
||||||
print '<td><strong>' . price($debit) . '</strong></td>';
|
print '<td align="right"><strong>' . price($credit) . '</strong></td>';
|
||||||
print '<td><strong>' . price($credit) . '</strong></td>';
|
|
||||||
print '<td colspan="5"></td>';
|
print '<td colspan="5"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td colspan="9">Solde Comptable</td>' . "\n";
|
print '<td align="right" colspan="4">'.$langs->trans("Balancing").':</td>' . "\n";
|
||||||
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
|
print '<td colspan="2"> </td>';
|
||||||
print '<td colspan="5"></td>';
|
print '<td align="right"><strong>' . price($credit - $debit) . '</strong></td>';
|
||||||
|
print '<td colspan="3"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '<input class="butAction" type="submit" value="lettering" name="lettering" id="lettering">';
|
print '<input class="butAction" type="submit" value="' . $langs->trans('AccountancyLettering') . '" name="lettering" id="lettering">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '&action=autolettrage">'.$langs->trans('AccountancyAutoLettering').'</a>';
|
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '&action=autolettrage">'.$langs->trans('AccountancyAutoLettering').'</a>';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||||
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -77,7 +78,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
public $range_account;
|
public $range_account;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed Sample property 1
|
* @var int Sens of the account: 0: credit - debit, 1: debit - credit
|
||||||
*/
|
*/
|
||||||
public $sens;
|
public $sens;
|
||||||
|
|
||||||
@ -162,16 +163,17 @@ class AccountancyCategory // extends CommonObject
|
|||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_accounting_category(";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_accounting_category(";
|
||||||
if ($this->rowid > 0) $sql.= "rowid,";
|
if ($this->rowid > 0) $sql.= "rowid, ";
|
||||||
$sql.= "code,";
|
$sql.= "code, ";
|
||||||
$sql.= "label,";
|
$sql.= "label, ";
|
||||||
$sql.= "range_account,";
|
$sql.= "range_account, ";
|
||||||
$sql.= "sens,";
|
$sql.= "sens, ";
|
||||||
$sql.= "category_type,";
|
$sql.= "category_type, ";
|
||||||
$sql.= "formula,";
|
$sql.= "formula, ";
|
||||||
$sql.= "position,";
|
$sql.= "position, ";
|
||||||
$sql.= "fk_country,";
|
$sql.= "fk_country, ";
|
||||||
$sql.= "active";
|
$sql.= "active, ";
|
||||||
|
$sql.= "entity";
|
||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
if ($this->rowid > 0) $sql.= " ".$this->rowid.",";
|
if ($this->rowid > 0) $sql.= " ".$this->rowid.",";
|
||||||
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
|
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
|
||||||
@ -183,6 +185,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
$sql.= " ".(! isset($this->position)?'NULL':$this->db->escape($this->position)).",";
|
$sql.= " ".(! isset($this->position)?'NULL':$this->db->escape($this->position)).",";
|
||||||
$sql.= " ".(! isset($this->fk_country)?'NULL':$this->db->escape($this->fk_country)).",";
|
$sql.= " ".(! isset($this->fk_country)?'NULL':$this->db->escape($this->fk_country)).",";
|
||||||
$sql.= " ".(! isset($this->active)?'NULL':$this->db->escape($this->active));
|
$sql.= " ".(! isset($this->active)?'NULL':$this->db->escape($this->active));
|
||||||
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -236,9 +239,8 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param string $label Label
|
* @param string $label Label
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id,$code='',$label='')
|
function fetch($id, $code='', $label='')
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.rowid,";
|
$sql.= " t.rowid,";
|
||||||
$sql.= " t.code,";
|
$sql.= " t.code,";
|
||||||
@ -252,8 +254,12 @@ class AccountancyCategory // extends CommonObject
|
|||||||
$sql.= " t.active";
|
$sql.= " t.active";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as t";
|
||||||
if ($id) $sql.= " WHERE t.rowid = ".$id;
|
if ($id) $sql.= " WHERE t.rowid = ".$id;
|
||||||
elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'";
|
else
|
||||||
elseif ($label) $sql.= " WHERE t.label = '".$this->db->escape($label)."'";
|
{
|
||||||
|
$sql.= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
|
||||||
|
if ($code) $sql.= " AND t.code = '".$this->db->escape($code)."'";
|
||||||
|
elseif ($label) $sql.= " AND t.label = '".$this->db->escape($label)."'";
|
||||||
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -479,7 +485,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||||
$sql .= " AND aa.active = 1";
|
$sql .= " AND aa.active = 1";
|
||||||
$sql .= " AND aa.entity = = " . $conf->entity . ")";
|
$sql .= " AND aa.entity = " . $conf->entity . ")";
|
||||||
$sql .= " GROUP BY t.numero_compte, t.label_operation, t.doc_ref";
|
$sql .= " GROUP BY t.numero_compte, t.label_operation, t.doc_ref";
|
||||||
$sql .= " ORDER BY t.numero_compte";
|
$sql .= " ORDER BY t.numero_compte";
|
||||||
|
|
||||||
@ -711,49 +717,76 @@ class AccountancyCategory // extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Function to show result of an accounting account from the ledger with a direction and a period
|
* Function to show result of an accounting account from the ledger with a direction and a period
|
||||||
*
|
*
|
||||||
* @param int $cpt Id accounting account
|
* @param int|array $cpt Accounting account or array of accounting account
|
||||||
* @param string $month Specifig month - Can be empty
|
|
||||||
* @param string $date_start Date start
|
* @param string $date_start Date start
|
||||||
* @param string $date_end Date end
|
* @param string $date_end Date end
|
||||||
* @param int $sens Sens of the account: 0: credit - debit, 1: debit - credit
|
* @param int $sens Sens of the account: 0: credit - debit, 1: debit - credit
|
||||||
* @param string $thirdparty_code Thirdparty code
|
* @param string $thirdparty_code Thirdparty code
|
||||||
* @return integer Result in table
|
* @param int $month Specifig month - Can be empty
|
||||||
|
* @param int $year Specifig year - Can be empty
|
||||||
|
* @return integer <0 if KO, >= 0 if OK
|
||||||
*/
|
*/
|
||||||
public function getResult($cpt, $month, $date_start, $date_end, $sens, $thirdparty_code='nofilter')
|
public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code='nofilter', $month=0, $year=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$this->sdc = 0;
|
||||||
|
$this->sdcpermonth = array();
|
||||||
|
|
||||||
$sql = "SELECT SUM(t.debit) as debit, SUM(t.credit) as credit";
|
$sql = "SELECT SUM(t.debit) as debit, SUM(t.credit) as credit";
|
||||||
|
if (is_array($cpt)) $sql.=", t.numero_compte as accountancy_account";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t";
|
||||||
$sql .= " WHERE t.numero_compte = '" . $cpt."'";
|
//if (in_array($this->db->type, array('mysql', 'mysqli'))) $sql.=' USE INDEX idx_accounting_bookkeeping_doc_date';
|
||||||
if (! empty($date_start) && ! empty($date_end))
|
$sql .= " WHERE t.entity = ".$conf->entity;
|
||||||
$sql.= " AND t.doc_date >= '".$this->db->idate($date_start)."' AND t.doc_date <= '".$this->db->idate($date_end)."'";
|
if (is_array($cpt))
|
||||||
if (! empty($month)) {
|
{
|
||||||
$sql .= " AND MONTH(t.doc_date) = " . $month;
|
$listofaccount='';
|
||||||
|
foreach($cpt as $cptcursor)
|
||||||
|
{
|
||||||
|
if ($listofaccount) $listofaccount.=",";
|
||||||
|
$listofaccount.="'".$cptcursor."'";
|
||||||
|
}
|
||||||
|
$sql .= " AND t.numero_compte IN (" .$listofaccount. ")";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql .= " AND t.numero_compte = '" . $this->db->escape($cpt) . "'";
|
||||||
|
}
|
||||||
|
if (! empty($date_start) && ! empty($date_end) && (empty($month) || empty($year))) // If month/year provided, it is stronger than filter date_start/date_end
|
||||||
|
$sql .= " AND (t.doc_date BETWEEN '".$this->db->idate($date_start)."' AND '".$this->db->idate($date_end)."')";
|
||||||
|
if (! empty($month) && ! empty($year)) {
|
||||||
|
$sql .= " AND (t.doc_date BETWEEN '".$this->db->idate(dol_get_first_day($year, $month))."' AND '".$this->db->idate(dol_get_last_day($year, $month))."')";
|
||||||
}
|
}
|
||||||
if ($thirdparty_code != 'nofilter')
|
if ($thirdparty_code != 'nofilter')
|
||||||
{
|
{
|
||||||
$sql .= " AND thirdparty_code = '".$this->db->escape($thirdparty_code)."'";
|
$sql .= " AND t.thirdparty_code = '".$this->db->escape($thirdparty_code)."'";
|
||||||
}
|
}
|
||||||
|
if (is_array($cpt)) $sql.=" GROUP BY t.numero_compte";
|
||||||
|
//print $sql;
|
||||||
|
|
||||||
dol_syslog(__METHOD__ . " sql=" . $sql, LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
if ($resql) {
|
{
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
$this->sdc = 0;
|
if ($num)
|
||||||
if ($num) {
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
if ($sens == 1) {
|
if ($sens == 1) {
|
||||||
$this->sdc = $obj->debit - $obj->credit;
|
$this->sdc = $obj->debit - $obj->credit;
|
||||||
} else {
|
} else {
|
||||||
$this->sdc = $obj->credit - $obj->debit;
|
$this->sdc = $obj->credit - $obj->debit;
|
||||||
}
|
}
|
||||||
|
if (is_array($cpt))
|
||||||
|
{
|
||||||
|
$this->sdcperaccount[$obj->accountancy_account] = $this->sdc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $num;
|
return $num;
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Error " . $this->db->lasterror();
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->error;
|
||||||
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
return - 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,7 +798,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getCats($categorytype=-1)
|
public function getCats($categorytype=-1)
|
||||||
{
|
{
|
||||||
global $db, $langs, $user, $mysoc, $conf;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
if (empty($mysoc->country_id)) {
|
if (empty($mysoc->country_id)) {
|
||||||
dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined');
|
dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined');
|
||||||
@ -774,7 +807,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type";
|
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c";
|
||||||
$sql .= " WHERE c.active = 1 ";
|
$sql .= " WHERE c.active = 1";
|
||||||
$sql .= " AND c.entity = " . $conf->entity;
|
$sql .= " AND c.entity = " . $conf->entity;
|
||||||
if ($categorytype >= 0) $sql.=" AND c.category_type = 1";
|
if ($categorytype >= 0) $sql.=" AND c.category_type = 1";
|
||||||
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
||||||
@ -816,13 +849,13 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* Get all accounting account of a group.
|
* Get all accounting account of a group.
|
||||||
* You must choose between first parameter (personalized group) or the second (free criteria filter)
|
* You must choose between first parameter (personalized group) or the second (free criteria filter)
|
||||||
*
|
*
|
||||||
* @param int $cat_id Id if personalized accounting group/category
|
* @param int $cat_id Id if personalized accounting group/category
|
||||||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||||
* @return array|int Array of accounting accounts or -1 if error
|
* @return array|int Array of accounting accounts or -1 if error
|
||||||
*/
|
*/
|
||||||
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
||||||
{
|
{
|
||||||
global $mysoc;
|
global $conf, $mysoc;
|
||||||
$sql = '';
|
$sql = '';
|
||||||
|
|
||||||
if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
||||||
@ -835,6 +868,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
|
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
||||||
$sql .= " WHERE t.fk_accounting_category = ".$cat_id;
|
$sql .= " WHERE t.fk_accounting_category = ".$cat_id;
|
||||||
|
$sql .= " AND t.entity = " . $conf->entity;
|
||||||
$sql .= " ORDER BY t.account_number";
|
$sql .= " ORDER BY t.account_number";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -842,6 +876,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
|
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
||||||
$sql .= " WHERE ".$predefinedgroupwhere;
|
$sql .= " WHERE ".$predefinedgroupwhere;
|
||||||
|
$sql .= " AND t.entity = " . $conf->entity;
|
||||||
$sql .= " ORDER BY t.account_number";
|
$sql .= " ORDER BY t.account_number";
|
||||||
}
|
}
|
||||||
//echo $sql;
|
//echo $sql;
|
||||||
@ -855,13 +890,12 @@ class AccountancyCategory // extends CommonObject
|
|||||||
if ($num) {
|
if ($num) {
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$name_cat = $obj->name_cat;
|
|
||||||
$data[] = array (
|
$data[] = array (
|
||||||
'id' => $obj->rowid,
|
'id' => $obj->rowid,
|
||||||
'account_number' => $obj->account_number,
|
'account_number' => $obj->account_number,
|
||||||
'account_label' => $obj->account_label,
|
'account_label' => $obj->account_label,
|
||||||
);
|
);
|
||||||
$i ++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
|
|||||||
@ -206,7 +206,7 @@ class AccountancyExport
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function who chose which export to use with the default config
|
* Function who chose which export to use with the default config, and make the export into a file
|
||||||
*
|
*
|
||||||
* @param array $TData data
|
* @param array $TData data
|
||||||
* @return void
|
* @return void
|
||||||
@ -214,16 +214,17 @@ class AccountancyExport
|
|||||||
public function export(&$TData)
|
public function export(&$TData)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php
|
||||||
|
|
||||||
|
// Define name of file to save
|
||||||
$filename = 'general_ledger-'.$this->getFormatCode($conf->global->ACCOUNTING_EXPORT_MODELCSV);
|
$filename = 'general_ledger-'.$this->getFormatCode($conf->global->ACCOUNTING_EXPORT_MODELCSV);
|
||||||
|
$type_export = 'general_ledger';
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
switch ($conf->global->ACCOUNTING_EXPORT_MODELCSV) {
|
switch ($conf->global->ACCOUNTING_EXPORT_MODELCSV) {
|
||||||
case self::$EXPORT_TYPE_NORMAL :
|
case self::$EXPORT_TYPE_NORMAL :
|
||||||
/*$this->exportNormal($TData);
|
|
||||||
break;*/
|
|
||||||
case self::$EXPORT_TYPE_CONFIGURABLE :
|
case self::$EXPORT_TYPE_CONFIGURABLE :
|
||||||
$this->exportConfigurable($TData);
|
$this->exportConfigurable($TData);
|
||||||
break;
|
break;
|
||||||
@ -261,32 +262,6 @@ class AccountancyExport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Export format : Normal
|
|
||||||
*
|
|
||||||
* @param array $objectLines data
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
/* Use $EXPORT_TYPE_CONFIGURABLE instead
|
|
||||||
public function exportNormal($objectLines)
|
|
||||||
{
|
|
||||||
global $conf;
|
|
||||||
|
|
||||||
foreach ( $objectLines as $line ) {
|
|
||||||
// Std export
|
|
||||||
$date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
|
||||||
print $date . $this->separator;
|
|
||||||
print $line->doc_ref . $this->separator;
|
|
||||||
print length_accountg($line->numero_compte) . $this->separator;
|
|
||||||
print length_accounta($line->subledger_account) . $this->separator;
|
|
||||||
print price($line->debit) . $this->separator;
|
|
||||||
print price($line->credit) . $this->separator;
|
|
||||||
print $line->code_journal . $this->separator;
|
|
||||||
print $this->end_line;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : CEGID
|
* Export format : CEGID
|
||||||
@ -651,19 +626,39 @@ class AccountancyExport
|
|||||||
*/
|
*/
|
||||||
public function exportFEC($objectLines)
|
public function exportFEC($objectLines)
|
||||||
{
|
{
|
||||||
$separator = ';';
|
$separator = "\t";
|
||||||
$end_line = "\n";
|
$end_line = "\n";
|
||||||
|
|
||||||
|
print "JournalCode" . $separator;
|
||||||
|
print "JournalLib" . $separator;
|
||||||
|
print "EcritureNum" . $separator;
|
||||||
|
print "EcritureDate" . $separator;
|
||||||
|
print "CompteNum" . $separator;
|
||||||
|
print "CompteLib" . $separator;
|
||||||
|
print "CompAuxNum" . $separator;
|
||||||
|
print "CompAuxLib" . $separator;
|
||||||
|
print "PieceRef" . $separator;
|
||||||
|
print "PieceDate" . $separator;
|
||||||
|
print "EcritureLib" . $separator;
|
||||||
|
print "Debit" . $separator;
|
||||||
|
print "Credit" . $separator;
|
||||||
|
print "EcritureLet" . $separator;
|
||||||
|
print "DateLet" . $separator;
|
||||||
|
print "ValidDate" . $separator;
|
||||||
|
print "Montantdevise" . $separator;
|
||||||
|
print "Idevise";
|
||||||
|
print $end_line;
|
||||||
|
|
||||||
foreach ( $objectLines as $line ) {
|
foreach ( $objectLines as $line ) {
|
||||||
$date_creation = dol_print_date($line->date_creation, '%d%m%Y');
|
$date_creation = dol_print_date($line->date_creation, '%d%m%Y');
|
||||||
$date_doc = dol_print_date($line->doc_date, '%d%m%Y');
|
$date_doc = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
$date_valid = dol_print_date($line->date_validated, '%d%m%Y');
|
$date_valid = dol_print_date($line->date_validated, '%d%m%Y');
|
||||||
|
|
||||||
// FEC:JournalCode
|
// FEC:JournalCode
|
||||||
print $line->code_journal;
|
print $line->code_journal . $separator;
|
||||||
|
|
||||||
// FEC:JournalLib
|
// FEC:JournalLib
|
||||||
print $line->journal_label;
|
print $line->journal_label . $separator;
|
||||||
|
|
||||||
// FEC:EcritureNum
|
// FEC:EcritureNum
|
||||||
print $line->piece_num . $separator;
|
print $line->piece_num . $separator;
|
||||||
@ -693,10 +688,10 @@ class AccountancyExport
|
|||||||
print $line->label_operation . $separator;
|
print $line->label_operation . $separator;
|
||||||
|
|
||||||
// FEC:Debit
|
// FEC:Debit
|
||||||
print price($line->debit) . $separator;
|
print price2num($line->debit) . $separator;
|
||||||
|
|
||||||
// FEC:Credit
|
// FEC:Credit
|
||||||
print price($line->credit) . $separator;
|
print price2num($line->credit) . $separator;
|
||||||
|
|
||||||
// FEC:EcritureLet
|
// FEC:EcritureLet
|
||||||
print $line->lettering_code . $separator;
|
print $line->lettering_code . $separator;
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -30,6 +31,9 @@
|
|||||||
*/
|
*/
|
||||||
class AccountingAccount extends CommonObject
|
class AccountingAccount extends CommonObject
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var string Name of element
|
||||||
|
*/
|
||||||
public $element='accounting_account';
|
public $element='accounting_account';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,16 +63,6 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string Error code (or message)
|
|
||||||
*/
|
|
||||||
public $error='';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string[] Error codes (or messages)
|
|
||||||
*/
|
|
||||||
public $errors = array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
@ -79,17 +73,39 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $rowid;
|
public $rowid;
|
||||||
|
|
||||||
public $datec; // Creation date
|
/**
|
||||||
|
* @var string Creation date
|
||||||
|
*/
|
||||||
|
public $datec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var string pcg version
|
||||||
*/
|
*/
|
||||||
public $fk_pcg_version;
|
public $fk_pcg_version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string pcg type
|
||||||
|
*/
|
||||||
public $pcg_type;
|
public $pcg_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string pcg subtype
|
||||||
|
*/
|
||||||
public $pcg_subtype;
|
public $pcg_subtype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string account number
|
||||||
|
*/
|
||||||
public $account_number;
|
public $account_number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID parent account
|
||||||
|
*/
|
||||||
public $account_parent;
|
public $account_parent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID category account
|
||||||
|
*/
|
||||||
public $account_category;
|
public $account_category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,8 +128,10 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_user_modif;
|
public $fk_user_modif;
|
||||||
|
|
||||||
public $active; // duplicate with status
|
/**
|
||||||
|
* @var int active (duplicate with status)
|
||||||
|
*/
|
||||||
|
public $active;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2015-2017 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2015-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,9 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/class/bookkeeping.class.php
|
* \file htdocs/accountancy/class/bookkeeping.class.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief File of class to manage Ledger (General Ledger and Subledger)
|
* \brief File of class to manage Ledger (General Ledger and Subledger)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
@ -68,7 +69,15 @@ class BookKeeping extends CommonObject
|
|||||||
|
|
||||||
public $doc_date;
|
public $doc_date;
|
||||||
public $date_lim_reglement;
|
public $date_lim_reglement;
|
||||||
public $doc_type;
|
|
||||||
|
/**
|
||||||
|
* @var string doc_type
|
||||||
|
*/
|
||||||
|
public $doc_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string doc_ref
|
||||||
|
*/
|
||||||
public $doc_ref;
|
public $doc_ref;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,12 +90,35 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_docdet;
|
public $fk_docdet;
|
||||||
|
|
||||||
public $thirdparty_code;
|
/**
|
||||||
|
* @var string thirdparty code
|
||||||
|
*/
|
||||||
|
public $thirdparty_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string subledger account
|
||||||
|
*/
|
||||||
public $subledger_account;
|
public $subledger_account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string subledger label
|
||||||
|
*/
|
||||||
public $subledger_label;
|
public $subledger_label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string doc_type
|
||||||
|
*/
|
||||||
public $numero_compte;
|
public $numero_compte;
|
||||||
public $label_compte;
|
|
||||||
public $label_operation;
|
/**
|
||||||
|
* @var string label compte
|
||||||
|
*/
|
||||||
|
public $label_compte;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string label operation
|
||||||
|
*/
|
||||||
|
public $label_operation;
|
||||||
public $debit;
|
public $debit;
|
||||||
public $credit;
|
public $credit;
|
||||||
public $montant;
|
public $montant;
|
||||||
@ -784,7 +816,8 @@ class BookKeeping extends CommonObject
|
|||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
$i = 0;
|
||||||
|
while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) {
|
||||||
$line = new BookKeepingLine();
|
$line = new BookKeepingLine();
|
||||||
|
|
||||||
$line->id = $obj->rowid;
|
$line->id = $obj->rowid;
|
||||||
@ -816,6 +849,8 @@ class BookKeeping extends CommonObject
|
|||||||
$line->date_creation = $obj->date_creation;
|
$line->date_creation = $obj->date_creation;
|
||||||
|
|
||||||
$this->lines[] = $line;
|
$this->lines[] = $line;
|
||||||
|
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
@ -831,14 +866,13 @@ class BookKeeping extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
*
|
*
|
||||||
* @param string $sortorder Sort Order
|
* @param string $sortorder Sort Order
|
||||||
* @param string $sortfield Sort field
|
* @param string $sortfield Sort field
|
||||||
* @param int $limit offset limit
|
* @param int $limit Offset limit
|
||||||
* @param int $offset offset limit
|
* @param int $offset Offset limit
|
||||||
* @param array $filter filter array
|
* @param array $filter Filter array
|
||||||
* @param string $filtermode filter mode (AND or OR)
|
* @param string $filtermode Filter mode (AND or OR)
|
||||||
*
|
* @return int <0 if KO, >0 if OK
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||||
{
|
{
|
||||||
@ -861,6 +895,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " t.label_operation,";
|
$sql .= " t.label_operation,";
|
||||||
$sql .= " t.debit,";
|
$sql .= " t.debit,";
|
||||||
$sql .= " t.credit,";
|
$sql .= " t.credit,";
|
||||||
|
$sql .= " t.lettering_code,";
|
||||||
$sql .= " t.montant,";
|
$sql .= " t.montant,";
|
||||||
$sql .= " t.sens,";
|
$sql .= " t.sens,";
|
||||||
$sql .= " t.fk_user_author,";
|
$sql .= " t.fk_user_author,";
|
||||||
@ -896,7 +931,7 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql.= ' WHERE entity IN (' . getEntity('accountancy') . ')';
|
$sql.= ' WHERE t.entity IN (' . getEntity('accountancy') . ')';
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
|
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
|
||||||
}
|
}
|
||||||
@ -913,7 +948,9 @@ class BookKeeping extends CommonObject
|
|||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
$i = 0;
|
||||||
|
while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num)))
|
||||||
|
{
|
||||||
$line = new BookKeepingLine();
|
$line = new BookKeepingLine();
|
||||||
|
|
||||||
$line->id = $obj->rowid;
|
$line->id = $obj->rowid;
|
||||||
@ -933,6 +970,7 @@ class BookKeeping extends CommonObject
|
|||||||
$line->credit = $obj->credit;
|
$line->credit = $obj->credit;
|
||||||
$line->montant = $obj->montant;
|
$line->montant = $obj->montant;
|
||||||
$line->sens = $obj->sens;
|
$line->sens = $obj->sens;
|
||||||
|
$line->lettering_code = $obj->lettering_code;
|
||||||
$line->fk_user_author = $obj->fk_user_author;
|
$line->fk_user_author = $obj->fk_user_author;
|
||||||
$line->import_key = $obj->import_key;
|
$line->import_key = $obj->import_key;
|
||||||
$line->code_journal = $obj->code_journal;
|
$line->code_journal = $obj->code_journal;
|
||||||
@ -942,6 +980,8 @@ class BookKeeping extends CommonObject
|
|||||||
$line->date_modification = $this->db->jdate($obj->date_modification);
|
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||||
|
|
||||||
$this->lines[] = $line;
|
$this->lines[] = $line;
|
||||||
|
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
@ -949,8 +989,7 @@ class BookKeeping extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
|
return -1;
|
||||||
return - 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1000,8 +1039,7 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql.= ' WHERE 1 = 1';
|
$sql.= ' WHERE entity IN (' . getEntity('accountancy') . ')';
|
||||||
$sql .= " AND entity IN (" . getEntity('accountancy') . ")";
|
|
||||||
if (count($sqlwhere) > 0) {
|
if (count($sqlwhere) > 0) {
|
||||||
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
|
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
|
||||||
}
|
}
|
||||||
@ -1016,16 +1054,22 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql)
|
||||||
|
{
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
$i = 0;
|
||||||
|
while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num)))
|
||||||
|
{
|
||||||
$line = new BookKeepingLine();
|
$line = new BookKeepingLine();
|
||||||
|
|
||||||
$line->numero_compte = $obj->numero_compte;
|
$line->numero_compte = $obj->numero_compte;
|
||||||
$line->debit = $obj->debit;
|
$line->debit = $obj->debit;
|
||||||
$line->credit = $obj->credit;
|
$line->credit = $obj->credit;
|
||||||
|
|
||||||
$this->lines[] = $line;
|
$this->lines[] = $line;
|
||||||
|
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
@ -1533,7 +1577,7 @@ class BookKeeping extends CommonObject
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
||||||
while ( $obj = $this->db->fetch_object($result) ) {
|
while ($obj = $this->db->fetch_object($result)) {
|
||||||
|
|
||||||
$line = new BookKeepingLine();
|
$line = new BookKeepingLine();
|
||||||
|
|
||||||
@ -1597,7 +1641,7 @@ class BookKeeping extends CommonObject
|
|||||||
$this->linesexport = array ();
|
$this->linesexport = array ();
|
||||||
|
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$line = new BookKeepingLine();
|
$line = new BookKeepingLine();
|
||||||
|
|
||||||
$line->id = $obj->rowid;
|
$line->id = $obj->rowid;
|
||||||
@ -1635,9 +1679,9 @@ class BookKeeping extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Transform transaction
|
* Transform transaction
|
||||||
*
|
*
|
||||||
* @param number $direction If 0 tmp => real, if 1 real => tmp
|
* @param number $direction If 0 tmp => real, if 1 real => tmp
|
||||||
* @param string $piece_num Piece num
|
* @param string $piece_num Piece num
|
||||||
* @return void
|
* @return int int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function transformTransaction($direction=0,$piece_num='')
|
public function transformTransaction($direction=0,$piece_num='')
|
||||||
{
|
{
|
||||||
@ -1673,8 +1717,7 @@ class BookKeeping extends CommonObject
|
|||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
} elseif ($direction==1) {
|
||||||
if ($direction==1) {
|
|
||||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;
|
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
@ -1829,7 +1872,6 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $obj->label;
|
return $obj->label;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Error " . $this->db->lasterror();
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,26 +19,27 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file accountancy/class/bookkeeping.class.php
|
* \file htdocs/accountancy/class/lettering.class.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief File of class for lettering
|
* \brief File of class for lettering
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . "/accountancy/class/bookkeeping.class.php";
|
include_once DOL_DOCUMENT_ROOT . "/accountancy/class/bookkeeping.class.php";
|
||||||
include_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php";
|
include_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php";
|
||||||
include_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php";
|
include_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class lettering
|
* Class Lettering
|
||||||
*/
|
*/
|
||||||
class lettering extends BookKeeping
|
class Lettering extends BookKeeping
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* lettrageTiers
|
* letteringThirdparty
|
||||||
*
|
*
|
||||||
* @param int $socid Thirdparty id
|
* @param int $socid Thirdparty id
|
||||||
* @return int 1 OK, <0 error
|
* @return int 1 OK, <0 error
|
||||||
*/
|
*/
|
||||||
public function lettrageTiers($socid)
|
public function letteringThirdparty($socid)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -47,6 +49,7 @@ class lettering extends BookKeeping
|
|||||||
$object->id = $socid;
|
$object->id = $socid;
|
||||||
$object->fetch($socid);
|
$object->fetch($socid);
|
||||||
|
|
||||||
|
|
||||||
if ($object->code_compta == '411CUSTCODE') {
|
if ($object->code_compta == '411CUSTCODE') {
|
||||||
$object->code_compta = '';
|
$object->code_compta = '';
|
||||||
}
|
}
|
||||||
@ -208,7 +211,7 @@ class lettering extends BookKeeping
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($ids) > 1) {
|
if (count($ids) > 1) {
|
||||||
$result = $this->updatelettrage($ids);
|
$result = $this->updateLettering($ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,7 +232,7 @@ class lettering extends BookKeeping
|
|||||||
* @param boolean $notrigger no trigger
|
* @param boolean $notrigger no trigger
|
||||||
* @return number
|
* @return number
|
||||||
*/
|
*/
|
||||||
public function updateLettrage($ids = array(), $notrigger = false)
|
public function updateLettering($ids = array(), $notrigger = false)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$lettre = 'AAA';
|
$lettre = 'AAA';
|
||||||
|
|||||||
@ -94,7 +94,7 @@ $facture_static = new Facture($db);
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
if (! empty($id)) {
|
if (! empty($id)) {
|
||||||
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,";
|
$sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,";
|
||||||
$sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, p.accountancy_code_sell as code_sell,";
|
$sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, p.accountancy_code_sell as code_sell,";
|
||||||
$sql .= " l.fk_code_ventilation, aa.account_number, aa.label";
|
$sql .= " l.fk_code_ventilation, aa.account_number, aa.label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l";
|
||||||
@ -128,7 +128,7 @@ if (! empty($id)) {
|
|||||||
|
|
||||||
// Ref facture
|
// Ref facture
|
||||||
print '<tr><td>' . $langs->trans("Invoice") . '</td>';
|
print '<tr><td>' . $langs->trans("Invoice") . '</td>';
|
||||||
$facture_static->ref = $objp->facnumber;
|
$facture_static->ref = $objp->ref;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -64,7 +64,7 @@ $pageprev = $page - 1;
|
|||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
if (! $sortfield)
|
if (! $sortfield)
|
||||||
$sortfield = "f.datef, f.facnumber, fd.rowid";
|
$sortfield = "f.datef, f.ref, fd.rowid";
|
||||||
if (! $sortorder) {
|
if (! $sortorder) {
|
||||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||||
$sortorder = "DESC";
|
$sortorder = "DESC";
|
||||||
@ -135,7 +135,6 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
|
|
||||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +167,7 @@ print '<script type="text/javascript">
|
|||||||
/*
|
/*
|
||||||
* Customer Invoice lines
|
* Customer Invoice lines
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.type, f.datef, f.ref_client,";
|
$sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
|
||||||
$sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
$sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||||
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||||
@ -196,7 +195,7 @@ if ($search_lineid) {
|
|||||||
$sql .= natural_search("fd.rowid", $search_lineid, 1);
|
$sql .= natural_search("fd.rowid", $search_lineid, 1);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_invoice))) {
|
||||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
$sql .= natural_search("f.ref", $search_invoice);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
$sql .= natural_search("p.ref", $search_ref);
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
@ -332,8 +331,8 @@ if ($result) {
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||||
|
|||||||
@ -75,7 +75,7 @@ $offset = $limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (! $sortfield)
|
if (! $sortfield)
|
||||||
$sortfield = "f.datef, f.facnumber, l.rowid";
|
$sortfield = "f.datef, f.ref, l.rowid";
|
||||||
if (! $sortorder) {
|
if (! $sortorder) {
|
||||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||||
$sortorder = "DESC";
|
$sortorder = "DESC";
|
||||||
@ -209,7 +209,7 @@ if (empty($chartaccountcode))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Customer Invoice lines
|
// Customer Invoice lines
|
||||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.datef, f.type as ftype,";
|
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
||||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||||
$sql.= " aa.rowid as aarowid,";
|
$sql.= " aa.rowid as aarowid,";
|
||||||
@ -233,7 +233,7 @@ if ($search_lineid) {
|
|||||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_invoice))) {
|
||||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
$sql .= natural_search("f.ref", $search_invoice);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
$sql .= natural_search("p.ref", $search_ref);
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
@ -399,8 +399,8 @@ if ($result) {
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||||
|
|||||||
@ -61,13 +61,13 @@ if ($conf->accounting->enabled)
|
|||||||
|
|
||||||
// STEPS
|
// STEPS
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>'.'</a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>'.'</a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>'.'</a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -76,20 +76,20 @@ if ($conf->accounting->enabled)
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>'.'</a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong>')."\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong>'.'</a>')."\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>'.'</a>';
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
if (! empty($conf->tax->enabled))
|
if (! empty($conf->tax->enabled))
|
||||||
{
|
{
|
||||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>'.'</a>';
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -105,7 +105,7 @@ if ($conf->accounting->enabled)
|
|||||||
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>'.'</a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -123,7 +123,7 @@ if ($conf->accounting->enabled)
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>'.'</a>');
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
@ -139,16 +139,19 @@ if ($conf->accounting->enabled)
|
|||||||
$langs->loadLangs(array('bills', 'trips'));
|
$langs->loadLangs(array('bills', 'trips'));
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>'.'</a>')."\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>'.'</a>')."\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled))
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
{
|
||||||
print "<br>\n";
|
$step++;
|
||||||
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>'.'</a>')."\n";
|
||||||
|
print "<br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
|
||||||
@ -149,12 +150,15 @@ $paymentvariousstatic = new PaymentVarious($db);
|
|||||||
$paymentloanstatic = new PaymentLoan($db);
|
$paymentloanstatic = new PaymentLoan($db);
|
||||||
$accountLinestatic=new AccountLine($db);
|
$accountLinestatic=new AccountLine($db);
|
||||||
|
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
|
||||||
// Get code of finance journal
|
// Get code of finance journal
|
||||||
$accountingjournalstatic = new AccountingJournal($db);
|
$accountingjournalstatic = new AccountingJournal($db);
|
||||||
$accountingjournalstatic->fetch($id_journal);
|
$accountingjournalstatic->fetch($id_journal);
|
||||||
$journal = $accountingjournalstatic->code;
|
$journal = $accountingjournalstatic->code;
|
||||||
$journal_label = $accountingjournalstatic->label;
|
$journal_label = $accountingjournalstatic->label;
|
||||||
|
|
||||||
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -461,7 +465,11 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = $langs->trans("Bank");
|
|
||||||
|
$accountingaccount->fetch(null, $k, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
|
$bookkeeping->label_operation = $reflabel;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||||
@ -517,6 +525,7 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->doc_type = 'bank';
|
$bookkeeping->doc_type = 'bank';
|
||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||||
|
$bookkeeping->label_operation = $reflabel;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||||
@ -530,22 +539,30 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
} else if ($tabtype[$key] == 'payment_expensereport') {
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_salary') {
|
} else if ($tabtype[$key] == 'payment_salary') {
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
@ -555,27 +572,37 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_donation') {
|
} else if ($tabtype[$key] == 'payment_donation') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_loan') {
|
} else if ($tabtype[$key] == 'payment_loan') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_various') {
|
} else if ($tabtype[$key] == 'payment_various') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'banktransfert') {
|
} else if ($tabtype[$key] == 'banktransfert') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else {
|
} else {
|
||||||
if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
|
if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
|
||||||
{
|
{
|
||||||
@ -583,7 +610,9 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$bookkeeping->label_operation = $reflabel;
|
$bookkeeping->label_operation = $reflabel;
|
||||||
@ -721,6 +750,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
$filename = 'journal';
|
$filename = 'journal';
|
||||||
|
$type_export = 'journal';
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
// CSV header line
|
// CSV header line
|
||||||
@ -1112,7 +1142,7 @@ $db->close();
|
|||||||
*
|
*
|
||||||
* @param string $val Array of val
|
* @param string $val Array of val
|
||||||
* @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
|
* @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
|
||||||
* @return string|unknown
|
* @return string A string label to describe a record into llx_bank_url
|
||||||
*/
|
*/
|
||||||
function getSourceDocRef($val, $typerecord)
|
function getSourceDocRef($val, $typerecord)
|
||||||
{
|
{
|
||||||
@ -1149,7 +1179,7 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
$sqlmid = '';
|
$sqlmid = '';
|
||||||
if ($typerecord == 'payment')
|
if ($typerecord == 'payment')
|
||||||
{
|
{
|
||||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.facnumber as ref';
|
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=" . $val["paymentid"];
|
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=" . $val["paymentid"];
|
||||||
$ref = $langs->trans("Invoice");
|
$ref = $langs->trans("Invoice");
|
||||||
@ -1220,7 +1250,8 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
{
|
{
|
||||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||||
$resultmid = $db->query($sqlmid);
|
$resultmid = $db->query($sqlmid);
|
||||||
if ($resultmid) {
|
if ($resultmid)
|
||||||
|
{
|
||||||
while ($objmid = $db->fetch_object($resultmid))
|
while ($objmid = $db->fetch_object($resultmid))
|
||||||
{
|
{
|
||||||
$ref.=' '.$objmid->ref;
|
$ref.=' '.$objmid->ref;
|
||||||
@ -1229,6 +1260,6 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = dol_trunc($langs->trans("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 ... i< < than max size of 300
|
$ref = dol_trunc($langs->trans("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
|
||||||
return $ref;
|
return $ref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -61,6 +61,7 @@ if ($user->societe_id > 0)
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
|
||||||
// Get informations of journal
|
// Get informations of journal
|
||||||
$accountingjournalstatic = new AccountingJournal($db);
|
$accountingjournalstatic = new AccountingJournal($db);
|
||||||
@ -208,8 +209,12 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code'];
|
$bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code'];
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['user_accountancy_code'];
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
$bookkeeping->label_operation = $tabuser[$key]['name'];
|
$bookkeeping->label_operation = $tabuser[$key]['name'];
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||||
@ -248,7 +253,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
if ($mt) {
|
if ($mt) {
|
||||||
// get compte id and label
|
// get compte id and label
|
||||||
$accountingaccount = new AccountingAccount($db);
|
|
||||||
if ($accountingaccount->fetch(null, $k, true)) {
|
if ($accountingaccount->fetch(null, $k, true)) {
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
@ -260,6 +264,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
$bookkeeping->label_operation = $accountingaccount->label;
|
$bookkeeping->label_operation = $accountingaccount->label;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||||
@ -316,6 +321,10 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
$bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %';
|
$bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %';
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||||
@ -420,6 +429,7 @@ $userstatic = new User($db);
|
|||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
$filename = 'journal';
|
$filename = 'journal';
|
||||||
|
$type_export = 'journal';
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
// Model Cegid Expert Export
|
// Model Cegid Expert Export
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -66,10 +66,7 @@ $parameters=array();
|
|||||||
*/
|
*/
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
/*
|
|
||||||
* Views
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Get informations of journal
|
// Get informations of journal
|
||||||
$accountingjournalstatic = new AccountingJournal($db);
|
$accountingjournalstatic = new AccountingJournal($db);
|
||||||
@ -310,8 +307,12 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||||
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
|
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
|
||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
|
||||||
$bookkeeping->subledger_label = ''; // TODO To complete
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount");
|
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount");
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||||
@ -352,7 +353,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
//if ($mt) {
|
//if ($mt) {
|
||||||
// get compte id and label
|
// get compte id and label
|
||||||
$accountingaccount = new AccountingAccount($db);
|
|
||||||
if ($accountingaccount->fetch(null, $k, true)) {
|
if ($accountingaccount->fetch(null, $k, true)) {
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
@ -366,6 +366,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label;
|
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||||
@ -426,6 +427,10 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'');
|
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'');
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||||
@ -581,6 +586,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
$filename = 'journal';
|
$filename = 'journal';
|
||||||
|
$type_export = 'journal';
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
$companystatic = new Fournisseur($db);
|
$companystatic = new Fournisseur($db);
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -70,6 +70,8 @@ $parameters=array();
|
|||||||
|
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
$accountingaccount = new AccountingAccount($db);
|
||||||
|
|
||||||
// Get informations of journal
|
// Get informations of journal
|
||||||
$accountingjournalstatic = new AccountingJournal($db);
|
$accountingjournalstatic = new AccountingJournal($db);
|
||||||
$accountingjournalstatic->fetch($id_journal);
|
$accountingjournalstatic->fetch($id_journal);
|
||||||
@ -95,7 +97,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
|
|||||||
|
|
||||||
$idpays = $mysoc->country_id;
|
$idpays = $mysoc->country_id;
|
||||||
|
|
||||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
|
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
|
||||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
|
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||||
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||||
@ -193,7 +195,7 @@ if ($result) {
|
|||||||
// Invoice lines
|
// Invoice lines
|
||||||
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
|
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
|
||||||
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
|
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
|
||||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
$tabfac[$obj->rowid]["ref"] = $obj->ref;
|
||||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||||
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
|
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
|
||||||
$tabfac[$obj->rowid]["close_code"] = $obj->close_code; // close_code = 'replaced' for replacement invoices (not used in most european countries)
|
$tabfac[$obj->rowid]["close_code"] = $obj->close_code; // close_code = 'replaced' for replacement invoices (not used in most european countries)
|
||||||
@ -317,8 +319,12 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||||
$bookkeeping->thirdparty_code = $companystatic->code_client;
|
$bookkeeping->thirdparty_code = $companystatic->code_client;
|
||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||||
$bookkeeping->subledger_label = ''; // TODO To complete
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
|
|
||||||
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount");
|
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount");
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||||
@ -359,7 +365,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
foreach ( $tabht[$key] as $k => $mt ) {
|
foreach ( $tabht[$key] as $k => $mt ) {
|
||||||
//if ($mt) {
|
//if ($mt) {
|
||||||
// get compte id and label
|
// get compte id and label
|
||||||
$accountingaccount = new AccountingAccount($db);
|
|
||||||
if ($accountingaccount->fetch(null, $k, true)) {
|
if ($accountingaccount->fetch(null, $k, true)) {
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
@ -373,6 +378,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label;
|
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label;
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
@ -432,6 +438,10 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
|
$accountingaccount->fetch($k, null, true);
|
||||||
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
|
|
||||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'');
|
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]) .' %' . ($numtax?' - Localtax '.$numtax:'');
|
||||||
$bookkeeping->montant = $mt;
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
@ -490,7 +500,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
break; // Break in the foreach
|
break; // Break in the foreach
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabpay = $tabfac;
|
$tabpay = $tabfac;
|
||||||
@ -538,6 +547,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
|
|
||||||
$filename = 'journal';
|
$filename = 'journal';
|
||||||
|
$type_export = 'journal';
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
$companystatic = new Client($db);
|
$companystatic = new Client($db);
|
||||||
|
|||||||
@ -96,7 +96,7 @@ $facturefournisseur_static = new FactureFournisseur($db);
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
if (! empty($id)) {
|
if (! empty($id)) {
|
||||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
|
$sql = "SELECT f.ref as ref, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label";
|
||||||
$sql .= ", aa.account_number, aa.label";
|
$sql .= ", aa.account_number, aa.label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||||
@ -129,7 +129,7 @@ if (! empty($id)) {
|
|||||||
|
|
||||||
// ref invoice
|
// ref invoice
|
||||||
print '<tr><td>' . $langs->trans("BillsSuppliers") . '</td>';
|
print '<tr><td>' . $langs->trans("BillsSuppliers") . '</td>';
|
||||||
$facturefournisseur_static->ref = $objp->facnumber;
|
$facturefournisseur_static->ref = $objp->ref;
|
||||||
$facturefournisseur_static->id = $objp->facid;
|
$facturefournisseur_static->id = $objp->facid;
|
||||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@zendsi.com>
|
/* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,11 +27,39 @@ $code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE;
|
|||||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||||
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||||
|
$siren = $conf->global->MAIN_INFO_SIREN;
|
||||||
|
|
||||||
$date_export = "_" . dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
$date_export = "_" . dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||||
|
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
header('Content-Type: text/csv');
|
||||||
|
|
||||||
$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format;
|
|
||||||
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger
|
||||||
|
{
|
||||||
|
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
|
||||||
|
if (empty($search_date_end))
|
||||||
|
{
|
||||||
|
// TODO Get the max date into bookeeping table
|
||||||
|
$search_date_end = dol_now();
|
||||||
|
}
|
||||||
|
$datetouseforfilename = $search_date_end;
|
||||||
|
$tmparray=dol_getdate($datetouseforfilename);
|
||||||
|
$fiscalmonth=empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START;
|
||||||
|
// Define end of month to use
|
||||||
|
if ($tmparray['mon'] <= $fiscalmonth) $tmparray['mon']=$fiscalmonth;
|
||||||
|
else {
|
||||||
|
$tmparray['mon'] = $fiscalmonth;
|
||||||
|
$tmparray['year']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||||
|
|
||||||
|
$completefilename = $siren . "FEC" . $endaccountingperiod . "." . $format;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format;
|
||||||
|
}
|
||||||
|
|
||||||
header('Content-Disposition: attachment;filename=' . $completefilename);
|
header('Content-Disposition: attachment;filename=' . $completefilename);
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
@ -147,8 +147,9 @@ $constantes=array(
|
|||||||
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */
|
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */
|
||||||
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */
|
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */
|
||||||
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */
|
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */
|
||||||
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
|
|
||||||
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */
|
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */
|
||||||
|
'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
|
||||||
|
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
|
||||||
);
|
);
|
||||||
|
|
||||||
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
@ -644,18 +644,25 @@ if (empty($reshook))
|
|||||||
$msg = $arraydefaultmessage->content;
|
$msg = $arraydefaultmessage->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
if (empty($labeltouse) || (int) $labeltouse === -1) {
|
||||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
//fallback on the old configuration.
|
||||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
|
||||||
|
|
||||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
|
||||||
|
|
||||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
}
|
||||||
|
else {
|
||||||
|
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||||
|
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
||||||
|
|
||||||
|
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -718,19 +725,26 @@ if (empty($reshook))
|
|||||||
$msg = $arraydefaultmessage->content;
|
$msg = $arraydefaultmessage->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
if (empty($labeltouse) || (int) $labeltouse === -1) {
|
||||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
//fallback on the old configuration.
|
||||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
|
$error++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||||
|
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
||||||
|
|
||||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||||
}
|
if ($result < 0)
|
||||||
if ($result < 0)
|
{
|
||||||
{
|
$error++;
|
||||||
$error++;
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -789,7 +803,6 @@ if (empty($reshook))
|
|||||||
$mode='emailfrommember';
|
$mode='emailfrommember';
|
||||||
$trackid='mem'.$object->id;
|
$trackid='mem'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -894,7 +907,7 @@ else
|
|||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||||
{
|
{
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'"></td></tr>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'" autofocus="autofocus"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Password
|
// Password
|
||||||
@ -1018,7 +1031,7 @@ else
|
|||||||
// Categories
|
// Categories
|
||||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||||
{
|
{
|
||||||
print '<tr><td>' . fieldLabel('Categories', 'memcars') . '</td><td>';
|
print '<tr><td>' .$form->editfieldkey("Categories", 'memcats', '', $object, 0) . '</td><td>';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
|
||||||
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
|
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -1141,7 +1154,7 @@ else
|
|||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="minwidth300" maxlength="50" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Password
|
// Password
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||||
{
|
{
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
|
||||||
@ -1268,13 +1281,16 @@ else
|
|||||||
// Categories
|
// Categories
|
||||||
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||||
{
|
{
|
||||||
print '<tr><td>' . fieldLabel('Categories', 'memcats') . '</td>';
|
print '<tr><td>' . $form->editfieldkey("Categories", 'memcats', '', $object, 0) . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
|
||||||
$c = new Categorie($db);
|
$c = new Categorie($db);
|
||||||
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
|
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
|
||||||
foreach ($cats as $cat) {
|
$arrayselected = array();
|
||||||
$arrayselected[] = $cat->id;
|
if (is_array($cats)) {
|
||||||
|
foreach ($cats as $cat) {
|
||||||
|
$arrayselected[] = $cat->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -1320,7 +1336,6 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id > 0 && $action != 'edit')
|
if ($id > 0 && $action != 'edit')
|
||||||
@ -1622,11 +1637,8 @@ else
|
|||||||
if (! empty($conf->societe->enabled))
|
if (! empty($conf->societe->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
$editenable = $user->rights->adherent->creer;
|
||||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
|
||||||
print '</td>';
|
|
||||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
|
|
||||||
print '</tr></table>';
|
|
||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
if ($action == 'editthirdparty')
|
if ($action == 'editthirdparty')
|
||||||
{
|
{
|
||||||
@ -1660,19 +1672,8 @@ else
|
|||||||
|
|
||||||
// Login Dolibarr
|
// Login Dolibarr
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
|
||||||
print $langs->trans("LinkedToDolibarrUser");
|
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
|
||||||
print '</td>';
|
|
||||||
if ($action != 'editlogin' && $user->rights->adherent->creer)
|
|
||||||
{
|
|
||||||
print '<td align="right">';
|
|
||||||
if ($user->rights->user->user->creer)
|
|
||||||
{
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
print '</tr></table>';
|
|
||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
if ($action == 'editlogin')
|
if ($action == 'editlogin')
|
||||||
{
|
{
|
||||||
@ -1858,7 +1859,6 @@ else
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n";
|
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -208,7 +208,6 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
|||||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
||||||
}
|
}
|
||||||
if (! $mesg) $result=members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs);
|
if (! $mesg) $result=members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs);
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($mode == 'label')
|
elseif ($mode == 'label')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -59,6 +59,9 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
public $mesgs;
|
public $mesgs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string login of member
|
||||||
|
*/
|
||||||
public $login;
|
public $login;
|
||||||
|
|
||||||
//! Clear password in memory
|
//! Clear password in memory
|
||||||
@ -68,39 +71,105 @@ class Adherent extends CommonObject
|
|||||||
//! Encrypted password in database (always defined)
|
//! Encrypted password in database (always defined)
|
||||||
public $pass_indatabase_crypted;
|
public $pass_indatabase_crypted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string company name
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $societe;
|
public $societe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Societe $company {@type Societe}
|
* @var string company name
|
||||||
*/
|
*/
|
||||||
public $company;
|
public $company;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Thirdparty ID
|
||||||
|
*/
|
||||||
|
public $fk_soc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Address
|
* @var string Address
|
||||||
*/
|
*/
|
||||||
public $address;
|
public $address;
|
||||||
|
|
||||||
public $zip;
|
/**
|
||||||
|
* @var string zipcode
|
||||||
|
*/
|
||||||
|
public $zip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string town
|
||||||
|
*/
|
||||||
public $town;
|
public $town;
|
||||||
|
|
||||||
public $state_id; // Id of department
|
/**
|
||||||
public $state_code; // Code of department
|
* @var int Id of state
|
||||||
public $state; // Label of department
|
*/
|
||||||
|
public $state_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Code of state
|
||||||
|
*/
|
||||||
|
public $state_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Label of state
|
||||||
|
*/
|
||||||
|
public $state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string email
|
||||||
|
*/
|
||||||
public $email;
|
public $email;
|
||||||
|
|
||||||
public $skype;
|
/**
|
||||||
public $twitter;
|
* @var string skype account
|
||||||
|
*/
|
||||||
|
public $skype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string twitter account
|
||||||
|
*/
|
||||||
|
public $twitter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string facebook account
|
||||||
|
*/
|
||||||
public $facebook;
|
public $facebook;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Phone number
|
||||||
|
*/
|
||||||
public $phone;
|
public $phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Private Phone number
|
||||||
|
*/
|
||||||
public $phone_perso;
|
public $phone_perso;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Mobile phone number
|
||||||
|
*/
|
||||||
public $phone_mobile;
|
public $phone_mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Fax number
|
||||||
|
*/
|
||||||
|
public $fax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Function
|
||||||
|
*/
|
||||||
|
public $poste;
|
||||||
|
|
||||||
public $morphy;
|
public $morphy;
|
||||||
public $public;
|
public $public;
|
||||||
public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
|
|
||||||
public $photo;
|
// -1:brouillon, 0:resilie, >=1:valide,paye
|
||||||
|
// def in common object
|
||||||
|
//public $statut;
|
||||||
|
|
||||||
|
public $photo;
|
||||||
|
|
||||||
public $datec;
|
public $datec;
|
||||||
public $datem;
|
public $datem;
|
||||||
@ -108,21 +177,20 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
public $birth;
|
public $birth;
|
||||||
|
|
||||||
public $note_public;
|
/**
|
||||||
public $note_private;
|
* @var int id type member
|
||||||
|
*/
|
||||||
|
public $typeid;
|
||||||
|
|
||||||
public $typeid; // Id type adherent
|
/**
|
||||||
public $type; // Libelle type adherent
|
* @var string label type member
|
||||||
|
*/
|
||||||
|
public $type;
|
||||||
public $need_subscription;
|
public $need_subscription;
|
||||||
|
|
||||||
public $user_id;
|
public $user_id;
|
||||||
public $user_login;
|
public $user_login;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int Thirdparty ID
|
|
||||||
*/
|
|
||||||
public $fk_soc;
|
|
||||||
|
|
||||||
public $datefin; // From member table
|
public $datefin; // From member table
|
||||||
|
|
||||||
// Fields loaded by fetch_subscriptions()
|
// Fields loaded by fetch_subscriptions()
|
||||||
@ -134,7 +202,10 @@ class Adherent extends CommonObject
|
|||||||
public $last_subscription_amount;
|
public $last_subscription_amount;
|
||||||
public $subscriptions=array();
|
public $subscriptions=array();
|
||||||
|
|
||||||
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
/**
|
||||||
|
* @var Adherent To contains a clone of this when we need to save old properties of object
|
||||||
|
*/
|
||||||
|
public $oldcopy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Entity
|
* @var int Entity
|
||||||
@ -572,11 +643,11 @@ class Adherent extends CommonObject
|
|||||||
$luser->societe_id=$this->societe;
|
$luser->societe_id=$this->societe;
|
||||||
|
|
||||||
$luser->birth=$this->birth;
|
$luser->birth=$this->birth;
|
||||||
$luser->address=$this->address;
|
$luser->address=$this->address;
|
||||||
$luser->zip=$this->zip;
|
$luser->zip=$this->zip;
|
||||||
$luser->town=$this->town;
|
$luser->town=$this->town;
|
||||||
$luser->country_id=$this->country_id;
|
$luser->country_id=$this->country_id;
|
||||||
$luser->state_id=$this->state_id;
|
$luser->state_id=$this->state_id;
|
||||||
|
|
||||||
$luser->email=$this->email;
|
$luser->email=$this->email;
|
||||||
$luser->skype=$this->skype;
|
$luser->skype=$this->skype;
|
||||||
@ -2488,7 +2559,6 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2624,12 +2694,18 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$blockingerrormsg = '';
|
$blockingerrormsg = '';
|
||||||
|
|
||||||
/*if (empty($conf->global->MEMBER_REMINDER_EMAIL))
|
if (empty($conf->adherent->enabled)) // Should not happen. If module disabled, cron job should not be visible.
|
||||||
|
{
|
||||||
|
$langs->load("agenda");
|
||||||
|
$this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (empty($conf->global->MEMBER_REMINDER_EMAIL))
|
||||||
{
|
{
|
||||||
$langs->load("agenda");
|
$langs->load("agenda");
|
||||||
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
|
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
|
||||||
return 0;
|
return 0;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$nbok = 0;
|
$nbok = 0;
|
||||||
@ -2716,8 +2792,58 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
$nbok++;
|
$nbok++;
|
||||||
|
|
||||||
// TODO Add event email sent for member
|
$message = $msg;
|
||||||
|
$sendto = $to;
|
||||||
|
$sendtocc = '';
|
||||||
|
$sendtobcc = '';
|
||||||
|
$actioncode='EMAIL';
|
||||||
|
$extraparams='';
|
||||||
|
|
||||||
|
$actionmsg='';
|
||||||
|
$actionmsg2=$langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from,4,0,1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto,4,0,1);
|
||||||
|
if ($message)
|
||||||
|
{
|
||||||
|
$actionmsg=$langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
|
||||||
|
$actionmsg=dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
|
||||||
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . dol_escape_htmltag($sendtocc));
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||||
|
|
||||||
|
// Insert record of emails sent
|
||||||
|
$actioncomm = new ActionComm($this->db);
|
||||||
|
|
||||||
|
$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
|
||||||
|
$actioncomm->code = 'AC_'.$actioncode;
|
||||||
|
$actioncomm->label = $actionmsg2;
|
||||||
|
$actioncomm->note = $actionmsg;
|
||||||
|
$actioncomm->fk_project = 0;
|
||||||
|
$actioncomm->datep = $now;
|
||||||
|
$actioncomm->datef = $now;
|
||||||
|
$actioncomm->percentage = -1; // Not applicable
|
||||||
|
$actioncomm->socid = $adherent->thirdparty->id;
|
||||||
|
$actioncomm->contactid = 0;
|
||||||
|
$actioncomm->authorid = $user->id; // User saving action
|
||||||
|
$actioncomm->userownerid = $user->id; // Owner of action
|
||||||
|
// Fields when action is en email (content should be added into note)
|
||||||
|
$actioncomm->email_msgid = $cmail->msgid;
|
||||||
|
$actioncomm->email_from = $from;
|
||||||
|
$actioncomm->email_sender= '';
|
||||||
|
$actioncomm->email_to = $to;
|
||||||
|
$actioncomm->email_tocc = $sendtocc;
|
||||||
|
$actioncomm->email_tobcc = $sendtobcc;
|
||||||
|
$actioncomm->email_subject = $subject;
|
||||||
|
$actioncomm->errors_to = '';
|
||||||
|
|
||||||
|
$actioncomm->fk_element = $adherent->id;
|
||||||
|
$actioncomm->elementtype = $adherent->element;
|
||||||
|
|
||||||
|
$actioncomm->extraparams = $extraparams;
|
||||||
|
|
||||||
|
$actioncomm->create($user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
|
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
|
||||||
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -337,11 +337,14 @@ class Subscription extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return clicable name (with picto eventually)
|
* Return clicable name (with picto eventually)
|
||||||
*
|
*
|
||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string Chaine avec URL
|
* @param string $option Page for link ('', 'nolink', ...)
|
||||||
|
* @param string $morecss Add more css on link
|
||||||
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $notooltip=0)
|
function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -350,8 +353,18 @@ class Subscription extends CommonObject
|
|||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$label=$langs->trans("ShowSubscription").': '.$this->ref;
|
$label=$langs->trans("ShowSubscription").': '.$this->ref;
|
||||||
|
|
||||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$url = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id;
|
||||||
$linkend='</a>';
|
|
||||||
|
if ($option != 'nolink')
|
||||||
|
{
|
||||||
|
// Add param to save lastsearch_values or not
|
||||||
|
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||||
|
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||||
|
}
|
||||||
|
|
||||||
|
$linkstart = '<a href="'.$url.'" class="classfortooltip" title="'.dol_escape_htmltag($label, 1).'">';
|
||||||
|
$linkend = '</a>';
|
||||||
|
|
||||||
$picto='payment';
|
$picto='payment';
|
||||||
|
|
||||||
@ -416,7 +429,6 @@ class Subscription extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -55,7 +55,7 @@ $AdherentsResilies=array();
|
|||||||
|
|
||||||
$AdherentType=array();
|
$AdherentType=array();
|
||||||
|
|
||||||
// Liste les adherents
|
// Members list
|
||||||
$sql = "SELECT t.rowid, t.libelle as label, t.subscription,";
|
$sql = "SELECT t.rowid, t.libelle as label, t.subscription,";
|
||||||
$sql.= " d.statut, count(d.rowid) as somme";
|
$sql.= " d.statut, count(d.rowid) as somme";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
@ -92,7 +92,7 @@ if ($result)
|
|||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// List members up to date
|
// Members up to date list
|
||||||
// current rule: uptodate = the end date is in future whatever is type
|
// current rule: uptodate = the end date is in future whatever is type
|
||||||
// old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future)
|
// old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future)
|
||||||
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
||||||
@ -140,7 +140,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
foreach($listofsearchfields as $key => $value)
|
foreach($listofsearchfields as $key => $value)
|
||||||
{
|
{
|
||||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
|
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label>:</td><td><input type="text" class="flat inputsearch" 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>';
|
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2006-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -79,14 +79,15 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) { $sortorder=($filter=='outofdate'?"DESC":"ASC"); }
|
if (! $sortorder) { $sortorder=($filter=='outofdate'?"DESC":"ASC"); }
|
||||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
|
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
|
||||||
$object = new Adherent($db);
|
$object = new Adherent($db);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('memberlist'));
|
$hookmanager->initHooks(array('memberlist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('adherent');
|
$extralabels = $extrafields->fetch_name_optionals_label('adherent');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
$fieldstosearchall = array(
|
$fieldstosearchall = array(
|
||||||
@ -348,8 +349,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
// 'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
// 'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
@ -603,6 +604,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="c
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$totalarray=array();
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -631,6 +633,7 @@ while ($i < min($num, $limit))
|
|||||||
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
|
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$obj->rowid.'</td>';
|
print '<td align="center">'.$obj->rowid.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -639,6 +642,7 @@ while ($i < min($num, $limit))
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
|
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Civility
|
// Civility
|
||||||
if (! empty($arrayfields['d.civility']['checked']))
|
if (! empty($arrayfields['d.civility']['checked']))
|
||||||
@ -646,6 +650,7 @@ while ($i < min($num, $limit))
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->civility;
|
print $obj->civility;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Firstname
|
// Firstname
|
||||||
if (! empty($arrayfields['d.firstname']['checked']))
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
@ -653,6 +658,7 @@ while ($i < min($num, $limit))
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->firstname;
|
print $obj->firstname;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Lastname
|
// Lastname
|
||||||
if (! empty($arrayfields['d.lastname']['checked']))
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
@ -660,6 +666,7 @@ while ($i < min($num, $limit))
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->lastname;
|
print $obj->lastname;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Company
|
// Company
|
||||||
if (! empty($arrayfields['d.company']['checked']))
|
if (! empty($arrayfields['d.company']['checked']))
|
||||||
@ -672,11 +679,13 @@ while ($i < min($num, $limit))
|
|||||||
if (! empty($arrayfields['d.login']['checked']))
|
if (! empty($arrayfields['d.login']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->login."</td>\n";
|
print "<td>".$obj->login."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Moral/Physique
|
// Moral/Physique
|
||||||
if (! empty($arrayfields['d.morphy']['checked']))
|
if (! empty($arrayfields['d.morphy']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
|
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Type label
|
// Type label
|
||||||
if (! empty($arrayfields['t.libelle']['checked']))
|
if (! empty($arrayfields['t.libelle']['checked']))
|
||||||
@ -686,6 +695,7 @@ while ($i < min($num, $limit))
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $membertypestatic->getNomUrl(1,32);
|
print $membertypestatic->getNomUrl(1,32);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Address
|
// Address
|
||||||
if (! empty($arrayfields['d.address']['checked']))
|
if (! empty($arrayfields['d.address']['checked']))
|
||||||
@ -693,6 +703,7 @@ while ($i < min($num, $limit))
|
|||||||
print '<td class="nocellnopadd">';
|
print '<td class="nocellnopadd">';
|
||||||
print $obj->address;
|
print $obj->address;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Zip
|
// Zip
|
||||||
if (! empty($arrayfields['d.zip']['checked']))
|
if (! empty($arrayfields['d.zip']['checked']))
|
||||||
@ -828,6 +839,36 @@ while ($i < min($num, $limit))
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show total line
|
||||||
|
if (isset($totalarray['pos']))
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
$i=0;
|
||||||
|
while ($i < $totalarray['nbfield'])
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($i == 1)
|
||||||
|
{
|
||||||
|
if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
|
||||||
|
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||||
|
}
|
||||||
|
else print '<td></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0)
|
||||||
|
{
|
||||||
|
$colspan=1;
|
||||||
|
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||||
|
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters=array('sql' => $sql);
|
$parameters=array('sql' => $sql);
|
||||||
|
|||||||
@ -116,7 +116,6 @@ if ($id)
|
|||||||
|
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -167,6 +167,7 @@ print '<br><br>';
|
|||||||
$data = $stats->getAllByYear();
|
$data = $stats->getAllByYear();
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre" height="24">';
|
print '<tr class="liste_titre" height="24">';
|
||||||
print '<td align="center">'.$langs->trans("Year").'</td>';
|
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||||
@ -207,6 +208,7 @@ foreach ($data as $val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
|
|||||||
@ -191,7 +191,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
|||||||
|
|
||||||
dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');
|
dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
@ -290,7 +290,7 @@ if ($rowid && $action != 'edit')
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'rowid', $linkback, 1);
|
dol_banner_tab($object, 'rowid', $linkback, 1);
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -28,19 +28,25 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$langs->load("members");
|
$langs->load(array("members","companies"));
|
||||||
|
|
||||||
$filter=$_GET["filter"];
|
$action=GETPOST('action','aZ09');
|
||||||
$statut=isset($_GET["statut"])?$_GET["statut"]:1;
|
$massaction=GETPOST('massaction','alpha');
|
||||||
|
$confirm=GETPOST('confirm','alpha');
|
||||||
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
|
||||||
|
$filter=GETPOST("filter","alpha");
|
||||||
|
$statut=(GETPOSTISSET("statut")?GETPOST("statut","alpha"):1);
|
||||||
$search_ref=GETPOST('search_ref','alpha');
|
$search_ref=GETPOST('search_ref','alpha');
|
||||||
$search_lastname=GETPOST('search_lastname','alpha');
|
$search_lastname=GETPOST('search_lastname','alpha');
|
||||||
|
$search_firstname=GETPOST('search_firstname','alpha');
|
||||||
$search_login=GETPOST('search_login','alpha');
|
$search_login=GETPOST('search_login','alpha');
|
||||||
$search_note=GETPOST('search_note','alpha');
|
$search_note=GETPOST('search_note','alpha');
|
||||||
$search_account=GETPOST('search_account','int');
|
$search_account=GETPOST('search_account','int');
|
||||||
$search_amount=GETPOST('search_amount','alpha');
|
$search_amount=GETPOST('search_amount','alpha');
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
|
$date_select=GETPOST("date_select",'alpha');
|
||||||
|
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -53,18 +59,34 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) { $sortorder="DESC"; }
|
if (! $sortorder) { $sortorder="DESC"; }
|
||||||
if (! $sortfield) { $sortfield="c.dateadh"; }
|
if (! $sortfield) { $sortfield="c.dateadh"; }
|
||||||
|
|
||||||
|
$object = new Subscription($db);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('subscriptionlist'));
|
$hookmanager->initHooks(array('subscriptionlist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('subscription');
|
$extralabels = $extrafields->fetch_name_optionals_label('subscription');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
$fieldstosearchall = array(
|
$fieldstosearchall = array(
|
||||||
);
|
);
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
|
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||||
|
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
||||||
|
'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
|
||||||
|
'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
|
||||||
|
't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
|
||||||
|
'd.bank'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1, 'enabled'=>(! empty($conf->banque->enabled))),
|
||||||
|
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
|
||||||
|
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
|
||||||
|
'd.datedebut'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100),
|
||||||
|
'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101),
|
||||||
|
'd.amount'=>array('label'=>$langs->trans("Amount"), 'checked'=>1, 'position'=>102),
|
||||||
|
'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||||
|
'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
|
// 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -72,7 +94,7 @@ $result=restrictedArea($user,'adherent','','','cotisation');
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
||||||
@ -109,15 +131,16 @@ if (empty($reshook))
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
$subscription=new Subscription($db);
|
||||||
|
$adherent=new Adherent($db);
|
||||||
|
$accountstatic=new Account($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
$now=dol_now();
|
||||||
|
|
||||||
|
|
||||||
// List of subscriptions
|
// List of subscriptions
|
||||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo,";
|
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo,";
|
||||||
$sql.= " c.rowid as crowid, c.subscription,";
|
$sql.= " c.rowid as crowid, c.subscription,";
|
||||||
$sql.= " c.dateadh,";
|
$sql.= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
|
||||||
$sql.= " c.datef,";
|
|
||||||
$sql.= " c.fk_bank as bank, c.note,";
|
$sql.= " c.fk_bank as bank, c.note,";
|
||||||
$sql.= " b.fk_account";
|
$sql.= " b.fk_account";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||||
@ -126,260 +149,452 @@ $sql.= " WHERE d.rowid = c.fk_adherent";
|
|||||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||||
if (isset($date_select) && $date_select != '')
|
if (isset($date_select) && $date_select != '')
|
||||||
{
|
{
|
||||||
$sql.= " AND c.dateadh LIKE '".$date_select."%'";
|
$sql.= " AND c.dateadh >= '".$date_select."-01-01 00:00:00'";
|
||||||
|
$sql.= " AND c.dateadh < '".($date_select+1)."-01-01 00:00:00'";
|
||||||
}
|
}
|
||||||
if ($search_ref)
|
if ($search_ref)
|
||||||
{
|
{
|
||||||
if (is_numeric($search_ref)) $sql.= " AND (c.rowid = ".$db->escape($search_ref).")";
|
if (is_numeric($search_ref)) $sql.= " AND (c.rowid = ".$db->escape($search_ref).")";
|
||||||
else $sql.=" AND 1 = 2"; // Always wrong
|
else $sql.=" AND 1 = 2"; // Always wrong
|
||||||
}
|
}
|
||||||
if ($search_lastname) $sql.= natural_search(array('d.firstname','d.lastname','d.societe'), $search_lastname);
|
if ($search_lastname) $sql.= natural_search(array('d.lastname','d.societe'), $search_lastname);
|
||||||
if ($search_login) $sql.= natural_search('c.subscription', $search_login);
|
if ($search_firstname) $sql.= natural_search(array('d.firstname'), $search_firstname);
|
||||||
|
if ($search_login) $sql.= natural_search('d.login', $search_login);
|
||||||
if ($search_note) $sql.= natural_search('c.note', $search_note);
|
if ($search_note) $sql.= natural_search('c.note', $search_note);
|
||||||
if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
if ($search_account > 0) $sql.= " AND b.fk_account = ".urldecode($search_account);
|
||||||
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
||||||
|
|
||||||
|
// Add where from extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
|
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
|
// Count total nb of records with no order and no limits
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
|
||||||
|
else dol_print_error($db);
|
||||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
{
|
{
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Add limit
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if (! $result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
dol_print_error($db);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$i = 0;
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$title=$langs->trans("ListOfSubscriptions");
|
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
|
||||||
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$id = $obj->rowid;
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/adherents/subscription/card.php?id='.$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$param='';
|
llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
|
||||||
if ($statut != '') $param.="&statut=".$statut;
|
|
||||||
if ($date_select) $param.="&date_select=".$date_select;
|
|
||||||
if ($search_lastname) $param.="&search_lastname=".$search_lastname;
|
|
||||||
if ($search_login) $param.="&search_login=".$search_login;
|
|
||||||
if ($search_acount) $param.="&search_account=".$search_account;
|
|
||||||
if ($search_amount) $param.="&search_amount=".$search_amount;
|
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
|
||||||
|
|
||||||
// List of mass actions available
|
$i = 0;
|
||||||
$arrayofmassactions = array(
|
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
|
||||||
);
|
|
||||||
if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
|
||||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
|
||||||
|
|
||||||
$newcardbutton='';
|
$title=$langs->trans("ListOfSubscriptions");
|
||||||
if ($user->rights->adherent->cotisation->creer)
|
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
|
||||||
{
|
|
||||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/list.php?status=-1,1"><span class="valignmiddle">'.$langs->trans('NewSubscription').'</span>';
|
|
||||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
|
||||||
$newcardbutton.= '</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
$param='';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
if ($statut != '') $param.="&statut=".urlencode($statut);
|
||||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
if ($date_select) $param.="&date_select=".urlencode($date_select);
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
if ($search_login) $param.="&search_login=".urlencode($search_login);
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
if ($search_acount) $param.="&search_account=".urlencode($search_account);
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
if ($search_amount) $param.="&search_amount=".urlencode($search_amount);
|
||||||
|
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||||
|
// Add $param from extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
|
// List of mass actions available
|
||||||
|
$arrayofmassactions = array(
|
||||||
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
);
|
||||||
|
//if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||||
|
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
$topicmail="Information";
|
$newcardbutton='';
|
||||||
$modelmail="subscription";
|
if ($user->rights->adherent->cotisation->creer)
|
||||||
$objecttmp=new Subscription($db);
|
{
|
||||||
$trackid='sub'.$object->id;
|
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/list.php?status=-1,1"><span class="valignmiddle">'.$langs->trans('NewSubscription').'</span>';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||||
|
$newcardbutton.= '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($sall)
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
{
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
}
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
$moreforfilter = '';
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$topicmail="Information";
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$modelmail="subscription";
|
||||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
$objecttmp=new Subscription($db);
|
||||||
|
$trackid='sub'.$object->id;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
if ($sall)
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
{
|
||||||
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
|
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
// Line for filters fields
|
$moreforfilter = '';
|
||||||
print '<tr class="liste_titre_filter">';
|
|
||||||
|
|
||||||
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Line for filters fields
|
||||||
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|
||||||
|
// Line numbering
|
||||||
|
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
if (! empty($arrayfields['d.ref']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'" size="4"></td>';
|
print '<input class="flat" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'" size="4"></td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>';
|
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="7"></td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre" align="left">';
|
||||||
|
print '<input class="flat" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'" size="12"></td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['d.login']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
|
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class="liste_titre" align="left">';
|
if (! empty($arrayfields['t.libelle']['checked']))
|
||||||
print '<input class="flat" type="text" name="search_note" value="'.dol_escape_htmltag($search_note).'" size="7"></td>';
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($arrayfields['d.bank']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_comptes($search_account, 'search_account', 0, '', 1);
|
print $form->select_comptes($search_account, 'search_account', 0, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['d.date_debut']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['d.date_fin']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['d.amount']['checked']))
|
||||||
|
{
|
||||||
print '<td align="right" class="liste_titre">';
|
print '<td align="right" class="liste_titre">';
|
||||||
print '<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).'" size="4">';
|
print '<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).'" size="4">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Action column
|
|
||||||
print '<td class="liste_titre" align="right">';
|
|
||||||
$searchpicto=$form->showFilterButtons();
|
|
||||||
print $searchpicto;
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder);
|
|
||||||
if (! empty($conf->banque->enabled))
|
|
||||||
{
|
|
||||||
print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder);
|
|
||||||
}
|
|
||||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder);
|
|
||||||
//print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
|
||||||
print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
|
|
||||||
// Static objects
|
|
||||||
$subscription=new Subscription($db);
|
|
||||||
$adherent=new Adherent($db);
|
|
||||||
$accountstatic=new Account($db);
|
|
||||||
|
|
||||||
$total=0;
|
|
||||||
while ($i < min($num, $limit))
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
$total+=$obj->subscription;
|
|
||||||
|
|
||||||
$subscription->ref=$obj->crowid;
|
|
||||||
$subscription->id=$obj->crowid;
|
|
||||||
|
|
||||||
$adherent->lastname=$obj->lastname;
|
|
||||||
$adherent->firstname=$obj->firstname;
|
|
||||||
$adherent->ref=$obj->rowid;
|
|
||||||
$adherent->id=$obj->rowid;
|
|
||||||
$adherent->statut=$obj->statut;
|
|
||||||
$adherent->login=$obj->login;
|
|
||||||
$adherent->photo=$obj->photo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<td>'.$subscription->getNomUrl(1).'</td>';
|
|
||||||
|
|
||||||
// Lastname
|
|
||||||
print '<td>'.$adherent->getNomUrl(-1).'</td>';
|
|
||||||
|
|
||||||
// Login
|
|
||||||
print '<td>'.$adherent->login.'</td>';
|
|
||||||
|
|
||||||
// Libelle
|
|
||||||
print '<td>';
|
|
||||||
print dol_trunc($obj->note,32);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Banque
|
|
||||||
if (! empty($conf->banque->enabled))
|
|
||||||
{
|
|
||||||
if ($obj->fk_account > 0)
|
|
||||||
{
|
|
||||||
$accountstatic->id=$obj->fk_account;
|
|
||||||
$accountstatic->fetch($obj->fk_account);
|
|
||||||
//$accountstatic->label=$obj->label;
|
|
||||||
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<td>";
|
|
||||||
print "</td>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Date start
|
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
|
||||||
|
|
||||||
// Date end
|
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datef),'day')."</td>\n";
|
|
||||||
|
|
||||||
// Price
|
|
||||||
print '<td align="right">'.price($obj->subscription).'</td>';
|
|
||||||
|
|
||||||
print '<td></td>';
|
|
||||||
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Total
|
|
||||||
|
|
||||||
print '<tr class="liste_total">';
|
|
||||||
print "<td>".$langs->trans("Total")."</td>\n";
|
|
||||||
print "<td align=\"right\"> </td>\n";
|
|
||||||
print "<td align=\"right\"> </td>\n";
|
|
||||||
print "<td align=\"right\"> </td>\n";
|
|
||||||
if (! empty($conf->banque->enabled))
|
|
||||||
{
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td align="right">'.price($total)."</td>\n";
|
|
||||||
print '<td></td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
print '</div>';
|
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
else
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
|
|
||||||
|
// Fields from hook
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
// Date creation
|
||||||
|
if (! empty($arrayfields['d.datec']['checked']))
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Date modification
|
||||||
|
if (! empty($arrayfields['d.tms']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
print '<td class="liste_titre" align="right">';
|
||||||
|
$searchpicto=$form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (! empty($arrayfields['d.ref']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("LastName",$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("FirstName",$_SERVER["PHP_SELF"],"d.firstname",$param,"","",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.login']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['t.libelle']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.bank']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.date_debut']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.date_fin']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['d.amount']['checked']))
|
||||||
|
{
|
||||||
|
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
|
|
||||||
|
// Hook fields
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
$total=0;
|
||||||
|
$totalarray=array();
|
||||||
|
while ($i < min($num, $limit))
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
|
$total+=$obj->subscription;
|
||||||
|
|
||||||
|
$subscription->ref=$obj->crowid;
|
||||||
|
$subscription->id=$obj->crowid;
|
||||||
|
|
||||||
|
$adherent->lastname=$obj->lastname;
|
||||||
|
$adherent->firstname=$obj->firstname;
|
||||||
|
$adherent->ref=$obj->rowid;
|
||||||
|
$adherent->id=$obj->rowid;
|
||||||
|
$adherent->statut=$obj->statut;
|
||||||
|
$adherent->login=$obj->login;
|
||||||
|
$adherent->photo=$obj->photo;
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
if (! empty($arrayfields['d.ref']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$subscription->getNomUrl(1).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lastname
|
||||||
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
|
{
|
||||||
|
$adherent->firstname = '';
|
||||||
|
print '<td>'.$adherent->getNomUrl(-1).'</td>';
|
||||||
|
$adherent->firstname = $obj->firstname;
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Firstname
|
||||||
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$adherent->firstname.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Login
|
||||||
|
if (! empty($arrayfields['d.login']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$adherent->login.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Label
|
||||||
|
if (! empty($arrayfields['t.libelle']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
print dol_trunc($obj->note,128);
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Banque
|
||||||
|
if (! empty($arrayfields['d.bank']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
if ($obj->fk_account > 0)
|
||||||
|
{
|
||||||
|
$accountstatic->id=$obj->fk_account;
|
||||||
|
$accountstatic->fetch($obj->fk_account);
|
||||||
|
//$accountstatic->label=$obj->label;
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Date start
|
||||||
|
if (! empty($arrayfields['d.date_start']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Date end
|
||||||
|
if (! empty($arrayfields['d.date_end']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">'.dol_print_date($db->jdate($obj->datef),'day')."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Price
|
||||||
|
if (! empty($arrayfields['d.amount']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="right">'.price($obj->subscription).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='d.amount';
|
||||||
|
$totalarray['val']['d.amount'] += $obj->subscription;
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
|
// Fields from hook
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
// Date creation
|
||||||
|
if (! empty($arrayfields['d.datec']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center" class="nowrap">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Date modification
|
||||||
|
if (! empty($arrayfields['d.tms']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center" class="nowrap">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Action column
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
{
|
||||||
|
$selected=0;
|
||||||
|
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
|
||||||
|
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show total line
|
||||||
|
if (isset($totalarray['pos']))
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
$i=0;
|
||||||
|
while ($i < $totalarray['nbfield'])
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($i == 1)
|
||||||
|
{
|
||||||
|
if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
|
||||||
|
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||||
|
}
|
||||||
|
else print '<td></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0)
|
||||||
|
{
|
||||||
|
$colspan=1;
|
||||||
|
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||||
|
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
|
||||||
|
$parameters=array('sql' => $sql);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
print '</div>';
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
@ -317,7 +317,7 @@ if ($action == 'create')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40"></td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||||
print $form->selectyesno("subscription",1,1);
|
print $form->selectyesno("subscription",1,1);
|
||||||
@ -694,7 +694,6 @@ if ($rowid > 0)
|
|||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2006-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user