Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into dev_MassSendEmailInvoiceToBillingContact
This commit is contained in:
commit
8b1c91912b
@ -1,7 +1,8 @@
|
|||||||
# EditorConfig is awesome: http://EditorConfig.org
|
# EditorConfig is awesome: https://editorconfig.org
|
||||||
|
|
||||||
# top-most EditorConfig file
|
# top-most EditorConfig file
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file
|
# Unix-style newlines with a newline ending every file
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
@ -11,9 +12,10 @@ insert_final_newline = true
|
|||||||
# PHP PSR-2 Coding Standards
|
# PHP PSR-2 Coding Standards
|
||||||
# http://www.php-fig.org/psr/psr-2/
|
# http://www.php-fig.org/psr/psr-2/
|
||||||
[*.php]
|
[*.php]
|
||||||
indent_style = space
|
indent_style = tab
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
[*.js]
|
[*.js]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
[*.css]
|
[*.css]
|
||||||
|
|||||||
@ -19,7 +19,7 @@ PHPDebugBar 1.15.0 MIT License Yes Used only by
|
|||||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||||
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||||
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||||
Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers
|
Mobiledetect 2.8.83 MIT License Yes Detect mobile devices browsers
|
||||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
|
odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
|
||||||
@ -35,7 +35,7 @@ Restler 3.0.0RC6 LGPL-3+ Yes
|
|||||||
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
||||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||||
Stripe 4.7.0 MIT licence Yes Library for Stripe module
|
Stripe 6.34.5 MIT licence Yes Library for Stripe module
|
||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
jQuery 3.3.1 MIT License Yes JS library
|
jQuery 3.3.1 MIT License Yes JS library
|
||||||
|
|||||||
266
ChangeLog
266
ChangeLog
@ -3,25 +3,163 @@ English Dolibarr ChangeLog
|
|||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
|
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
|
||||||
For Users:
|
For Users:
|
||||||
NEW: Module "Ticket" is available as a stable module.
|
NEW: Module "Ticket" is available as a stable module.
|
||||||
NEW: module "Email Collector" is available as a stable module.
|
NEW: Module "Email Collector" is available as a stable module.
|
||||||
NEW: module "TakePOS" is available as a stable module.
|
NEW: Module "TakePOS" is available as a stable module.
|
||||||
NEW: Experimental module "Vendor receptions".
|
NEW: Experimental module "Vendor receptions".
|
||||||
NEW: Experimental module "BOM".
|
NEW: Experimental module "BOM".
|
||||||
FIX: Disallow line start date if after end date.
|
NEW: Accounting - Add default accounting account for member subcriptions.
|
||||||
|
NEW: Accounting - More comprehensive menu.
|
||||||
|
NEW: Agenda/event - add description column available in list (hidden by default).
|
||||||
|
NEW: Add accounting account for result.
|
||||||
|
NEW: Add accounting code for EEC sales and export sales on products.
|
||||||
|
NEW: Add a security permission to edit php dynamic content on the WebSite module.
|
||||||
|
NEW: Attached document on bank account are now visible in automatic ECM.
|
||||||
|
NEW: Add Autofill Remainder Amount picto on the Expense Report Payment Page.
|
||||||
|
NEW: Add contact status in category export
|
||||||
|
NEW: Add Default Warehouse to user record (if module stock is on)
|
||||||
|
NEW: Add employee/user to subledger account list
|
||||||
|
NEW: Add gender in member card
|
||||||
|
NEW: Add getFormatedCustomerRef and getFormatedSupplierRef methods
|
||||||
|
NEW: Add history to view and print previous sales on TakePos.
|
||||||
|
NEW: Add import of accounting account for intra/export selling on product card
|
||||||
|
NEW: Adding code to show update date of supplier price shown
|
||||||
|
NEW: Add line total on list of payments
|
||||||
|
NEW: Add LinkedIn field in social network module
|
||||||
|
NEW: Add more complete error messages in log on stripe payments
|
||||||
|
NEW: Add no_email field in contact list
|
||||||
|
NEW: Add notes are show in tooltips
|
||||||
|
NEW: Add option DONATION_USE_THIRDPARTIES in admin of membership module
|
||||||
|
NEW: Add option STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO
|
||||||
|
NEW: add page to setup opening hours of the company
|
||||||
|
NEW: add payments table to pdf of expense report
|
||||||
|
NEW: add payment terms to invoices list
|
||||||
|
NEW: Add picto of deletion on mass action combo lists
|
||||||
|
NEW: add product extrafields available into shipping export
|
||||||
|
NEW: add ref supplier on supplier invoice
|
||||||
|
NEW: Add stats on entries & movements by fiscal year
|
||||||
|
NEW: Add subledger in various payment module
|
||||||
|
NEW: Add tag for ODT generation for localtax rates
|
||||||
|
NEW: Add the now link when creating expense report
|
||||||
|
NEW: Ask date of invoice when using the Clone feature.
|
||||||
|
NEW: auto event msg
|
||||||
|
NEW: Automatically binding for intra/export accountancy code in customer list
|
||||||
|
NEW: automatic / manual selector form
|
||||||
|
NEW: Better explanation for setup of WebDav module
|
||||||
|
NEW: Can add more lines on situation invoices at end of project when there is extra to add.
|
||||||
|
NEW: Can change the customer account of an instance
|
||||||
|
NEW: Can choose the root category to show products for TakePOS module
|
||||||
|
NEW: Can edit supplier on draft order supplier
|
||||||
|
NEW: Can enter price with or without tax when entering expense repor line
|
||||||
|
NEW: Can filter on the date of period for social contributions
|
||||||
|
NEW: Can generate invoices from the timespent entered on a project
|
||||||
|
NEW: Can update product supplier price ref
|
||||||
|
NEW: Can upload files from the edit page of expense report
|
||||||
|
NEW: Color for hover and for checked line is on by default
|
||||||
|
NEW: Column of parent company is available in list of third parties
|
||||||
|
NEW: conditionnal add member button by statut
|
||||||
|
NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN
|
||||||
|
NEW: Contact related items tab
|
||||||
|
NEW: Can create of supplier invoice from a reception
|
||||||
|
NEW: Ensure External RSS Links Open in New Window
|
||||||
|
NEW: Export available for reception module
|
||||||
|
NEW: Extend import option to Order's card and Propal's card
|
||||||
|
NEW: filter by thirdparty on report CA by prod/serv
|
||||||
|
NEW: Save space by moving the meteo on the title line
|
||||||
|
NEW: Get the list of groups of a user with the REST API.
|
||||||
|
NEW: Hidden option MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER to edit supplier on draft supplier order
|
||||||
|
NEW: Improve Displaying Shortcut Access Keys in Navigation.
|
||||||
|
NEW: Improve Expensereport, Inverse Receiver.
|
||||||
|
NEW: Improve pdf description item visibitity.
|
||||||
|
NEW: Introduce a config parameter $dolibarr_main_instance_unique_id
|
||||||
|
NEW: Introduce css "nobottomiftotal"
|
||||||
|
NEW: Introduce PhpSpreadsheet for export (need php5.6+)
|
||||||
|
NEW: Invoice creation from the timesheet
|
||||||
|
NEW: Can list remote stripe's payout in a dedicated page.
|
||||||
|
NEW: Manage account sell_intra & sell_export in page accoutancy admin default product
|
||||||
|
NEW: Manage loan schedule.
|
||||||
|
NEW: Manage status of member types.
|
||||||
|
NEW: Mass action "create bills" for validated reception
|
||||||
|
NEW: Measuring unit are now defined into an editable dictionary. Add product size/unit into product import.
|
||||||
|
NEW: Template pdf 'canelle_reception' displays linked reception lines.
|
||||||
|
NEW: Moral/physic status can be defined at member type level
|
||||||
|
NEW: Pagination into list of time spent.
|
||||||
|
NEW: Performance enhancement (Replace dirname(__FILE__) with __DIR__)
|
||||||
|
NEW: POS support in order (ex: online cart).
|
||||||
|
NEW: Preview of images into the filemanager component.
|
||||||
|
NEW: Resource module can be used in products/services (in a dedicated tab)
|
||||||
|
NEW: Retrieve invoice infos from order when billing shipment
|
||||||
|
NEW: Save and display type of membership in subscription table for more explicit historic
|
||||||
|
NEW: Setup default thirdparty type (customer or prospect/customer)
|
||||||
|
NEW: Add shipping "set draft" button and can update lines.
|
||||||
|
NEW: show in blod, the invoice amount where we came from, when making payment
|
||||||
|
NEW: Show product dimensions in product tooltips.
|
||||||
|
NEW: Show the latest date of subscription in member statistics reports.
|
||||||
|
NEW: Sort list of templates alphabetically
|
||||||
|
NEW: Stripe Payment Intent (need option to use this new Stripe api method)
|
||||||
|
NEW: Can support barcode on supplier price references.
|
||||||
|
NEW: Support tag {ccc} on payment ref
|
||||||
|
NEW: The preview of PDF files generates only 1 png file, even if several pages.
|
||||||
|
NEW: Can select a Thirdparty object in donation module if option ON.
|
||||||
|
NEW: Tooltip with VAT amount and price incl tax on lines of objects.
|
||||||
|
NEW: Unsubscribed emails are now stored in a dedicated table.
|
||||||
|
NEW: Update working chkbxlst filter for lists.
|
||||||
|
NEW: Use ajax switch into setup of donation.php and multi-currency module.
|
||||||
|
NEW: use recipient language when generating the fullname for emails.
|
||||||
|
NEW: When you create product or service, sell accountancy account by default is suggested.
|
||||||
|
NEW: Widget birthdays of the month.
|
||||||
|
NEW: Option in workflow module to set a reception billed on validate supplier bill.
|
||||||
|
NEW: Autocompletion on lists should be available on mobile applications.
|
||||||
|
|
||||||
For Developers:
|
For Developers:
|
||||||
NEW: Module "DebugBar" is available as a stable module.
|
NEW: Module "DebugBar" is available as a stable module.
|
||||||
|
NEW: Add API REST for donations
|
||||||
|
NEW: Add a script 'purge-data.php' to purge data older than a defined creation date
|
||||||
|
NEW: Add constant XFRAMEOPTIONS_ALLOWALL
|
||||||
|
NEW: Add function isValidVATID()
|
||||||
|
NEW: ADD document's product support in APIs
|
||||||
|
NEW: REST API: get the list of objects in a category.
|
||||||
|
NEW: Update Stripe library to 6.34.3
|
||||||
|
NEW: Upgrade jquery lib to 3.3.1
|
||||||
|
NEW: Add hook 'addHtmlHeader()'
|
||||||
|
NEW: Add hook 'createRecurringInvoices()'
|
||||||
|
NEW: Add hook 'afterSelectContactOptions'
|
||||||
|
NEW: Add hook support in accountancy index
|
||||||
|
NEW: Add hook support in list of template invoices
|
||||||
|
NEW: Add parameter 'replaceambiguouschars' on getRandomPassword function
|
||||||
|
NEW: Add property 'noteditable' in modulebuilder
|
||||||
|
NEW: Add the current modulepart into the Conf class object
|
||||||
|
NEW: Add trigger FICHINTER_UNVALIDATE
|
||||||
|
NEW: Add visibility with value 4 in framework to define fields to show
|
||||||
|
NEW: More option to tune initialization of a new module with modulebuilder.
|
||||||
|
NEW: API to list currencies
|
||||||
|
NEW: API Proposal, Orders, Invoices: Add contact details
|
||||||
|
NEW: hidden option to change concat desc order
|
||||||
|
NEW: Enhance management of webhooks
|
||||||
|
NEW: Generation of doc by modulebuilder can include README and CHANGELOG
|
||||||
|
NEW: massfilesarea feature for external modules
|
||||||
|
NEW: Show enabled modules in dol_print_error()
|
||||||
|
NEW: Simplification of CSS styles of default themes.
|
||||||
|
NEW: Clean code of a lot of deprecated code.
|
||||||
|
NEW: Add hidden option to set a search entry to the top
|
||||||
|
NEW: add hidden option DISPLAY_DISCOUNTED_SUPPLIER_PRICE
|
||||||
|
NEW: add hidden option MAIN_DEFAULT_LANGUAGE_FILTER
|
||||||
|
NEW: add hidden option NO_CONCAT_DESCRIPTION
|
||||||
|
NEW: Add hidden option for ACCOUNTANCY_COMBO_FOR_AUX
|
||||||
|
NEW: Add hidden option 'ADD_UNSPLASH_LOGIN_BACKGROUND'
|
||||||
|
NEW: Add Hidden option 'OVERRIDE_VAT_FOR_EXPENSE_REPORT'
|
||||||
|
NEW: add hidden option MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT
|
||||||
|
NEW: Hidden conf to improve pdf desc item visibitity
|
||||||
|
NEW: Look and feel v10 - Add CSS 'tabBarNoTop'
|
||||||
|
|
||||||
|
|
||||||
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:
|
||||||
* PHP 5.4 is no more supported. Minimum PHP is now 5.5+.
|
* PHP 5.4 is no more supported. Minimum PHP is now 5.5+.
|
||||||
* The PHP extension php-intl is not mandatory but should be installed to have new features working correctly.
|
* The PHP extension php-intl is not mandatory and must be installed to have new features working correctly.
|
||||||
* Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules.
|
* Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules.
|
||||||
* API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules.
|
* API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules.
|
||||||
* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.;
|
* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.;
|
||||||
@ -38,6 +176,40 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
|
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
|
||||||
|
FIX: #11013
|
||||||
|
FIX: #11041
|
||||||
|
FIX: actioncomm: sort events by date after external calendars and hook (into 7.0)
|
||||||
|
FIX: better test
|
||||||
|
FIX: Combo list was limited to 20 in stock correction
|
||||||
|
FIX: Confusion between expired and late
|
||||||
|
FIX: Cursor pointer in payment screen for autofill
|
||||||
|
FIX: CVE-2019-11199
|
||||||
|
FIX: CVE-2019-11200
|
||||||
|
FIX: CVE-2019-11201
|
||||||
|
FIX: Default value on form to send email
|
||||||
|
FIX: error messages not displayed
|
||||||
|
FIX: Massive debug in lettering function
|
||||||
|
FIX: missing compatibility with multicompany
|
||||||
|
FIX: missing global $user
|
||||||
|
FIX: missing situation invoice in list
|
||||||
|
FIX: MultiEntity in lettering functionality
|
||||||
|
FIX: Product accountancey sell intra code must be visible if main feature level 1
|
||||||
|
FIX: ref for table without ref manager are set to NULL.
|
||||||
|
FIX: Sending email to mass actions send same email on same customer
|
||||||
|
FIX: Several fixes on import of services/products
|
||||||
|
FIX: shipping default warehouse if only one warehouse
|
||||||
|
FIX: sortfield on lettering function
|
||||||
|
FIX: Status of opportunity should never be -1
|
||||||
|
FIX: test to display create invoice button on supplier_order card
|
||||||
|
FIX: The autocopy feature was ko for suppliers
|
||||||
|
FIX: Total per day in timespent per week
|
||||||
|
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
|
||||||
|
FIX: Update/delete currency on same languages
|
||||||
|
FIX: Wrong variable name make contact of supplier order not used on PDF.
|
||||||
|
FIX: Add hidden option MAIN_PDF_HIDE_SITUATION to hide situation (quick hack to fix output pb).
|
||||||
|
FIX: attached files list with link file was broked
|
||||||
|
|
||||||
***** ChangeLog for 9.0.2 compared to 9.0.1 *****
|
***** ChangeLog for 9.0.2 compared to 9.0.1 *****
|
||||||
FIX: #10822
|
FIX: #10822
|
||||||
FIX: Accountancy - Format EBP import
|
FIX: Accountancy - Format EBP import
|
||||||
@ -257,6 +429,90 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* Remove the no more used and deprecated dol_print_graph function
|
* Remove the no more used and deprecated dol_print_graph function
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
|
||||||
|
FIX: #10381
|
||||||
|
FIX: #10460 compatibility with MariaDB 10.4
|
||||||
|
FIX: #11025
|
||||||
|
FIX: Accountancy - Add transaction with multicompany use all the time 1st entity
|
||||||
|
FIX: Accountancy - Format EBP import
|
||||||
|
FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work
|
||||||
|
FIX: actioncomm: sort events by date after external calendars and hook
|
||||||
|
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
|
||||||
|
FIX: add fk_unit on addline action
|
||||||
|
FIX: avoid php warning
|
||||||
|
FIX: bad sql request
|
||||||
|
FIX: better method
|
||||||
|
FIX: better test
|
||||||
|
FIX: better test on fetch
|
||||||
|
FIX: broken external authentication module feature and avoid warning
|
||||||
|
FIX: Can not create contract with numbering module without autogen rule
|
||||||
|
FIX: can't add lines on invoices
|
||||||
|
FIX: Can't generate invoice pdf
|
||||||
|
FIX: Can't insert if there is extrafields mandatory on another entity.
|
||||||
|
FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar
|
||||||
|
FIX: Check for old picture name if the new one was not found
|
||||||
|
FIX: Civility not saved when creating a member.
|
||||||
|
FIX: $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
|
||||||
|
FIX: could not create several superadmin in transversal mode
|
||||||
|
FIX: credit note can have negative value
|
||||||
|
FIX: Default value on sales representative on third party creation
|
||||||
|
FIX: Don't show journal:getNomUrl without data
|
||||||
|
FIX: Erreur dans le Total
|
||||||
|
FIX: error messages not displayed
|
||||||
|
FIX: expedition: reset status on rollback + replace hardcoded status with const
|
||||||
|
FIX: Fix PHP warning "count(): Parameter must be an array..."
|
||||||
|
FIX: fk_default_warehouse missing in group by
|
||||||
|
FIX: function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it
|
||||||
|
FIX: holidays get natural_search if search params are set only
|
||||||
|
FIX: if empty error message, we just see "error" displayed
|
||||||
|
FIX: if(!method_exists(dol_loginfunction))
|
||||||
|
FIX: If we build one invoice for several orders, we must put the ref of order on the line to not lose information.
|
||||||
|
FIX: in fact expensereport must be in $check array
|
||||||
|
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
|
||||||
|
FIX: line edit template: keep fk_parent_line
|
||||||
|
FIX: Loan impossible to account
|
||||||
|
FIX: Mark credit note as available for credit note in other currency
|
||||||
|
FIX: missing access security checking with multicompany
|
||||||
|
FIX: missing entity filter and wrong var name
|
||||||
|
FIX: missing entity filter in function "build_filterField()" (export)
|
||||||
|
FIX: Missing field in import/export of users
|
||||||
|
FIX: missing hook completeTabsHead in margins module
|
||||||
|
FIX: missing $ismultientitymanaged for previous/next ref
|
||||||
|
FIX: Missing province in export of invoice
|
||||||
|
FIX: multicompany compatibility
|
||||||
|
FIX: must fetch member in current entity
|
||||||
|
FIX: need an order by in case we found other invoice with same number but not same date
|
||||||
|
FIX: need to round with 2 decimals to avoid movements not correctly balanced
|
||||||
|
FIX: no need to test anything to display documents tabs on expense report
|
||||||
|
FIX: positive values creating diff on addline rounding
|
||||||
|
FIX: problem with multicompany transverse mode
|
||||||
|
FIX: Product accountancey sell intra code must be visible if main feature level 1
|
||||||
|
FIX: project_title for display of getNomUrl()
|
||||||
|
FIX: quick search for supplier orders
|
||||||
|
FIX: Remane of project
|
||||||
|
FIX: same thing here
|
||||||
|
FIX: Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER
|
||||||
|
FIX: several hooks in shipping/delivery cards
|
||||||
|
FIX: shipping default warehouse if only one warehouse
|
||||||
|
FIX: SQL injection on rowid of dict.php
|
||||||
|
FIX: 'statut' is ignored when updating a user with the REST API.
|
||||||
|
FIX: supplier invoice payment total dont care about deposit or credit
|
||||||
|
FIX: supplier invoice product stats total ht is line total not invoice total
|
||||||
|
FIX: The minimum amount filter does not work in the VAT report per customer
|
||||||
|
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
|
||||||
|
FIX: Update/delete currency on same languages
|
||||||
|
FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9
|
||||||
|
FIX: useless join
|
||||||
|
FIX: we need to keep originline special_code
|
||||||
|
FIX: we want to be able to reopen fourn credit note
|
||||||
|
FIX: when 2 extra fields are mandatory in 2 different entities
|
||||||
|
FIX: when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
||||||
|
FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line)
|
||||||
|
FIX: wrong redirect link on holiday refuse
|
||||||
|
FIX: wrong test enabled
|
||||||
|
FIX: Wrong variable name
|
||||||
|
FIX: XSS
|
||||||
|
|
||||||
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
|
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
|
||||||
FIX: #10030 better german chart
|
FIX: #10030 better german chart
|
||||||
FIX: #10036
|
FIX: #10036
|
||||||
|
|||||||
@ -129,7 +129,7 @@ $BUILDROOT="$TEMP/buildroot";
|
|||||||
$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
|
$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
|
||||||
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
|
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
|
||||||
while (<IN>) {
|
while (<IN>) {
|
||||||
if ( $_ =~ /define\('DOL_VERSION','([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
|
if ( $_ =~ /define\('DOL_VERSION',\s*'([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
|
||||||
}
|
}
|
||||||
close IN;
|
close IN;
|
||||||
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
|
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
|
||||||
@ -357,7 +357,7 @@ if ($nboftargetok) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with command:'\n";
|
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'. But you can regenerate it with command:\n";
|
||||||
}
|
}
|
||||||
if (! $BUILD || $BUILD eq '0-rc') # For a major version
|
if (! $BUILD || $BUILD eq '0-rc') # For a major version
|
||||||
{
|
{
|
||||||
|
|||||||
14
build/phpstan/bootstrap.php
Normal file
14
build/phpstan/bootstrap.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
// Example to use PHPStan
|
||||||
|
// cd git/dolibarr
|
||||||
|
// /usr/bin/php7.2 ../phpstan.phar -l1 analyze htdocs/societe/website.php --memory-limit 2G
|
||||||
|
|
||||||
|
// Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things.
|
||||||
|
define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
|
||||||
|
define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
|
||||||
|
define('DOL_URL_ROOT', '/');
|
||||||
|
|
||||||
|
// Load the main.inc.php file to have finctions llx_Header and llx_Footer defined
|
||||||
|
if (! defined("NOLOGIN")) define("NOLOGIN", '1');
|
||||||
|
global $conf, $langs, $user, $db;
|
||||||
|
include_once __DIR__ . '/../../htdocs/main.inc.php';
|
||||||
@ -522,7 +522,6 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||||
{
|
{
|
||||||
$valuetoshow=$langs->trans("Label");
|
$valuetoshow=$langs->trans("Label");
|
||||||
if ($id != 25) $valuetoshow.="*";
|
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field]=='country') {
|
if ($fieldlist[$field]=='country') {
|
||||||
if (in_array('region_id', $fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
if (in_array('region_id', $fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||||
@ -583,10 +582,6 @@ if ($id)
|
|||||||
|
|
||||||
$colspan=count($fieldlist)+3;
|
$colspan=count($fieldlist)+3;
|
||||||
|
|
||||||
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
|
|
||||||
{
|
|
||||||
print '<tr><td colspan="'.$colspan.'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
|
|
||||||
}
|
|
||||||
print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,7 +662,6 @@ if ($id)
|
|||||||
}
|
}
|
||||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') {
|
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') {
|
||||||
$valuetoshow=$langs->trans("Label");
|
$valuetoshow=$langs->trans("Label");
|
||||||
if ($id != 25) $valuetoshow.="*";
|
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field]=='country') {
|
if ($fieldlist[$field]=='country') {
|
||||||
$valuetoshow=$langs->trans("Country");
|
$valuetoshow=$langs->trans("Country");
|
||||||
|
|||||||
@ -42,6 +42,7 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -186,21 +187,25 @@ if (! $resql) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$param='';
|
||||||
|
$param.="&socid=".urlencode($socid);
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG);
|
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
$param="&socid=".$socid;
|
||||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
|
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
|
||||||
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
||||||
|
|
||||||
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
||||||
//$letteringbutton = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=lettering" value="lettering" name="lettering" id="lettering"><span class="valignmiddle">' . $langs->trans("Lettering") . '</span></a>';
|
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="liste" width="100%">'."\n";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,6 +41,7 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -176,21 +176,25 @@ while ($obj = $db->fetch_object($resql)) {
|
|||||||
|
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
|
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$param='';
|
||||||
|
$param.="&socid=".urlencode($socid);
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
|
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
$param="&socid=".$socid;
|
||||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
|
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
|
||||||
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
||||||
|
|
||||||
@ -198,7 +202,8 @@ if ($resql) {
|
|||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="liste" width="100%">'."\n";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class AccountancyExport
|
|||||||
public static $EXPORT_TYPE_COGILOG = 8;
|
public static $EXPORT_TYPE_COGILOG = 8;
|
||||||
public static $EXPORT_TYPE_AGIRIS = 9;
|
public static $EXPORT_TYPE_AGIRIS = 9;
|
||||||
public static $EXPORT_TYPE_FEC = 11;
|
public static $EXPORT_TYPE_FEC = 11;
|
||||||
|
public static $EXPORT_TYPE_OPENCONCERTO = 12;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,6 +104,7 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
|
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
|
||||||
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
||||||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
||||||
|
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
||||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -126,6 +128,7 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_EBP => 'ebp',
|
self::$EXPORT_TYPE_EBP => 'ebp',
|
||||||
self::$EXPORT_TYPE_COGILOG => 'cogilog',
|
self::$EXPORT_TYPE_COGILOG => 'cogilog',
|
||||||
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
||||||
|
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
||||||
self::$EXPORT_TYPE_FEC => 'fec',
|
self::$EXPORT_TYPE_FEC => 'fec',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -187,6 +190,10 @@ class AccountancyExport
|
|||||||
'label' => $langs->trans('Modelcsv_FEC'),
|
'label' => $langs->trans('Modelcsv_FEC'),
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||||
),
|
),
|
||||||
|
self::$EXPORT_TYPE_OPENCONCERTO => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_openconcerto'),
|
||||||
|
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
'cr'=> array (
|
'cr'=> array (
|
||||||
'1' => $langs->trans("Unix"),
|
'1' => $langs->trans("Unix"),
|
||||||
@ -248,6 +255,9 @@ class AccountancyExport
|
|||||||
case self::$EXPORT_TYPE_AGIRIS :
|
case self::$EXPORT_TYPE_AGIRIS :
|
||||||
$this->exportAgiris($TData);
|
$this->exportAgiris($TData);
|
||||||
break;
|
break;
|
||||||
|
case self::$EXPORT_TYPE_OPENCONCERTO :
|
||||||
|
$this->exportOpenConcerto($TData);
|
||||||
|
break;
|
||||||
case self::$EXPORT_TYPE_FEC :
|
case self::$EXPORT_TYPE_FEC :
|
||||||
$this->exportFEC($TData);
|
$this->exportFEC($TData);
|
||||||
break;
|
break;
|
||||||
@ -588,6 +598,39 @@ class AccountancyExport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export format : OpenConcerto
|
||||||
|
*
|
||||||
|
* @param array $objectLines data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function exportOpenConcerto($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
|
$separator = ';';
|
||||||
|
$end_line = "\n";
|
||||||
|
|
||||||
|
foreach ($objectLines as $line) {
|
||||||
|
|
||||||
|
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||||
|
|
||||||
|
print $date . $separator;
|
||||||
|
print $line->code_journal;
|
||||||
|
if (empty($line->subledger_account)) {
|
||||||
|
print length_accountg($line->numero_compte) . $separator;
|
||||||
|
} else {
|
||||||
|
print length_accounta($line->subledger_account) . $separator;
|
||||||
|
}
|
||||||
|
print $line->doc_ref . $separator;
|
||||||
|
print $line->label_operation . $separator;
|
||||||
|
print price($line->debit) . $separator;
|
||||||
|
print price($line->credit) . $separator;
|
||||||
|
|
||||||
|
print $end_line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : Configurable
|
* Export format : Configurable
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1279,7 +1279,8 @@ class Adherent extends CommonObject
|
|||||||
$this->login = $obj->login;
|
$this->login = $obj->login;
|
||||||
$this->societe = $obj->company;
|
$this->societe = $obj->company;
|
||||||
$this->company = $obj->company;
|
$this->company = $obj->company;
|
||||||
$this->fk_soc = $obj->fk_soc;
|
$this->socid = $obj->fk_soc;
|
||||||
|
$this->fk_soc = $obj->fk_soc; // For backward comaptibility
|
||||||
$this->address = $obj->address;
|
$this->address = $obj->address;
|
||||||
$this->zip = $obj->zip;
|
$this->zip = $obj->zip;
|
||||||
$this->town = $obj->town;
|
$this->town = $obj->town;
|
||||||
|
|||||||
@ -271,7 +271,7 @@ if ($action == 'addthumb') // Regenerate thumbs
|
|||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||||
dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_WARNING);
|
dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -412,9 +412,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logo
|
// Logo
|
||||||
print '<tr class="oddeven hideonsmartphone"><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>';
|
print '<tr class="oddeven"><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>';
|
||||||
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||||
print '<input type="file" class="flat class=minwidth200" name="logo" id="logo">';
|
print '<input type="file" class="flat class=minwidth200" name="logo" id="logo" accept="image/*">';
|
||||||
print '</td><td class="nocellnopadd right" valign="middle">';
|
print '</td><td class="nocellnopadd right" valign="middle">';
|
||||||
if (! empty($mysoc->logo_mini)) {
|
if (! empty($mysoc->logo_mini)) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
||||||
@ -798,9 +798,9 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Barcode
|
// Barcode
|
||||||
|
|
||||||
if (! empty($conf->barcode->enabled))
|
if (! empty($conf->barcode->enabled))
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
|
print '<tr class="oddeven"><td>'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@ print "</form>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
print $langs->trans("WebDAVSetupDesc")."<br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("WebDAVSetupDesc")."</span><br>\n";
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -77,10 +77,17 @@ $form=new Form($db);
|
|||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup');
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
//print load_fiche_titre($langs->trans("DebugBar"));
|
//print load_fiche_titre($langs->trans("DebugBar"));
|
||||||
|
|
||||||
|
if (! function_exists('mb_check_encoding'))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print info_admin($langs->trans("ErrorPHPNeedModule", 'mbstring'), 0, 0, 'error');
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
// Level
|
// Level
|
||||||
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'].'">';
|
||||||
|
|||||||
@ -33,8 +33,8 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin) accessforbidden();
|
||||||
accessforbidden();
|
if (empty($conf->emailcollector->enabled)) accessforbidden();
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("admin", "mails", "other"));
|
$langs->loadLangs(array("admin", "mails", "other"));
|
||||||
|
|||||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
|||||||
dol_include_once('/emailcollector/class/emailcollector.class.php');
|
dol_include_once('/emailcollector/class/emailcollector.class.php');
|
||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
if (empty($conf->emailcollector->enabled)) accessforbidden();
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("admin", "other"));
|
$langs->loadLangs(array("admin", "other"));
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
/* Copyright (C) 2011-2019 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) 2018 Charlene Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -55,7 +55,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|||||||
|
|
||||||
if ($action == 'updateMask')
|
if ($action == 'updateMask')
|
||||||
{
|
{
|
||||||
$maskconst = GETPOST('maskconstholidaty', 'alpha');
|
$maskconst = GETPOST('maskconstholiday', 'alpha');
|
||||||
$maskvalue = GETPOST('maskholiday', 'alpha');
|
$maskvalue = GETPOST('maskholiday', 'alpha');
|
||||||
if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
|||||||
@ -709,8 +709,8 @@ if ($mode == 'common')
|
|||||||
{
|
{
|
||||||
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
||||||
else {
|
else {
|
||||||
print img_picto($langs->trans("Required"), 'switch_on');
|
print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
|
||||||
print $langs->trans("Required");
|
//print $langs->trans("Required");
|
||||||
}
|
}
|
||||||
if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/confexped.php
|
* \file htdocs/admin/reception_setup.php
|
||||||
* \ingroup produit
|
* \ingroup reception
|
||||||
* \brief Page to setup reception module
|
* \brief Page to setup reception module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -27,13 +27,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin", "receptions", 'other'));
|
||||||
$langs->load("receptions");
|
|
||||||
$langs->load('other');
|
|
||||||
|
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin) accessforbidden();
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$value=GETPOST('value', 'alpha');
|
$value=GETPOST('value', 'alpha');
|
||||||
|
|||||||
@ -34,9 +34,11 @@ if (! $user->admin) accessforbidden();
|
|||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (preg_match('/set(.*)/', $action, $reg))
|
if (preg_match('/set(.*)/', $action, $reg))
|
||||||
{
|
{
|
||||||
if (! dolibarr_set_const($db, $reg[1], '1', 'chaine', 0, '', $conf->entity) > 0)
|
if (! dolibarr_set_const($db, $reg[1], '1', 'chaine', 0, '', $conf->entity) > 0)
|
||||||
@ -47,7 +49,7 @@ if (preg_match('/set(.*)/', $action, $reg))
|
|||||||
|
|
||||||
if (preg_match('/del(.*)/', $action, $reg))
|
if (preg_match('/del(.*)/', $action, $reg))
|
||||||
{
|
{
|
||||||
if (! dolibarr_del_const($db, $reg[1], $conf->entity) > 0)
|
if (! dolibarr_set_const($db, $reg[1], '0', 'chaine', 0, '', $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -87,7 +89,7 @@ $workflowcodes=array(
|
|||||||
// Automatic classification supplier order
|
// Automatic classification supplier order
|
||||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'! empty($conf->fournisseur->enabled)', 'picto'=>'order','warning'=>''),
|
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'! empty($conf->fournisseur->enabled)', 'picto'=>'order','warning'=>''),
|
||||||
//Automatic classification reception
|
//Automatic classification reception
|
||||||
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>30, 'enabled'=>'! empty($conf->reception->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'bill'),
|
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'bill'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))
|
if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))
|
||||||
|
|||||||
@ -55,17 +55,6 @@ $langs->loadLangs(array("main","bills","cashdesk"));
|
|||||||
onfocus="javascript: this.select();" />
|
onfocus="javascript: this.select();" />
|
||||||
</td>
|
</td>
|
||||||
<td class="select_design maxwidthonsmartphone">
|
<td class="select_design maxwidthonsmartphone">
|
||||||
<?php /*
|
|
||||||
$selected='';
|
|
||||||
$htmlname='idprod';
|
|
||||||
$status=-1;
|
|
||||||
$rice_level=$company->price_level;
|
|
||||||
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
|
|
||||||
if (! $hidelabel) print $langs->trans("RefOrLabel").' : ';
|
|
||||||
print '<input type="text" size="4" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'" />';
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
|
|
||||||
<select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');">
|
<select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');">
|
||||||
<?php
|
<?php
|
||||||
print '<option value="0">'.$top_liste_produits.'</option>'."\n";
|
print '<option value="0">'.$top_liste_produits.'</option>'."\n";
|
||||||
|
|||||||
@ -62,6 +62,7 @@ $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref', 'alpha'):GETPOST('search_ref', '
|
|||||||
$search_refcustomer=GETPOST('search_refcustomer', 'alpha');
|
$search_refcustomer=GETPOST('search_refcustomer', 'alpha');
|
||||||
|
|
||||||
$search_refproject=GETPOST('search_refproject', 'alpha');
|
$search_refproject=GETPOST('search_refproject', 'alpha');
|
||||||
|
$search_project=GETPOST('search_project', 'alpha');
|
||||||
|
|
||||||
$search_societe=GETPOST('search_societe', 'alpha');
|
$search_societe=GETPOST('search_societe', 'alpha');
|
||||||
$search_montant_ht=GETPOST('search_montant_ht', 'alpha');
|
$search_montant_ht=GETPOST('search_montant_ht', 'alpha');
|
||||||
@ -144,27 +145,28 @@ if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate";
|
|||||||
|
|
||||||
$checkedtypetiers=0;
|
$checkedtypetiers=0;
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'p.ref'=>array('label'=>"Ref", 'checked'=>1),
|
||||||
'p.ref_client'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
|
'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1),
|
||||||
'pr.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
|
's.town'=>array('label'=>"Town", 'checked'=>1),
|
||||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||||
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
|
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||||
'p.date'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||||
'p.fin_validite'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
|
'p.date'=>array('label'=>"Date", 'checked'=>1),
|
||||||
'p.date_livraison'=>array('label'=>$langs->trans("DeliveryDate"), 'checked'=>0),
|
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
|
||||||
'ava.rowid'=>array('label'=>$langs->trans("AvailabilityPeriod"), 'checked'=>0),
|
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
|
||||||
'p.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
|
||||||
'p.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
|
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||||
'p.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
|
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
||||||
'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10),
|
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
||||||
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
|
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
|
||||||
'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
|
||||||
'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||||
|
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
@ -197,6 +199,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_ref='';
|
$search_ref='';
|
||||||
$search_refcustomer='';
|
$search_refcustomer='';
|
||||||
$search_refproject='';
|
$search_refproject='';
|
||||||
|
$search_project='';
|
||||||
$search_societe='';
|
$search_societe='';
|
||||||
$search_montant_ht='';
|
$search_montant_ht='';
|
||||||
$search_montant_vat='';
|
$search_montant_vat='';
|
||||||
@ -265,13 +268,12 @@ $sql.= " ava.rowid as availability,";
|
|||||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
|
$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
|
||||||
$sql.= ' p.datec as date_creation, p.tms as date_update,';
|
$sql.= ' p.datec as date_creation, p.tms as date_update,';
|
||||||
$sql.= " pr.rowid as project_id, pr.ref as project_ref,";
|
$sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
|
||||||
$sql.= ' u.login';
|
$sql.= ' u.login';
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user,";
|
||||||
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||||
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -310,6 +312,7 @@ if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search
|
|||||||
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
|
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
|
||||||
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
|
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
|
||||||
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject);
|
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject);
|
||||||
|
if ($search_project) $sql .= natural_search('pr.title', $search_project);
|
||||||
if ($search_availability) $sql .= " AND p.fk_availability IN (".$db->escape($search_availability).')';
|
if ($search_availability) $sql .= " AND p.fk_availability IN (".$db->escape($search_availability).')';
|
||||||
|
|
||||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||||
@ -426,9 +429,9 @@ if ($resql)
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($user->rights->propal->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->propal->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
if ($user->rights->propal->cloturer) $arrayofmassactions['closed']=$langs->trans("Close");
|
if ($user->rights->propal->cloturer) $arrayofmassactions['closed']=$langs->trans("Close");
|
||||||
@ -545,6 +548,12 @@ if ($resql)
|
|||||||
print '<input class="flat" size="6" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).'">';
|
print '<input class="flat" size="6" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
if (! empty($arrayfields['pr.title']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '<input class="flat" size="6" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
@ -688,6 +697,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'], $_SERVER["PHP_SELF"], 'p.ref_client', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'], $_SERVER["PHP_SELF"], 'p.ref_client', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['pr.ref']['checked'])) print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['pr.ref']['checked'])) print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder);
|
||||||
|
if (! empty($arrayfields['pr.title']['checked'])) print_liste_field_titre($arrayfields['pr.title']['label'], $_SERVER["PHP_SELF"], 'pr.title', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||||
@ -725,6 +735,16 @@ if ($resql)
|
|||||||
$objectstatic->id=$obj->rowid;
|
$objectstatic->id=$obj->rowid;
|
||||||
$objectstatic->ref=$obj->ref;
|
$objectstatic->ref=$obj->ref;
|
||||||
|
|
||||||
|
$companystatic->id=$obj->socid;
|
||||||
|
$companystatic->name=$obj->name;
|
||||||
|
$companystatic->client=$obj->client;
|
||||||
|
$companystatic->code_client=$obj->code_client;
|
||||||
|
$companystatic->email=$obj->email;
|
||||||
|
|
||||||
|
$projectstatic->id=$obj->project_id;
|
||||||
|
$projectstatic->ref=$obj->project_ref;
|
||||||
|
$projectstatic->title=$obj->project_label;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
if (! empty($arrayfields['p.ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
@ -767,7 +787,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['p.ref_client']['checked']))
|
if (! empty($arrayfields['p.ref_client']['checked']))
|
||||||
{
|
{
|
||||||
// Customer ref
|
// Customer ref
|
||||||
print '<td class="nocellnopadd nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $obj->ref_client;
|
print $obj->ref_client;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
@ -776,20 +796,24 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['pr.ref']['checked']))
|
if (! empty($arrayfields['pr.ref']['checked']))
|
||||||
{
|
{
|
||||||
// Project ref
|
// Project ref
|
||||||
print '<td class="nocellnopadd nowrap">';
|
print '<td class="nowrap">';
|
||||||
if ($obj->project_id) {
|
if ($obj->project_id > 0) {
|
||||||
$projectstatic->fetch($obj->project_id);
|
|
||||||
print $projectstatic->getNomUrl(1);
|
print $projectstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$companystatic->id=$obj->socid;
|
if (! empty($arrayfields['pr.title']['checked']))
|
||||||
$companystatic->name=$obj->name;
|
{
|
||||||
$companystatic->client=$obj->client;
|
// Project label
|
||||||
$companystatic->code_client=$obj->code_client;
|
print '<td class="nowrap">';
|
||||||
$companystatic->email=$obj->email;
|
if ($obj->project_id > 0) {
|
||||||
|
print $projectstatic->title;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
|
|||||||
0
htdocs/commande/card.php
Executable file → Normal file
0
htdocs/commande/card.php
Executable file → Normal file
@ -499,7 +499,7 @@ class Commande extends CommonOrder
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,7 @@ $viewstatut=GETPOST('viewstatut');
|
|||||||
$search_btn=GETPOST('button_search', 'alpha');
|
$search_btn=GETPOST('button_search', 'alpha');
|
||||||
$search_remove_btn=GETPOST('button_removefilter', 'alpha');
|
$search_remove_btn=GETPOST('button_removefilter', 'alpha');
|
||||||
$search_project_ref=GETPOST('search_project_ref', 'alpha');
|
$search_project_ref=GETPOST('search_project_ref', 'alpha');
|
||||||
|
$search_project=GETPOST('search_project', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$id = (GETPOST('orderid')?GETPOST('orderid', 'int'):GETPOST('id', 'int'));
|
$id = (GETPOST('orderid')?GETPOST('orderid', 'int'):GETPOST('id', 'int'));
|
||||||
@ -125,24 +126,25 @@ if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate";
|
|||||||
|
|
||||||
$checkedtypetiers=0;
|
$checkedtypetiers=0;
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'c.ref'=>array('label'=>"Ref", 'checked'=>1),
|
||||||
'c.ref_client'=>array('label'=>$langs->trans("RefCustomerOrder"), 'checked'=>1),
|
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>1),
|
||||||
'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0, 'enabled'=>1),
|
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
|
's.town'=>array('label'=>"Town", 'checked'=>1),
|
||||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||||
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
|
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||||
'c.date_commande'=>array('label'=>$langs->trans("OrderDateShort"), 'checked'=>1),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||||
'c.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)),
|
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1),
|
||||||
'c.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)),
|
||||||
'c.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
|
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||||
'c.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
|
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
||||||
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
||||||
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'c.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||||
'c.facture'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
|
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
|
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
@ -197,6 +199,7 @@ if (empty($reshook))
|
|||||||
$search_deliverymonth='';
|
$search_deliverymonth='';
|
||||||
$search_deliveryyear='';
|
$search_deliveryyear='';
|
||||||
$search_project_ref='';
|
$search_project_ref='';
|
||||||
|
$search_project='';
|
||||||
$viewstatut='';
|
$viewstatut='';
|
||||||
$billed='';
|
$billed='';
|
||||||
$toselect='';
|
$toselect='';
|
||||||
@ -245,11 +248,10 @@ $sql.= " state.code_departement as state_code, state.nom as state_name,";
|
|||||||
$sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
|
$sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
|
||||||
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
||||||
$sql.= ' c.date_creation as date_creation, c.tms as date_update,';
|
$sql.= ' c.date_creation as date_creation, c.tms as date_update,';
|
||||||
$sql.= " p.rowid as project_id, p.ref as project_ref";
|
$sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
|
||||||
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||||
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -316,6 +318,7 @@ if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.elemen
|
|||||||
if ($search_total_ht != '') $sql.= natural_search('c.total_ht', $search_total_ht, 1);
|
if ($search_total_ht != '') $sql.= natural_search('c.total_ht', $search_total_ht, 1);
|
||||||
if ($search_total_ttc != '') $sql.= natural_search('c.total_ttc', $search_total_ttc, 1);
|
if ($search_total_ttc != '') $sql.= natural_search('c.total_ttc', $search_total_ttc, 1);
|
||||||
if ($search_project_ref != '') $sql.= natural_search("p.ref", $search_project_ref);
|
if ($search_project_ref != '') $sql.= natural_search("p.ref", $search_project_ref);
|
||||||
|
if ($search_project != '') $sql.= natural_search("p.title", $search_project);
|
||||||
if ($search_categ_cus > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
if ($search_categ_cus > 0) $sql.= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
||||||
if ($search_categ_cus == -2) $sql.= " AND cc.fk_categorie IS NULL";
|
if ($search_categ_cus == -2) $sql.= " AND cc.fk_categorie IS NULL";
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
@ -427,11 +430,10 @@ if ($resql)
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
'cancelorders'=>$langs->trans("Cancel"),
|
'cancelorders'=>$langs->trans("Cancel"),
|
||||||
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if($user->rights->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
if($user->rights->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
if ($user->rights->commande->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->commande->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
@ -596,10 +598,15 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Project ref
|
// Project ref
|
||||||
if (! empty($arrayfields['p.project_ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_project_ref" value="'.$search_project_ref.'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_project_ref" value="'.$search_project_ref.'"></td>';
|
||||||
}
|
}
|
||||||
|
// Project title
|
||||||
|
if (! empty($arrayfields['p.title']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_project" value="'.$search_project.'"></td>';
|
||||||
|
}
|
||||||
// Thirpdarty
|
// Thirpdarty
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
@ -722,7 +729,8 @@ if ($resql)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'], $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'], $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['p.project_ref']['checked'])) print_liste_field_titre($arrayfields['p.project_ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (! empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER["PHP_SELF"], "p.title", "", $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||||
@ -782,6 +790,10 @@ if ($resql)
|
|||||||
$generic_commande->total_tva = $obj->total_tva;
|
$generic_commande->total_tva = $obj->total_tva;
|
||||||
$generic_commande->total_ttc = $obj->total_ttc;
|
$generic_commande->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
$projectstatic->id=$obj->project_id;
|
||||||
|
$projectstatic->ref=$obj->project_ref;
|
||||||
|
$projectstatic->title=$obj->project_label;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -933,13 +945,26 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project
|
// Project ref
|
||||||
if (! empty($arrayfields['p.project_ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
{
|
{
|
||||||
$projectstatic->id=$obj->project_id;
|
print '<td class="nowrap">';
|
||||||
$projectstatic->ref=$obj->project_ref;
|
if ($obj->project_id > 0)
|
||||||
print '<td>';
|
{
|
||||||
if ($obj->project_id > 0) print $projectstatic->getNomUrl(1);
|
print $projectstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Project label
|
||||||
|
if (! empty($arrayfields['p.title']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="nowrap">';
|
||||||
|
if ($obj->project_id > 0)
|
||||||
|
{
|
||||||
|
print $projectstatic->title;
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||||
@ -50,14 +50,14 @@ $id = (GETPOST('id')?GETPOST('id', 'int'):GETPOST("facid", "int")); // For b
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$sref = GETPOST('sref');
|
$sref = GETPOST('sref', 'alpha');
|
||||||
$sref_client = GETPOST('sref_client');
|
$sref_client = GETPOST('sref_client', 'alpha');
|
||||||
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
$selected = GETPOST('orders_to_invoice');
|
$selected = GETPOST('orders_to_invoice');
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$viewstatut = GETPOST('viewstatut');
|
$viewstatut = GETPOST('viewstatut', 'alpha');
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -578,9 +578,9 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
{
|
{
|
||||||
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
|
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
|
||||||
}
|
}
|
||||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
$resql = $db->query($sql);
|
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($socid)
|
if ($socid)
|
||||||
@ -604,6 +604,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
print '<h3>'.$companystatic->getNomUrl(1, 'customer').'</h3>';
|
print '<h3>'.$companystatic->getNomUrl(1, 'customer').'</h3>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.ref', '', '&socid='.$socid, '', $sortfield, $sortorder);
|
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.ref', '', '&socid='.$socid, '', $sortfield, $sortorder);
|
||||||
@ -618,8 +619,9 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
print '<form method="get" action="orderstoinvoice.php">';
|
print '<form method="get" action="orderstoinvoice.php">';
|
||||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre">';
|
|
||||||
//REF
|
//REF
|
||||||
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="10" type="text" name="sref" value="'.$sref.'">';
|
print '<input class="flat" size="10" type="text" name="sref" value="'.$sref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -668,11 +670,11 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
$generic_commande->date_livraison = $db->jdate($objp->date_livraison);
|
$generic_commande->date_livraison = $db->jdate($objp->date_livraison);
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowraponall">';
|
||||||
print $generic_commande->getNomUrl(1, 0);
|
print $generic_commande->getNomUrl(1, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="20" class="nobordernopadding nowrap">';
|
print '<td width="20" class="nobordernopadding nowraponall">';
|
||||||
if ($generic_commande->hasDelay()) {
|
if ($generic_commande->hasDelay()) {
|
||||||
print img_picto($langs->trans("Late"), "warning");
|
print img_picto($langs->trans("Late"), "warning");
|
||||||
}
|
}
|
||||||
@ -713,10 +715,9 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
/*
|
// Buttons actions
|
||||||
* Boutons actions
|
|
||||||
*/
|
|
||||||
print '<br><div class="center"><input type="checkbox" '.(empty($conf->global->INVOICE_CLOSE_ORDERS_OFF_BY_DEFAULT_FORMASSINVOICE)?' checked="checked"':'').' name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
|
print '<br><div class="center"><input type="checkbox" '.(empty($conf->global->INVOICE_CLOSE_ORDERS_OFF_BY_DEFAULT_FORMASSINVOICE)?' checked="checked"':'').' name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
|
||||||
print '<div class="right">';
|
print '<div class="right">';
|
||||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
@ -726,7 +727,9 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
print '<input type="submit" class="butAction" value="'.$langs->trans("GenerateBill").'">';
|
print '<input type="submit" class="butAction" value="'.$langs->trans("GenerateBill").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -234,6 +234,8 @@ if ($action=="create" || $action=="start")
|
|||||||
{
|
{
|
||||||
$posmodule = GETPOST('posmodule', 'alpha');
|
$posmodule = GETPOST('posmodule', 'alpha');
|
||||||
$terminalid = GETPOST('posnumber', 'alpha');
|
$terminalid = GETPOST('posnumber', 'alpha');
|
||||||
|
$terminaltouse = $terminalid;
|
||||||
|
if ($terminaltouse == '1') $terminaltouse = '';
|
||||||
|
|
||||||
// Calculate $initialbalanceforterminal for terminal 0
|
// Calculate $initialbalanceforterminal for terminal 0
|
||||||
foreach($arrayofpaymentmode as $key => $val)
|
foreach($arrayofpaymentmode as $key => $val)
|
||||||
@ -245,10 +247,13 @@ if ($action=="create" || $action=="start")
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the bank account dedicated to this point of sale module/terminal
|
// Get the bank account dedicated to this point of sale module/terminal
|
||||||
$bankid = $conf->global->CASHDESK_ID_BANKACCOUNT_CASH; // This value is ok for 'Terminal 0' for module 'CashDesk' and 'TakePos' (they manage only 1 terminal)
|
$vartouse=CASHDESK_ID_BANKACCOUNT_CASH.$terminaltouse;
|
||||||
|
$bankid = $conf->global->$vartouse; // This value is ok for 'Terminal 0' for module 'CashDesk' and 'TakePos' (they manage only 1 terminal)
|
||||||
// Hook to get the good bank id according to posmodule and posnumber.
|
// Hook to get the good bank id according to posmodule and posnumber.
|
||||||
// @TODO add hook here
|
// @TODO add hook here
|
||||||
|
|
||||||
|
if ($bankid > 0)
|
||||||
|
{
|
||||||
$sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank";
|
$sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank";
|
||||||
$sql.= " WHERE fk_account = ".$bankid;
|
$sql.= " WHERE fk_account = ".$bankid;
|
||||||
if ($syear && ! $smonth) $sql.= " AND dateo < '".$db->idate(dol_get_first_day($syear, 1))."'";
|
if ($syear && ! $smonth) $sql.= " AND dateo < '".$db->idate(dol_get_first_day($syear, 1))."'";
|
||||||
@ -264,6 +269,12 @@ if ($action=="create" || $action=="start")
|
|||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupOfTerminalNotComplete", $terminalid), null, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate $theoricalamountforterminal for terminal 0
|
// Calculate $theoricalamountforterminal for terminal 0
|
||||||
foreach($arrayofpaymentmode as $key => $val)
|
foreach($arrayofpaymentmode as $key => $val)
|
||||||
@ -332,7 +343,16 @@ if ($action=="create" || $action=="start")
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$form->selectarray('posmodule', $arrayofposavailable, GETPOST('posmodule', 'alpha'), (count($arrayofposavailable)>1?1:0)).'</td>';
|
print '<td>'.$form->selectarray('posmodule', $arrayofposavailable, GETPOST('posmodule', 'alpha'), (count($arrayofposavailable)>1?1:0)).'</td>';
|
||||||
print '<td><input name="posnumber" type="text" class="maxwidth50" value="'.(GETPOSTISSET('posnumber')?GETPOST('posnumber', 'alpha'):'0').'"></td>';
|
print '<td>';
|
||||||
|
$array=array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9");
|
||||||
|
$selectedposnumber=0; $showempty=1;
|
||||||
|
if ($conf->global->TAKEPOS_NUM_TERMINALS == '1')
|
||||||
|
{
|
||||||
|
$selectedposnumber=1; $showempty=0;
|
||||||
|
}
|
||||||
|
print $form->selectarray('posnumber', $array, GETPOSTISSET('posnumber')?GETPOST('posnumber', 'int'):$selectedposnumber, $showempty);
|
||||||
|
//print '<input name="posnumber" type="text" class="maxwidth50" value="'.(GETPOSTISSET('posnumber')?GETPOST('posnumber', 'alpha'):'0').'">';
|
||||||
|
print '</td>';
|
||||||
// Year
|
// Year
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$retstring='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
|
$retstring='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
|
||||||
@ -380,6 +400,7 @@ if ($action=="create" || $action=="start")
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
// Table to see/enter balance
|
||||||
if ($action == 'start' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '-1')
|
if ($action == 'start' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '-1')
|
||||||
{
|
{
|
||||||
$posmodule = GETPOST('posmodule', 'alpha');
|
$posmodule = GETPOST('posmodule', 'alpha');
|
||||||
@ -561,7 +582,7 @@ if (empty($action) || $action=="view")
|
|||||||
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">' . $langs->trans('PrintTicket') . '</a></div>';
|
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">' . $langs->trans('PrintTicket') . '</a></div>';
|
||||||
if ($object->status == CashControl::STATUS_DRAFT)
|
if ($object->status == CashControl::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=close">' . $langs->trans('Close') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=close">' . $langs->trans('ValidateAndClose') . '</a></div>';
|
||||||
|
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=confirm_delete">' . $langs->trans('Delete') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=confirm_delete">' . $langs->trans('Delete') . '</a></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -212,7 +212,7 @@ else $sql.=" WHERE 1 = 1";
|
|||||||
foreach($search as $key => $val)
|
foreach($search as $key => $val)
|
||||||
{
|
{
|
||||||
if ($key == 'status' && $search[$key] == -1) continue;
|
if ($key == 'status' && $search[$key] == -1) continue;
|
||||||
$mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0);
|
$mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||||
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
|
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
|
||||||
}
|
}
|
||||||
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
|
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
@ -390,6 +390,7 @@ foreach($object->fields as $key => $val)
|
|||||||
$cssforfield='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
|
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right';
|
||||||
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
||||||
}
|
}
|
||||||
@ -416,6 +417,7 @@ foreach($object->fields as $key => $val)
|
|||||||
$cssforfield='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
|
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right';
|
||||||
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
@ -465,8 +467,13 @@ while ($i < min($num, $limit))
|
|||||||
{
|
{
|
||||||
$cssforfield='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
|
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
|
|
||||||
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
|
|
||||||
|
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right';
|
||||||
|
|
||||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td';
|
print '<td';
|
||||||
|
|||||||
@ -55,20 +55,20 @@ class CashControl extends CommonObject
|
|||||||
public $picto = 'account';
|
public $picto = 'account';
|
||||||
|
|
||||||
public $fields=array(
|
public $fields=array(
|
||||||
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>10),
|
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>10),
|
||||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>15),
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>15),
|
||||||
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>18),
|
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>18),
|
||||||
'posmodule' =>array('type'=>'varchar(30)', 'label'=>'Module', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>19),
|
'posmodule' =>array('type'=>'varchar(30)', 'label'=>'Module', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>19),
|
||||||
'posnumber' =>array('type'=>'varchar(30)', 'label'=>'CashDesk', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>20),
|
'posnumber' =>array('type'=>'varchar(30)', 'label'=>'CashDesk', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>20),
|
||||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>0, 'position'=>24),
|
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>0, 'position'=>24),
|
||||||
'opening' =>array('type'=>'double(24,8)', 'label'=>'Opening', 'enabled'=>1, 'visible'=>1, 'position'=>25),
|
'opening' =>array('type'=>'price', 'label'=>'Opening', 'enabled'=>1, 'visible'=>1, 'position'=>25),
|
||||||
'cash' =>array('type'=>'double(24,8)', 'label'=>'Cash', 'enabled'=>1, 'visible'=>1, 'position'=>30),
|
'cash' =>array('type'=>'price', 'label'=>'Cash', 'enabled'=>1, 'visible'=>1, 'position'=>30),
|
||||||
'cheque' =>array('type'=>'double(24,8)', 'label'=>'Cheque', 'enabled'=>1, 'visible'=>1, 'position'=>33),
|
'cheque' =>array('type'=>'price', 'label'=>'Cheque', 'enabled'=>1, 'visible'=>1, 'position'=>33),
|
||||||
'card' =>array('type'=>'double(24,8)', 'label'=>'CreditCard', 'enabled'=>1, 'visible'=>1, 'position'=>36),
|
'card' =>array('type'=>'price', 'label'=>'CreditCard', 'enabled'=>1, 'visible'=>1, 'position'=>36),
|
||||||
'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnul'=>1, 'position'=>50),
|
'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>50, 'css'=>'center'),
|
||||||
'month_close' =>array('type'=>'integer', 'label'=>'Month close', 'enabled'=>1, 'visible'=>1, 'position'=>55),
|
'month_close' =>array('type'=>'integer', 'label'=>'Month close', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'css'=>'center'),
|
||||||
'day_close' =>array('type'=>'integer', 'label'=>'Day close', 'enabled'=>1, 'visible'=>1, 'position'=>60),
|
'day_close' =>array('type'=>'integer', 'label'=>'Day close', 'enabled'=>1, 'visible'=>1, 'position'=>60, 'css'=>'center'),
|
||||||
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValid', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>490),
|
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>490),
|
||||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||||
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505),
|
'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505),
|
||||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>510),
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>510),
|
||||||
@ -358,63 +358,65 @@ class CashControl extends CommonObject
|
|||||||
* Return clicable link of object (with eventually picto)
|
* Return clicable link of object (with eventually picto)
|
||||||
*
|
*
|
||||||
* @param int $withpicto Add picto into link
|
* @param int $withpicto Add picto into link
|
||||||
* @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '')
|
* @param string $option On what the link point to ('nolink', ...)
|
||||||
* @param int $maxlength Maxlength of ref
|
* @param int $notooltip 1=Disable tooltip
|
||||||
|
* @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
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @param int $notooltip No tooltip
|
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0)
|
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
|
||||||
|
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
$newref=($this->ref?$this->ref:$this->id);
|
$newref=($this->ref?$this->ref:$this->id);
|
||||||
if ($maxlength) { $newref=dol_trunc($newref, $maxlength, 'middle'); }
|
|
||||||
|
|
||||||
$label = '<u>' . $langs->trans("ShowCashFence") . '</u>';
|
$label = '<u>' . $langs->trans("ShowCashFence") . '</u>';
|
||||||
$label .= '<br><b>' . $langs->trans('ProductRef') . ':</b> ' . ($this->ref?$this->ref:$this->id);
|
$label.= '<br>';
|
||||||
|
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . ($this->ref?$this->ref:$this->id);
|
||||||
|
|
||||||
$linkclose='';
|
$url = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$this->id;
|
||||||
if (empty($notooltip)) {
|
|
||||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if ($option != 'nolink')
|
||||||
$label=$langs->trans("ShowCashFence");
|
{
|
||||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
// 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';
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1, 1).'"';
|
$linkclose='';
|
||||||
$linkclose.= ' class="classfortooltip"';
|
if (empty($notooltip))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$label=$langs->trans("ShowMyObject");
|
||||||
|
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$hookmanager->initHooks(array('productdao'));
|
$hookmanager->initHooks(array('myobjectdao'));
|
||||||
$parameters=array('id'=>$this->id);
|
$parameters=array('id'=>$this->id);
|
||||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
|
||||||
$url = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$this->id;
|
|
||||||
|
|
||||||
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.'"';
|
$linkstart = '<a href="'.$url.'"';
|
||||||
$linkstart.=$linkclose.'>';
|
$linkstart.=$linkclose.'>';
|
||||||
$linkend='</a>';
|
$linkend='</a>';
|
||||||
|
|
||||||
$result.=$linkstart;
|
$result .= $linkstart;
|
||||||
if ($withpicto) {
|
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
|
||||||
$result.=(img_object(($notooltip?'':$label), 'bank', ($notooltip?'class="paddingright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1));
|
if ($withpicto != 2) $result.= $this->ref;
|
||||||
}
|
$result .= $linkend;
|
||||||
$result.= $newref;
|
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||||
$result.= $linkend;
|
|
||||||
|
|
||||||
global $action;
|
global $action;
|
||||||
$hookmanager->initHooks(array('cashfencedao'));
|
$hookmanager->initHooks(array('cashfencedao'));
|
||||||
|
|||||||
@ -72,7 +72,7 @@ llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $par
|
|||||||
$sql.= " b.fk_account, b.fk_type,";
|
$sql.= " b.fk_account, b.fk_type,";
|
||||||
$sql.= " ba.rowid as bankid, ba.ref as bankref,";
|
$sql.= " ba.rowid as bankid, ba.ref as bankref,";
|
||||||
$sql.= " bu.url_id,";
|
$sql.= " bu.url_id,";
|
||||||
$sql.= " f.module_source, f.facnumber as facnumber";
|
$sql.= " f.module_source, f.ref as ref";
|
||||||
$sql.= " FROM ";
|
$sql.= " FROM ";
|
||||||
//if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
|
//if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
||||||
@ -95,7 +95,7 @@ $sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CB;
|
|||||||
$sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
|
$sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
|
||||||
$sql.=")";
|
$sql.=")";
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT f.rowid as facid, f.facnumber, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code";
|
$sql = "SELECT f.rowid as facid, f.ref, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b";
|
||||||
$sql.= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid";
|
$sql.= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid";
|
||||||
$sql.= " AND f.module_source = '".$db->escape($posmodule)."'";
|
$sql.= " AND f.module_source = '".$db->escape($posmodule)."'";
|
||||||
|
|||||||
15
htdocs/compta/facture/card.php
Executable file → Normal file
15
htdocs/compta/facture/card.php
Executable file → Normal file
@ -4656,6 +4656,14 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// POS Ticket
|
||||||
|
if (! empty($conf->takepos->enabled) && $object->module_source == 'takepos')
|
||||||
|
{
|
||||||
|
$langs->load("cashdesk");
|
||||||
|
$receipt_url=DOL_URL_ROOT."/takepos/receipt.php";
|
||||||
|
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="' . $receipt_url . '?facid=' . $object->id.'">' . $langs->trans('POSTicket') .'</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
// Create payment
|
// Create payment
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercanissuepayment) {
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercanissuepayment) {
|
||||||
if ($objectidnext) {
|
if ($objectidnext) {
|
||||||
@ -4700,13 +4708,6 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// POS Ticket
|
|
||||||
if (! empty($conf->takepos->enabled) && $object->module_source != '')
|
|
||||||
{
|
|
||||||
$receipt_url=DOL_URL_ROOT."/takepos/receipt.php";
|
|
||||||
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="' . $receipt_url . '?facid=' . $object->id.'">' . $langs->trans('POSTicket') .'</a></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Classify paid
|
// Classify paid
|
||||||
if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))
|
if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))
|
||||||
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id))
|
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id))
|
||||||
|
|||||||
@ -2532,7 +2532,6 @@ class Facture extends CommonInvoice
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@ -2549,11 +2548,11 @@ class Facture extends CommonInvoice
|
|||||||
|
|
||||||
if ($this->statut == self::STATUS_DRAFT)
|
if ($this->statut == self::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING);
|
dol_syslog(__METHOD__." already draft status", LOG_WARNING);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -78,6 +78,7 @@ $search_product_category=GETPOST('search_product_category', 'int');
|
|||||||
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref', 'alpha'):GETPOST('search_ref', 'alpha');
|
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref', 'alpha'):GETPOST('search_ref', 'alpha');
|
||||||
$search_refcustomer=GETPOST('search_refcustomer', 'alpha');
|
$search_refcustomer=GETPOST('search_refcustomer', 'alpha');
|
||||||
$search_type=GETPOST('search_type', 'int');
|
$search_type=GETPOST('search_type', 'int');
|
||||||
|
$search_project_ref=GETPOST('search_project_ref', 'alpha');
|
||||||
$search_project=GETPOST('search_project', 'alpha');
|
$search_project=GETPOST('search_project', 'alpha');
|
||||||
$search_societe=GETPOST('search_societe', 'alpha');
|
$search_societe=GETPOST('search_societe', 'alpha');
|
||||||
$search_montant_ht=GETPOST('search_montant_ht', 'alpha');
|
$search_montant_ht=GETPOST('search_montant_ht', 'alpha');
|
||||||
@ -160,7 +161,8 @@ $arrayfields=array(
|
|||||||
'f.type'=>array('label'=>"Type", 'checked'=>0),
|
'f.type'=>array('label'=>"Type", 'checked'=>0),
|
||||||
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1),
|
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1),
|
||||||
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1),
|
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1),
|
||||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
|
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||||
's.town'=>array('label'=>"Town", 'checked'=>1),
|
's.town'=>array('label'=>"Town", 'checked'=>1),
|
||||||
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||||
@ -212,6 +214,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
|
|||||||
$search_ref='';
|
$search_ref='';
|
||||||
$search_refcustomer='';
|
$search_refcustomer='';
|
||||||
$search_type='';
|
$search_type='';
|
||||||
|
$search_project_ref='';
|
||||||
$search_project='';
|
$search_project='';
|
||||||
$search_societe='';
|
$search_societe='';
|
||||||
$search_montant_ht='';
|
$search_montant_ht='';
|
||||||
@ -363,8 +366,6 @@ $facturestatic=new Facture($db);
|
|||||||
$formcompany=new FormCompany($db);
|
$formcompany=new FormCompany($db);
|
||||||
$thirdpartystatic=new Societe($db);
|
$thirdpartystatic=new Societe($db);
|
||||||
|
|
||||||
// llxHeader('',$langs->trans('CustomersInvoices'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
|
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql.= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
$sql.= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
||||||
@ -381,9 +382,8 @@ $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
|
|||||||
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
||||||
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
||||||
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||||
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -429,7 +429,8 @@ if ($filtre)
|
|||||||
if ($search_ref) $sql .= natural_search('f.ref', $search_ref);
|
if ($search_ref) $sql .= natural_search('f.ref', $search_ref);
|
||||||
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
|
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
|
||||||
if ($search_type != '' && $search_type != '-1') $sql.=" AND f.type IN (".$db->escape($search_type).")";
|
if ($search_type != '' && $search_type != '-1') $sql.=" AND f.type IN (".$db->escape($search_type).")";
|
||||||
if ($search_project) $sql .= natural_search('p.ref', $search_project);
|
if ($search_project_ref) $sql .= natural_search('p.ref', $search_project_ref);
|
||||||
|
if ($search_project) $sql .= natural_search('p.title', $search_project);
|
||||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||||
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
||||||
if ($search_zip) $sql.= natural_search("s.zip", $search_zip);
|
if ($search_zip) $sql.= natural_search("s.zip", $search_zip);
|
||||||
@ -455,7 +456,7 @@ if ($search_status != '-1' && $search_status != '')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql.= " AND f.fk_statut IN (".$search_status.")"; // When search_status is '1,2' for example
|
$sql.= " AND f.fk_statut IN (".$db->escape($search_status).")"; // When search_status is '1,2' for example
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode);
|
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode);
|
||||||
@ -463,7 +464,7 @@ if ($search_paymentterms > 0) $sql .= " AND f.fk_cond_reglement = ".$db->escape(
|
|||||||
$sql.= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year);
|
$sql.= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year);
|
||||||
$sql.= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim);
|
$sql.= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim);
|
||||||
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
|
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
|
||||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .(int) $search_sale;
|
||||||
if ($search_user > 0)
|
if ($search_user > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
|
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
|
||||||
@ -557,6 +558,8 @@ if ($resql)
|
|||||||
if ($search_year_lim) $param.='&search_year_lim=' .urlencode($search_year_lim);
|
if ($search_year_lim) $param.='&search_year_lim=' .urlencode($search_year_lim);
|
||||||
if ($search_ref) $param.='&search_ref=' .urlencode($search_ref);
|
if ($search_ref) $param.='&search_ref=' .urlencode($search_ref);
|
||||||
if ($search_refcustomer) $param.='&search_refcustomer=' .urlencode($search_refcustomer);
|
if ($search_refcustomer) $param.='&search_refcustomer=' .urlencode($search_refcustomer);
|
||||||
|
if ($search_project_ref) $param.='&search_project_ref='.urlencode($search_project_ref);
|
||||||
|
if ($search_project) $param.='&search_project='.urlencode($search_project);
|
||||||
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
|
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
|
||||||
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
|
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
|
||||||
if ($search_town) $param.='&search_town='.urlencode($search_town);
|
if ($search_town) $param.='&search_town='.urlencode($search_town);
|
||||||
@ -744,8 +747,13 @@ if ($resql)
|
|||||||
print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late'?' checked':'').'> '.$langs->trans("Alert");
|
print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late'?' checked':'').'> '.$langs->trans("Alert");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Project
|
// Project ref
|
||||||
if (! empty($arrayfields['p.ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre"><input class="flat maxwidth50imp" type="text" name="search_project_ref" value="'.$search_project_ref.'"></td>';
|
||||||
|
}
|
||||||
|
// Project label
|
||||||
|
if (! empty($arrayfields['p.title']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre"><input class="flat maxwidth50imp" type="text" name="search_project" value="'.$search_project.'"></td>';
|
print '<td class="liste_titre"><input class="flat maxwidth50imp" type="text" name="search_project" value="'.$search_project.'"></td>';
|
||||||
}
|
}
|
||||||
@ -879,6 +887,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'], $_SERVER['PHP_SELF'], 'f.datef', '', $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'], $_SERVER['PHP_SELF'], 'f.datef', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||||
|
if (! empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER['PHP_SELF'], "p.title", '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||||
@ -944,6 +953,10 @@ if ($resql)
|
|||||||
$thirdpartystatic->email=$obj->email;
|
$thirdpartystatic->email=$obj->email;
|
||||||
$thirdpartystatic->country_code=$obj->country_code;
|
$thirdpartystatic->country_code=$obj->country_code;
|
||||||
|
|
||||||
|
$projectstatic->id=$obj->project_id;
|
||||||
|
$projectstatic->ref=$obj->project_ref;
|
||||||
|
$projectstatic->title=$obj->project_label;
|
||||||
|
|
||||||
$paiement = $facturestatic->getSommePaiement();
|
$paiement = $facturestatic->getSommePaiement();
|
||||||
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
|
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
|
||||||
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
||||||
@ -1029,16 +1042,25 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project
|
// Project ref
|
||||||
if (! empty($arrayfields['p.ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="nocellnopadd nowrap">';
|
||||||
|
if ($obj->project_id > 0)
|
||||||
|
{
|
||||||
|
print $projectstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Project title
|
||||||
|
if (! empty($arrayfields['p.title']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
if ($obj->project_id > 0)
|
if ($obj->project_id > 0)
|
||||||
{
|
{
|
||||||
$projectstatic->id=$obj->project_id;
|
print $projectstatic->title;
|
||||||
$projectstatic->ref=$obj->project_ref;
|
|
||||||
$projectstatic->title=$obj->project_label;
|
|
||||||
print $projectstatic->getNomUrl(1);
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadlangs(array('companies', 'other', 'compta'));
|
$langs->loadlangs(array('companies', 'other', 'bills', 'compta'));
|
||||||
|
|
||||||
$date_startmonth=GETPOST('date_startmonth');
|
$date_startmonth=GETPOST('date_startmonth');
|
||||||
$date_startday=GETPOST('date_startday');
|
$date_startday=GETPOST('date_startday');
|
||||||
|
|||||||
@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('companies', 'other', 'compta'));
|
$langs->loadLangs(array('companies', 'other', 'bills', 'compta'));
|
||||||
|
|
||||||
$date_startmonth=GETPOST('date_startmonth');
|
$date_startmonth=GETPOST('date_startmonth');
|
||||||
$date_startday=GETPOST('date_startday');
|
$date_startday=GETPOST('date_startday');
|
||||||
|
|||||||
@ -222,18 +222,25 @@ if (empty($reshook))
|
|||||||
if ($socid > 0) $thirdparty->fetch($socid);
|
if ($socid > 0) $thirdparty->fetch($socid);
|
||||||
|
|
||||||
// Clean parameters amount if payment is for a credit note
|
// Clean parameters amount if payment is for a credit note
|
||||||
if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE)
|
foreach ($amounts as $key => $value) // How payment is dispatched
|
||||||
{
|
{
|
||||||
foreach ($amounts as $key => $value) // How payment is dispatch
|
$tmpinvoice = new Facture($db);
|
||||||
|
$tmpinvoice->fetch($key);
|
||||||
|
if ($tmpinvoice->type == Facture::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
$newvalue = price2num($value, 'MT');
|
$newvalue = price2num($value, 'MT');
|
||||||
$amounts[$key] = -$newvalue;
|
$amounts[$key] = - abs($newvalue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch
|
foreach ($multicurrency_amounts as $key => $value) // How payment is dispatched
|
||||||
|
{
|
||||||
|
$tmpinvoice = new Facture($db);
|
||||||
|
$tmpinvoice->fetch($key);
|
||||||
|
if ($tmpinvoice->type == Facture::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
$newvalue = price2num($value, 'MT');
|
$newvalue = price2num($value, 'MT');
|
||||||
$multicurrency_amounts[$key] = -$newvalue;
|
$multicurrency_amounts[$key] = - abs($newvalue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,7 +551,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
}
|
}
|
||||||
$sql.= ') AND f.paye = 0';
|
$sql.= ') AND f.paye = 0';
|
||||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
|
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
|
||||||
if ($facture->type != 2)
|
if ($facture->type != Facture::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
$sql .= ' AND type IN (0,1,3,5)'; // Standard invoice, replacement, deposit, situation
|
$sql .= ' AND type IN (0,1,3,5)'; // Standard invoice, replacement, deposit, situation
|
||||||
}
|
}
|
||||||
@ -552,7 +559,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
{
|
{
|
||||||
$sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes
|
$sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort invoices by date and serial number: the older one comes first
|
// Sort invoices by date and serial number: the older one comes first
|
||||||
$sql.=' ORDER BY f.datef ASC, f.ref ASC';
|
$sql.=' ORDER BY f.datef ASC, f.ref ASC';
|
||||||
|
|
||||||
@ -562,9 +568,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$sign=1;
|
|
||||||
if ($facture->type == 2) $sign=-1;
|
|
||||||
|
|
||||||
$arraytitle=$langs->trans('Invoice');
|
$arraytitle=$langs->trans('Invoice');
|
||||||
if ($facture->type == 2) $arraytitle=$langs->trans("CreditNotes");
|
if ($facture->type == 2) $arraytitle=$langs->trans("CreditNotes");
|
||||||
$alreadypayedlabel=$langs->trans('Received');
|
$alreadypayedlabel=$langs->trans('Received');
|
||||||
@ -606,6 +609,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$sign=1;
|
||||||
|
if ($facture->type == Facture::TYPE_CREDIT_NOTE) $sign=-1;
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($objp->socid);
|
$soc->fetch($objp->socid);
|
||||||
|
|
||||||
@ -631,7 +637,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $invoice->getNomUrl(1, '');
|
print $invoice->getNomUrl(1, '');
|
||||||
if($objp->socid != $facture->thirdparty->id) print ' - '.$soc->getNomUrl(1).' ';
|
if ($objp->socid != $facture->thirdparty->id) print ' - '.$soc->getNomUrl(1).' ';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
@ -46,19 +46,19 @@ $confirm=GETPOST('confirm', 'alpha');
|
|||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'contractlist'; // To manage different context of search
|
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'contractlist'; // To manage different context of search
|
||||||
|
|
||||||
$search_name=GETPOST('search_name');
|
$search_name=GETPOST('search_name', 'alpha');
|
||||||
$search_email=GETPOST('search_email');
|
$search_email=GETPOST('search_email', 'alpha');
|
||||||
$search_town=GETPOST('search_town', 'alpha');
|
$search_town=GETPOST('search_town', 'alpha');
|
||||||
$search_zip=GETPOST('search_zip', 'alpha');
|
$search_zip=GETPOST('search_zip', 'alpha');
|
||||||
$search_state=trim(GETPOST("search_state"));
|
$search_state=trim(GETPOST("search_state", 'alpha'));
|
||||||
$search_country=GETPOST("search_country", 'int');
|
$search_country=GETPOST("search_country", 'int');
|
||||||
$search_type_thirdparty=GETPOST("search_type_thirdparty", 'int');
|
$search_type_thirdparty=GETPOST("search_type_thirdparty", 'int');
|
||||||
$search_contract=GETPOST('search_contract');
|
$search_contract=GETPOST('search_contract', 'alpha');
|
||||||
$search_ref_customer=GETPOST('search_ref_customer', 'alpha');
|
$search_ref_customer=GETPOST('search_ref_customer', 'alpha');
|
||||||
$search_ref_supplier=GETPOST('search_ref_supplier', 'alpha');
|
$search_ref_supplier=GETPOST('search_ref_supplier', 'alpha');
|
||||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||||
$search_status=GETPOST('search_status');
|
$search_status=GETPOST('search_status', 'alpha');
|
||||||
$socid=GETPOST('socid');
|
$socid=GETPOST('socid', 'int');
|
||||||
$search_user=GETPOST('search_user', 'int');
|
$search_user=GETPOST('search_user', 'int');
|
||||||
$search_sale=GETPOST('search_sale', 'int');
|
$search_sale=GETPOST('search_sale', 'int');
|
||||||
$search_product_category=GETPOST('search_product_category', 'int');
|
$search_product_category=GETPOST('search_product_category', 'int');
|
||||||
@ -365,9 +365,9 @@ 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(
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2019 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
|
||||||
* 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
|
||||||
@ -47,11 +48,11 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
|
|
||||||
$mode = GETPOST("mode");
|
$mode = GETPOST("mode");
|
||||||
$filter=GETPOST("filter");
|
$filter=GETPOST("filter");
|
||||||
$search_name=GETPOST("search_name");
|
$search_name=GETPOST("search_name", 'alpha');
|
||||||
$search_contract=GETPOST("search_contract");
|
$search_contract=GETPOST("search_contract", 'alpha');
|
||||||
$search_service=GETPOST("search_service");
|
$search_service=GETPOST("search_service", 'alpha');
|
||||||
$search_status=GETPOST("search_status", "alpha");
|
$search_status=GETPOST("search_status", 'alpha');
|
||||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
$statut=GETPOST('statut', 'int')?GETPOST('statut', 'int'):1;
|
||||||
$search_product_category=GETPOST('search_product_category', 'int');
|
$search_product_category=GETPOST('search_product_category', 'int');
|
||||||
$socid=GETPOST('socid', 'int');
|
$socid=GETPOST('socid', 'int');
|
||||||
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'contractservicelist'.$mode;
|
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'contractservicelist'.$mode;
|
||||||
@ -61,20 +62,20 @@ $opouvertureprevueday=GETPOST('opouvertureprevueday');
|
|||||||
$opouvertureprevueyear=GETPOST('opouvertureprevueyear');
|
$opouvertureprevueyear=GETPOST('opouvertureprevueyear');
|
||||||
$filter_opouvertureprevue=GETPOST('filter_opouvertureprevue');
|
$filter_opouvertureprevue=GETPOST('filter_opouvertureprevue');
|
||||||
|
|
||||||
$op1month=GETPOST('op1month');
|
$op1month=GETPOST('op1month', 'int');
|
||||||
$op1day=GETPOST('op1day');
|
$op1day=GETPOST('op1day', 'int');
|
||||||
$op1year=GETPOST('op1year');
|
$op1year=GETPOST('op1year', 'int');
|
||||||
$filter_op1=GETPOST('filter_op1');
|
$filter_op1=GETPOST('filter_op1', 'alpha');
|
||||||
|
|
||||||
$op2month=GETPOST('op2month');
|
$op2month=GETPOST('op2month', 'int');
|
||||||
$op2day=GETPOST('op2day');
|
$op2day=GETPOST('op2day', 'int');
|
||||||
$op2year=GETPOST('op2year');
|
$op2year=GETPOST('op2year', 'int');
|
||||||
$filter_op2=GETPOST('filter_op2');
|
$filter_op2=GETPOST('filter_op2', 'alpha');
|
||||||
|
|
||||||
$opcloturemonth=GETPOST('opcloturemonth');
|
$opcloturemonth=GETPOST('opcloturemonth', 'int');
|
||||||
$opclotureday=GETPOST('opclotureday');
|
$opclotureday=GETPOST('opclotureday', 'int');
|
||||||
$opclotureyear=GETPOST('opclotureyear');
|
$opclotureyear=GETPOST('opclotureyear', 'int');
|
||||||
$filter_opcloture=GETPOST('filter_opcloture');
|
$filter_opcloture=GETPOST('filter_opcloture', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
// 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
|
||||||
|
|||||||
@ -392,8 +392,8 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$looparray[0]=$objectforloop;
|
$looparray[0]=$objectforloop;
|
||||||
}
|
}
|
||||||
//var_dump($looparray);exit;
|
//var_dump($looparray);exit;
|
||||||
dol_syslog("We have set an array of ".count($looparray)." emails to send");
|
dol_syslog("We have set an array of ".count($looparray)." emails to send. oneemailperrecipient=".$oneemailperrecipient);
|
||||||
|
//var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref);
|
||||||
foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
|
foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
|
||||||
{
|
{
|
||||||
// Make substitution in email content
|
// Make substitution in email content
|
||||||
@ -414,8 +414,8 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
|
|
||||||
complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters);
|
complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters);
|
||||||
|
|
||||||
$subject=make_substitutions($subject, $substitutionarray);
|
$subjectreplaced=make_substitutions($subject, $substitutionarray);
|
||||||
$message=make_substitutions($message, $substitutionarray);
|
$messagereplaced=make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
$filepath = $attachedfiles['paths'];
|
$filepath = $attachedfiles['paths'];
|
||||||
$filename = $attachedfiles['names'];
|
$filename = $attachedfiles['names'];
|
||||||
@ -443,10 +443,11 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
}
|
}
|
||||||
//var_dump($filepath);
|
//var_dump($filepath);
|
||||||
//var_dump($trackid);exit;
|
//var_dump($trackid);exit;
|
||||||
|
//var_dump($subjectreplaced);
|
||||||
|
|
||||||
// Send mail (substitutionarray must be done just before this)
|
// Send mail (substitutionarray must be done just before this)
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid);
|
$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid);
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
{
|
{
|
||||||
$resaction.='<div class="error">'.$mailfile->error.'</div>';
|
$resaction.='<div class="error">'.$mailfile->error.'</div>';
|
||||||
@ -478,9 +479,9 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
|
||||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
|
||||||
}
|
}
|
||||||
$actionmsg2='';
|
$actionmsg2='';
|
||||||
|
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/ajax/vatrates.php
|
* \file htdocs/core/ajax/getaccountcurrency.php
|
||||||
* \brief File to load vat rates combobox
|
* \brief File to load currency rates
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||||
@ -28,6 +28,7 @@ require '../../main.inc.php';
|
|||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -138,7 +138,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
|||||||
$tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '<br>' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
|
$tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '<br>' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => '',
|
'td' => 'class="nowraponall"',
|
||||||
'text' => $facturestatic->getNomUrl(1),
|
'text' => $facturestatic->getNomUrl(1),
|
||||||
'text2'=> $late,
|
'text2'=> $late,
|
||||||
'asis' => 1
|
'asis' => 1
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class box_project extends ModeleBoxes
|
|||||||
$projectstatic->public = $objp->public;
|
$projectstatic->public = $objp->public;
|
||||||
|
|
||||||
$this->info_box_contents[$i][] = array(
|
$this->info_box_contents[$i][] = array(
|
||||||
'td' => '',
|
'td' => 'class="nowraponall"',
|
||||||
'text' => $projectstatic->getNomUrl(1),
|
'text' => $projectstatic->getNomUrl(1),
|
||||||
'asis' => 1
|
'asis' => 1
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1227,10 +1227,10 @@ abstract class CommonObject
|
|||||||
$result=array();
|
$result=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
//cas particulier pour les expeditions
|
//cas particulier pour les expeditions
|
||||||
if($this->element=='shipping' && $this->origin_id != 0) {
|
if ($this->element=='shipping' && $this->origin_id != 0) {
|
||||||
$id=$this->origin_id;
|
$id=$this->origin_id;
|
||||||
$element='commande';
|
$element='commande';
|
||||||
} elseif($this->element=='reception' && $this->origin_id != 0) {
|
} elseif ($this->element=='reception' && $this->origin_id != 0) {
|
||||||
$id=$this->origin_id;
|
$id=$this->origin_id;
|
||||||
$element='order_supplier';
|
$element='order_supplier';
|
||||||
} else {
|
} else {
|
||||||
@ -1250,7 +1250,7 @@ abstract class CommonObject
|
|||||||
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
|
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
|
||||||
$sql.= " AND tc.element = '".$element."'";
|
$sql.= " AND tc.element = '".$element."'";
|
||||||
$sql.= " AND tc.source = '".$source."'";
|
$sql.= " AND tc.source = '".$source."'";
|
||||||
$sql.= " AND tc.code = '".$code."'";
|
if ($code) $sql.= " AND tc.code = '".$code."'";
|
||||||
$sql.= " AND tc.active = 1";
|
$sql.= " AND tc.active = 1";
|
||||||
if ($status) $sql.= " AND ec.statut = ".$status;
|
if ($status) $sql.= " AND ec.statut = ".$status;
|
||||||
|
|
||||||
@ -3649,7 +3649,8 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
|
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
|
||||||
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
||||||
}elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
|
}
|
||||||
|
elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
|
||||||
{
|
{
|
||||||
if (empty($totalToShip)) $totalToShip=0;
|
if (empty($totalToShip)) $totalToShip=0;
|
||||||
$totalToShip+=$line->qty; // defined for reception only
|
$totalToShip+=$line->qty; // defined for reception only
|
||||||
@ -4271,7 +4272,7 @@ abstract class CommonObject
|
|||||||
$productstatic->id = $line->fk_product;
|
$productstatic->id = $line->fk_product;
|
||||||
$productstatic->ref = $line->ref;
|
$productstatic->ref = $line->ref;
|
||||||
$productstatic->type = $line->fk_product_type;
|
$productstatic->type = $line->fk_product_type;
|
||||||
if(empty($productstatic->ref)){
|
if (empty($productstatic->ref)) {
|
||||||
$line->fetch_product();
|
$line->fetch_product();
|
||||||
$productstatic = $line->product;
|
$productstatic = $line->product;
|
||||||
}
|
}
|
||||||
@ -7010,7 +7011,7 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if(is_array($info))
|
if(is_array($info))
|
||||||
{
|
{
|
||||||
if (isset($info['type']) && (preg_match('/^(double|real)/i', $info['type']))) return true;
|
if (isset($info['type']) && (preg_match('/^(double|real|price)/i', $info['type']))) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
|||||||
@ -177,7 +177,7 @@ class DolEditor
|
|||||||
$out.= $this->content;
|
$out.= $this->content;
|
||||||
$out.= '</textarea>';
|
$out.= '</textarea>';
|
||||||
|
|
||||||
if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax))
|
if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax) && ! empty($conf->fckeditor->enabled))
|
||||||
{
|
{
|
||||||
if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR', '1');
|
if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR', '1');
|
||||||
|
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class DolGraph
|
|||||||
public function __construct($library = 'jflot')
|
public function __construct($library = 'jflot')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor;
|
||||||
|
|
||||||
// To use old feature
|
// To use old feature
|
||||||
if ($library == 'artichow')
|
if ($library == 'artichow')
|
||||||
@ -883,7 +883,6 @@ class DolGraph
|
|||||||
private function draw_jflot($file, $fileurl)
|
private function draw_jflot($file, $fileurl)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $artichow_defaultfont;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
|
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
|
||||||
|
|
||||||
|
|||||||
@ -1898,7 +1898,9 @@ class Form
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
|
// check parameters
|
||||||
$price_level = (! empty($price_level) ? $price_level : 0);
|
$price_level = (! empty($price_level) ? $price_level : 0);
|
||||||
|
if (is_null($ajaxoptions)) $ajaxoptions=array();
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
|
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
|
||||||
{
|
{
|
||||||
@ -2084,6 +2086,11 @@ class Form
|
|||||||
$sql.=' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx';
|
$sql.=' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx';
|
||||||
$selectFields.= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx";
|
$selectFields.= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx";
|
||||||
}
|
}
|
||||||
|
// Units
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
|
$sql .= ', u.label as unit_long, u.short_label as unit_short';
|
||||||
|
$selectFields .= ', unit_long, unit_short';
|
||||||
|
}
|
||||||
|
|
||||||
// Multilang : we add translation
|
// Multilang : we add translation
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||||
@ -2121,6 +2128,10 @@ class Form
|
|||||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
||||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_customer_price as pcp ON pcp.fk_soc=".$socid." AND pcp.fk_product=p.rowid";
|
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_customer_price as pcp ON pcp.fk_soc=".$socid." AND pcp.fk_product=p.rowid";
|
||||||
}
|
}
|
||||||
|
// Units
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_units u ON u.rowid = p.fk_unit";
|
||||||
|
}
|
||||||
// Multilang : we add translation
|
// Multilang : we add translation
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||||
{
|
{
|
||||||
@ -2382,6 +2393,10 @@ class Form
|
|||||||
$opt.= $objp->ref;
|
$opt.= $objp->ref;
|
||||||
if ($outbarcode) $opt.=' ('.$outbarcode.')';
|
if ($outbarcode) $opt.=' ('.$outbarcode.')';
|
||||||
$opt.=' - '.dol_trunc($label, $maxlengtharticle);
|
$opt.=' - '.dol_trunc($label, $maxlengtharticle);
|
||||||
|
// Units
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
|
$opt .= ' (' . $objp->unit_short . ')';
|
||||||
|
}
|
||||||
|
|
||||||
$objRef = $objp->ref;
|
$objRef = $objp->ref;
|
||||||
if (! empty($filterkey) && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
|
if (! empty($filterkey) && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
|
||||||
@ -7189,7 +7204,7 @@ class Form
|
|||||||
if ($object->photo) $ret.="<br>\n";
|
if ($object->photo) $ret.="<br>\n";
|
||||||
$ret.='<table class="nobordernopadding centpercent">';
|
$ret.='<table class="nobordernopadding centpercent">';
|
||||||
if ($object->photo) $ret.='<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
if ($object->photo) $ret.='<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||||
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput"'.($capture?' capture="'.$capture.'"':'').'></td></tr>';
|
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture?' capture="'.$capture.'"':'').'></td></tr>';
|
||||||
$ret.='</table>';
|
$ret.='</table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -290,7 +290,7 @@ class FormFile
|
|||||||
* Return a string to show the box with list of available documents for object.
|
* Return a string to show the box with list of available documents for object.
|
||||||
* This also set the property $this->numoffiles
|
* This also set the property $this->numoffiles
|
||||||
*
|
*
|
||||||
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...)
|
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:nameofsubmodule', 'mymodule_temp', ...)
|
||||||
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
||||||
* @param string $filedir Directory to scan
|
* @param string $filedir Directory to scan
|
||||||
* @param string $urlsource Url of origin page (for return)
|
* @param string $urlsource Url of origin page (for return)
|
||||||
@ -336,7 +336,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
$printer=0;
|
$printer=0;
|
||||||
if (in_array($modulepart, array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport','livraison'))) // The direct print feature is implemented only for such elements
|
if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'livraison', 'ticket'))) // The direct print feature is implemented only for such elements
|
||||||
{
|
{
|
||||||
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false;
|
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false;
|
||||||
}
|
}
|
||||||
@ -643,19 +643,23 @@ class FormFile
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$submodulepart = $modulepart;
|
||||||
|
|
||||||
// For normalized standard modules
|
// For normalized standard modules
|
||||||
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php', 0);
|
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php', 0);
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$res=include_once $file;
|
$res=include_once $file;
|
||||||
}
|
}
|
||||||
// For normalized external modules
|
// For normalized external modules. modulepart = 'nameofmodule' or 'nameofmodule:nameofsubmodule'
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php', 0);
|
$tmp=explode(':', $modulepart);
|
||||||
|
if (! empty($tmp[2])) $submodulepart=$tmp[2];
|
||||||
|
$file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$submodulepart.'.php', 0);
|
||||||
$res=include_once $file;
|
$res=include_once $file;
|
||||||
}
|
}
|
||||||
$class='ModelePDF'.ucfirst($modulepart);
|
$class='ModelePDF'.ucfirst($submodulepart);
|
||||||
if (class_exists($class))
|
if (class_exists($class))
|
||||||
{
|
{
|
||||||
$modellist=call_user_func($class.'::liste_modeles', $this->db);
|
$modellist=call_user_func($class.'::liste_modeles', $this->db);
|
||||||
@ -670,7 +674,6 @@ class FormFile
|
|||||||
// Set headershown to avoid to have table opened a second time later
|
// Set headershown to avoid to have table opened a second time later
|
||||||
$headershown=1;
|
$headershown=1;
|
||||||
|
|
||||||
$buttonlabeltoshow=$buttonlabel;
|
|
||||||
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
|
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
|
||||||
|
|
||||||
if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation
|
if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation
|
||||||
@ -866,7 +869,7 @@ class FormFile
|
|||||||
{
|
{
|
||||||
$out.='<tr class="oddeven">';
|
$out.='<tr class="oddeven">';
|
||||||
$out.='<td colspan="'.$colspan.'" class="maxwidhtonsmartphone">';
|
$out.='<td colspan="'.$colspan.'" class="maxwidhtonsmartphone">';
|
||||||
$out.='<a data-ajax="false" href="' . $link->url . '" target="_blank">';
|
$out.='<a data-ajax="false" href="' . $file->url . '" target="_blank">';
|
||||||
$out.=$file->label;
|
$out.=$file->label;
|
||||||
$out.='</a>';
|
$out.='</a>';
|
||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
@ -1317,7 +1320,7 @@ class FormFile
|
|||||||
{
|
{
|
||||||
// Delete or view link
|
// Delete or view link
|
||||||
// ($param must start with &)
|
// ($param must start with &)
|
||||||
print '<td class="valignmiddle right actionbuttons"><!-- action on files -->';
|
print '<td class="valignmiddle right actionbuttons nowraponall"><!-- action on files -->';
|
||||||
if ($useinecm == 1 || $useinecm == 5)
|
if ($useinecm == 1 || $useinecm == 5)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||||
|
|||||||
@ -683,7 +683,7 @@ function translation_prepare_head()
|
|||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
|
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
|
||||||
$head[$h][1] = $langs->trans("TranslationOverwriteKey");
|
$head[$h][1] = $langs->trans("TranslationOverwriteKey").'<span class="fa fa-plus-circle valignmiddle paddingleft"></span>';
|
||||||
$head[$h][2] = 'overwrite';
|
$head[$h][2] = 'overwrite';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -1557,7 +1557,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
|
|||||||
$info = pathinfo($destfull);
|
$info = pathinfo($destfull);
|
||||||
$destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
|
$destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
|
||||||
$info = pathinfo($destfile);
|
$info = pathinfo($destfile);
|
||||||
|
|
||||||
$destfile = dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
|
$destfile = dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
|
||||||
|
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
|
||||||
|
// this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
|
||||||
|
$destfile = dol_string_nohtmltag($destfile);
|
||||||
|
$destfull = dol_string_nohtmltag($destfull);
|
||||||
|
|
||||||
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
|
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
|
||||||
|
|
||||||
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
|
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
|
||||||
|
|||||||
@ -660,7 +660,9 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
|||||||
if (empty($type)) // For a filesystem path
|
if (empty($type)) // For a filesystem path
|
||||||
{
|
{
|
||||||
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard default path
|
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard default path
|
||||||
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
if (is_array($conf->file->dol_document_root))
|
||||||
|
{
|
||||||
|
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array("main"=>"/home/main/htdocs", "alt0"=>"/home/dirmod/htdocs", ...)
|
||||||
{
|
{
|
||||||
if ($key == 'main')
|
if ($key == 'main')
|
||||||
{
|
{
|
||||||
@ -672,6 +674,7 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($returnemptyifnotfound) // Not found into alternate dir
|
if ($returnemptyifnotfound) // Not found into alternate dir
|
||||||
{
|
{
|
||||||
if ($returnemptyifnotfound == 1 || ! file_exists($res)) return '';
|
if ($returnemptyifnotfound == 1 || ! file_exists($res)) return '';
|
||||||
@ -3593,12 +3596,12 @@ function img_allow($allow, $titlealt = 'default')
|
|||||||
*/
|
*/
|
||||||
function img_credit_card($brand)
|
function img_credit_card($brand)
|
||||||
{
|
{
|
||||||
if ($brand == 'Visa') {$brand='cc-visa';}
|
if ($brand == 'visa' || $brand == 'Visa') {$brand='cc-visa';}
|
||||||
elseif ($brand == 'MasterCard') {$brand='cc-mastercard';}
|
elseif ($brand == 'mastercard' || $brand == 'MasterCard') {$brand='cc-mastercard';}
|
||||||
elseif ($brand == 'American Express') {$brand='cc-amex';}
|
elseif ($brand == 'amex' || $brand == 'American Express') {$brand='cc-amex';}
|
||||||
elseif ($brand == 'Discover') {$brand='cc-discover';}
|
elseif ($brand == 'discover' || $brand == 'Discover') {$brand='cc-discover';}
|
||||||
elseif ($brand == 'JCB') {$brand='cc-jcb';}
|
elseif ($brand == 'jcb' || $brand == 'JCB') {$brand='cc-jcb';}
|
||||||
elseif ($brand == 'Diners Club') {$brand='cc-diners-club';}
|
elseif ($brand == 'diners' || $brand == 'Diners club') {$brand='cc-diners-club';}
|
||||||
elseif (! in_array($brand, array('cc-visa','cc-mastercard','cc-amex','cc-discover','cc-jcb','cc-diners-club'))) {$brand='credit-card';}
|
elseif (! in_array($brand, array('cc-visa','cc-mastercard','cc-amex','cc-discover','cc-jcb','cc-diners-club'))) {$brand='credit-card';}
|
||||||
|
|
||||||
return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>';
|
return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>';
|
||||||
@ -6582,7 +6585,7 @@ function dol_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembe
|
|||||||
* or descending output and uses optionally natural case insensitive sorting (which
|
* or descending output and uses optionally natural case insensitive sorting (which
|
||||||
* can be optionally case sensitive as well).
|
* can be optionally case sensitive as well).
|
||||||
*
|
*
|
||||||
* @param array $array Array to sort (array of array('key','otherkey1','otherkey2'...))
|
* @param array $array Array to sort (array of array('key1'=>val1,'key2'=>val2,'key3'...) or array of objects)
|
||||||
* @param string $index Key in array to use for sorting criteria
|
* @param string $index Key in array to use for sorting criteria
|
||||||
* @param int $order Sort order ('asc' or 'desc')
|
* @param int $order Sort order ('asc' or 'desc')
|
||||||
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort)
|
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort)
|
||||||
@ -6601,7 +6604,17 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
|
|||||||
if ($sizearray>0)
|
if ($sizearray>0)
|
||||||
{
|
{
|
||||||
$temp = array();
|
$temp = array();
|
||||||
foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
|
foreach(array_keys($array) as $key)
|
||||||
|
{
|
||||||
|
if (is_object($array[$key]))
|
||||||
|
{
|
||||||
|
$temp[$key]=$array[$key]->$index;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$temp[$key]=$array[$key][$index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $natsort) {
|
if (! $natsort) {
|
||||||
($order=='asc') ? asort($temp) : arsort($temp);
|
($order=='asc') ? asort($temp) : arsort($temp);
|
||||||
|
|||||||
@ -577,7 +577,7 @@ function isValidVATID($company)
|
|||||||
$vatprefix = $company->country_code;
|
$vatprefix = $company->country_code;
|
||||||
if ($vatprefix == 'GR') $vatprefix = '(EL|GR)';
|
if ($vatprefix == 'GR') $vatprefix = '(EL|GR)';
|
||||||
else $vatprefix = preg_quote($vatprefix, '/');
|
else $vatprefix = preg_quote($vatprefix, '/');
|
||||||
if (! preg_match('/^'.$vatprefix.'[a-zA-Z0-9\-\.]{5,10}$/', $company->tva_intra))
|
if (! preg_match('/^'.$vatprefix.'[a-zA-Z0-9\-\.]{5,12}$/', $company->tva_intra))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,8 @@ function propal_prepare_head($object)
|
|||||||
$head[$h][2] = 'comm';
|
$head[$h][2] = 'comm';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ((empty($conf->commande->enabled) && ((! empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
|
if ((empty($conf->commande->enabled) && ((! empty($conf->expedition->enabled) && ! empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
|
||||||
|| (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire))))
|
|| (! empty($conf->expedition->enabled) && ! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire))))
|
||||||
{
|
{
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
$text = '';
|
$text = '';
|
||||||
|
|||||||
52
htdocs/core/lib/takepos.lib.php
Normal file
52
htdocs/core/lib/takepos.lib.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/lib/takepos.lib.php
|
||||||
|
* \brief Library file with function for TakePOS module
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare array with list of tabs
|
||||||
|
*
|
||||||
|
* @return array Array of tabs
|
||||||
|
*/
|
||||||
|
function takepos_prepare_head()
|
||||||
|
{
|
||||||
|
global $langs, $conf;
|
||||||
|
|
||||||
|
$h = 0;
|
||||||
|
$head = array();
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/setup.php';
|
||||||
|
$head[$h][1] = $langs->trans("Parameters");
|
||||||
|
$head[$h][2] = 'setup';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
for ($i = 1; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
|
||||||
|
$head[$h][1] = $langs->trans("Terminal"). " ".$i;
|
||||||
|
$head[$h][2] = 'terminal'.$i;
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos');
|
||||||
|
|
||||||
|
return $head;
|
||||||
|
}
|
||||||
@ -142,12 +142,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
|
|
||||||
// Products-Services
|
// Products-Services
|
||||||
$tmpentry = array(
|
$tmpentry = array(
|
||||||
'enabled'=> (( ! empty($conf->societe->enabled) &&
|
'enabled'=> (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
||||||
( empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) )
|
'perms'=> (! empty($user->rights->produit->lire) || ! empty($user->rights->service->lire)),
|
||||||
)
|
|
||||||
|| ! empty($conf->fournisseur->enabled)
|
|
||||||
),
|
|
||||||
'perms'=> (! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)),
|
|
||||||
'module'=>'product|service'
|
'module'=>'product|service'
|
||||||
);
|
);
|
||||||
$menu_arr[] = array(
|
$menu_arr[] = array(
|
||||||
@ -318,7 +314,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
$tmpentry = array(
|
$tmpentry = array(
|
||||||
'enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->asset->enabled)),
|
'enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->asset->enabled)),
|
||||||
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)),
|
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)),
|
||||||
'comptabilite|accounting|asset'
|
'module'=>'comptabilite|accounting|asset'
|
||||||
);
|
);
|
||||||
$menu_arr[] = array(
|
$menu_arr[] = array(
|
||||||
'name' => 'Accounting',
|
'name' => 'Accounting',
|
||||||
@ -337,7 +333,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
|
|
||||||
'session' => ( ( $_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy" ) ? 0 : 1 ),
|
'session' => ( ( $_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy" ) ? 0 : 1 ),
|
||||||
|
|
||||||
'loadLangs' => array("compta"),
|
'loadLangs' => array("compta","accountancy","assets"),
|
||||||
'submenus' => array(),
|
'submenus' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1154,8 +1150,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
// Accounting (Double entries)
|
// Accounting (Double entries)
|
||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("accountancy");
|
|
||||||
|
|
||||||
$permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
|
$permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
|
||||||
//$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
//$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
||||||
|
|
||||||
@ -1252,7 +1246,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
// Accounting
|
// Accounting
|
||||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1);
|
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1);
|
||||||
|
|
||||||
|
|
||||||
// General Ledger
|
// General Ledger
|
||||||
$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire);
|
$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire);
|
||||||
|
|
||||||
@ -1266,8 +1259,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reports
|
// Reports
|
||||||
$langs->load("compta");
|
|
||||||
|
|
||||||
$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
||||||
|
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
|
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
|
||||||
@ -1338,8 +1329,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
// Accountancy (simple)
|
// Accountancy (simple)
|
||||||
if (! empty($conf->comptabilite->enabled))
|
if (! empty($conf->comptabilite->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("compta");
|
|
||||||
|
|
||||||
// Bilan, resultats
|
// Bilan, resultats
|
||||||
$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
$newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
|
||||||
|
|
||||||
@ -1374,7 +1363,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
// Assets
|
// Assets
|
||||||
if (! empty($conf->asset->enabled))
|
if (! empty($conf->asset->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("assets");
|
|
||||||
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset');
|
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset');
|
||||||
$newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write);
|
$newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write);
|
||||||
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read);
|
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read);
|
||||||
|
|||||||
@ -84,7 +84,6 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
$this->posxref=$this->marge_gauche+1;
|
$this->posxref=$this->marge_gauche+1;
|
||||||
$this->posxlabel=$this->marge_gauche+25;
|
$this->posxlabel=$this->marge_gauche+25;
|
||||||
$this->posxworkload=$this->marge_gauche+100;
|
$this->posxworkload=$this->marge_gauche+100;
|
||||||
$this->posxprogress=$this->marge_gauche+130;
|
|
||||||
$this->posxdatestart=$this->marge_gauche+150;
|
$this->posxdatestart=$this->marge_gauche+150;
|
||||||
$this->posxdateend=$this->marge_gauche+170;
|
$this->posxdateend=$this->marge_gauche+170;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,12 +83,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined
|
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined
|
||||||
|
|
||||||
// Defini position des colonnes
|
// Defini position des colonnes
|
||||||
$this->posxref=$this->marge_gauche+1;
|
$this->posxref=$this->marge_gauche;
|
||||||
$this->posxlabel=$this->marge_gauche+25;
|
|
||||||
$this->posxworkload=$this->marge_gauche+100;
|
|
||||||
$this->posxprogress=$this->marge_gauche+130;
|
|
||||||
$this->posxdatestart=$this->marge_gauche+150;
|
|
||||||
$this->posxdateend=$this->marge_gauche+170;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -203,7 +198,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
if (! empty($object->note_public))
|
if (! empty($object->note_public))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxref, $tab_top-2, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-($tab_top-2);
|
$height_note=$nexY-($tab_top-2);
|
||||||
|
|
||||||
|
|||||||
@ -180,6 +180,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->posxtva=110;
|
$this->posxtva=110;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
|
$this->posxunit=162;
|
||||||
}
|
}
|
||||||
$this->posxdiscount=162;
|
$this->posxdiscount=162;
|
||||||
$this->postotalht=174;
|
$this->postotalht=174;
|
||||||
@ -314,14 +315,16 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->atleastonediscount++;
|
$this->atleastonediscount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
|
if (empty($this->atleastonediscount))
|
||||||
{
|
{
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
$delta = ($this->postotalht - $this->posxdiscount);
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
$this->posxpicture+=$delta;
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
$this->posxtva+=$delta;
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
$this->posxup+=$delta;
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
$this->posxqty+=$delta;
|
||||||
//$this->postotalht;
|
$this->posxunit+=$delta;
|
||||||
|
$this->posxdiscount+=$delta;
|
||||||
|
// post of fields after are not modified, stay at same position
|
||||||
}
|
}
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
@ -476,15 +479,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -1190,22 +1185,14 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
if (empty($hidetop)) {
|
if (empty($hidetop)) {
|
||||||
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
||||||
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
|
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
|
||||||
'C');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -356,15 +356,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
|
|
||||||
{
|
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
|
||||||
//$this->postotalht;
|
|
||||||
}
|
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
@ -1711,22 +1702,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
'border-left' => true, // add left line separator
|
'border-left' => true, // add left line separator
|
||||||
);
|
);
|
||||||
|
|
||||||
$rank = $rank + 10;
|
|
||||||
$this->cols['progress'] = array(
|
|
||||||
'rank' => $rank,
|
|
||||||
'width' => 19, // in mm
|
|
||||||
'status' => false,
|
|
||||||
'title' => array(
|
|
||||||
'textkey' => 'Progress'
|
|
||||||
),
|
|
||||||
'border-left' => false, // add left line separator
|
|
||||||
);
|
|
||||||
|
|
||||||
if($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$this->cols['progress']['status'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$rank = $rank + 10;
|
$rank = $rank + 10;
|
||||||
$this->cols['unit'] = array(
|
$this->cols['unit'] = array(
|
||||||
'rank' => $rank,
|
'rank' => $rank,
|
||||||
|
|||||||
@ -949,7 +949,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
|
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
|
||||||
if (empty($hidetop)) {
|
if (empty($hidetop)) {
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
$pdf->MultiCell($this->postotalttc-$this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'R');
|
$pdf->MultiCell($this->postotalttc-$this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total with all taxes
|
// Total with all taxes
|
||||||
|
|||||||
@ -179,7 +179,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// Define position of columns
|
// Define position of columns
|
||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if (!empty($conf->global->PRODUCT_USE_UNITS))
|
||||||
{
|
{
|
||||||
$this->posxtva=101;
|
$this->posxtva=101;
|
||||||
$this->posxup=118;
|
$this->posxup=118;
|
||||||
@ -191,9 +191,11 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->posxtva=110;
|
$this->posxtva=110;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
|
$this->posxunit=162;
|
||||||
}
|
}
|
||||||
|
$this->posxprogress=151; // Only displayed for situation invoices
|
||||||
$this->posxdiscount=162;
|
$this->posxdiscount=162;
|
||||||
$this->posxprogress=126; // Only displayed for situation invoices
|
$this->posxprogress=174;
|
||||||
$this->postotalht=174;
|
$this->postotalht=174;
|
||||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
|
||||||
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
|
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
|
||||||
@ -363,30 +365,31 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->atleastonediscount++;
|
$this->atleastonediscount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS)) // retreive space not used by discount
|
if (empty($this->atleastonediscount)) // retreive space not used by discount
|
||||||
{
|
{
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
$delta = ($this->posxprogress - $this->posxdiscount);
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
$this->posxpicture+=$delta;
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
$this->posxtva+=$delta;
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
$this->posxup+=$delta;
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
$this->posxqty+=$delta;
|
||||||
//$this->postotalht;
|
$this->posxunit+=$delta;
|
||||||
|
$this->posxdiscount+=$delta;
|
||||||
|
// post of fields after are not modified, stay at same position
|
||||||
}
|
}
|
||||||
|
|
||||||
$progress_width = 0;
|
$progress_width = 0;
|
||||||
// Situation invoice handling
|
// Situation invoice handling
|
||||||
if ($object->situation_cycle_ref)
|
if ($object->situation_cycle_ref && empty($conf->global->MAIN_PDF_HIDE_SITUATION))
|
||||||
{
|
{
|
||||||
$this->situationinvoice = true;
|
$this->situationinvoice = true;
|
||||||
$progress_width = 18;
|
$progress_width = 10;
|
||||||
|
$this->posxpicture -= $progress_width;
|
||||||
$this->posxtva -= $progress_width;
|
$this->posxtva -= $progress_width;
|
||||||
$this->posxup -= $progress_width;
|
$this->posxup -= $progress_width;
|
||||||
$this->posxqty -= $progress_width;
|
$this->posxqty -= $progress_width;
|
||||||
if(empty($conf->global->PRODUCT_USE_UNITS)) {
|
$this->posxunit -= $progress_width;
|
||||||
$this->posxprogress += $progress_width;
|
$this->posxdiscount -= $progress_width;
|
||||||
}
|
$this->posxprogress -= $progress_width;
|
||||||
/*$this->posxdiscount -= $progress_width;
|
|
||||||
$this->posxprogress -= $progress_width;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
@ -567,42 +570,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
|
|
||||||
if ($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
elseif($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Situation progress
|
|
||||||
if ($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
|
|
||||||
$pdf->SetXY($this->posxprogress, $curY);
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxprogress-1, 3, $progress, 0, 'R');
|
|
||||||
}
|
|
||||||
elseif ($this->atleastonediscount)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxprogress-1, 3, $progress, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if (! empty($conf->global->PRODUCT_USE_UNITS))
|
||||||
{
|
{
|
||||||
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$pdf->SetXY($this->posxunit, $curY);
|
$pdf->SetXY($this->posxunit, $curY);
|
||||||
@ -614,7 +585,15 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxdiscount-2, $curY);
|
$pdf->SetXY($this->posxdiscount-2, $curY);
|
||||||
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
|
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Situation progress
|
||||||
|
if ($this->situationinvoice)
|
||||||
|
{
|
||||||
|
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
|
||||||
|
$pdf->SetXY($this->posxprogress, $curY);
|
||||||
|
$pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total HT line
|
// Total HT line
|
||||||
@ -1526,76 +1505,37 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
|
|
||||||
if($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxprogress-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
elseif($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS))
|
||||||
{
|
{
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
|
if (empty($hidetop)) {
|
||||||
|
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
||||||
|
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->atleastonediscount)
|
||||||
|
{
|
||||||
|
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
|
||||||
|
if (empty($hidetop))
|
||||||
|
{
|
||||||
|
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->situationinvoice) {
|
if ($this->situationinvoice) {
|
||||||
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
|
||||||
|
|
||||||
if (empty($hidetop)) {
|
if (empty($hidetop)) {
|
||||||
|
|
||||||
$pdf->SetXY($this->posxprogress, $tab_top+1);
|
$pdf->SetXY($this->posxprogress, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->postotalht-$this->posxprogress, 2, $outputlangs->transnoentities("ProgressShort"), '', 'C');
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxprogress, 2, $outputlangs->transnoentities("Progress"), '', 'C');
|
|
||||||
}
|
|
||||||
elseif ($this->atleastonediscount)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxprogress, 2, $outputlangs->transnoentities("Progress"), '', 'C');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxprogress, 2, $outputlangs->transnoentities("Progress"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
|
||||||
if (empty($hidetop)) {
|
|
||||||
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
|
||||||
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
|
|
||||||
'C');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
|
|
||||||
if (empty($hidetop))
|
|
||||||
{
|
|
||||||
if ($this->atleastonediscount)
|
|
||||||
{
|
|
||||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$pdf->line($this->postotalht+4, $tab_top, $this->postotalht+4, $tab_top + $tab_height);
|
|
||||||
if (empty($hidetop))
|
|
||||||
{
|
|
||||||
$pdf->SetXY($this->postotalht-19, $tab_top+1);
|
|
||||||
$pdf->MultiCell(30, 2, $outputlangs->transnoentities("Situation"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->atleastonediscount)
|
|
||||||
{
|
|
||||||
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
|
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
|
||||||
}
|
|
||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
/* Copyright (C) 2011-2019 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2018 Charlene 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
|
||||||
@ -72,7 +72,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays
|
|||||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$texte.= '<input type="hidden" name="action" value="updateMask">';
|
$texte.= '<input type="hidden" name="action" value="updateMask">';
|
||||||
$texte.= '<input type="hidden" name="maskconstcontract" value="HOLIDAY_IMMACULATE_MASK">';
|
$texte.= '<input type="hidden" name="maskconstholiday" value="HOLIDAY_IMMACULATE_MASK">';
|
||||||
$texte.= '<table class="nobordernopadding" width="100%">';
|
$texte.= '<table class="nobordernopadding" width="100%">';
|
||||||
|
|
||||||
$tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("Holiday"), $langs->transnoentities("Holiday"));
|
$tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("Holiday"), $langs->transnoentities("Holiday"));
|
||||||
|
|||||||
@ -243,11 +243,12 @@ class modAccounting extends DolibarrModules
|
|||||||
$this->export_icon[$r]='Accounting';
|
$this->export_icon[$r]='Accounting';
|
||||||
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
|
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
|
||||||
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
|
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
|
||||||
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
|
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.account_parent'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
|
||||||
$this->export_entities_array[$r]=array('ac.rowid'=>"Accounting",'ac.pcg_version'=>"Accounting",'aa.rowid'=>'Accounting','aa.account_number'=>"Accounting",'aa.label'=>"Accounting",'aa.accountparent'=>"Accounting",'aa.pcg_type'=>"Accounting",'aa.pcgsubtype'=>"Accounting",'aa_active'=>"Accounting");
|
$this->export_entities_array[$r]=array('ac.rowid'=>"Accounting",'ac.pcg_version'=>"Accounting",'aa.rowid'=>'Accounting','aa.account_number'=>"Accounting",'aa.label'=>"Accounting",'aa.accountparent'=>"Accounting",'aa.pcg_type'=>"Accounting",'aa.pcgsubtype'=>"Accounting",'aa_active'=>"Accounting");
|
||||||
|
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa, '.MAIN_DB_PREFIX.'accounting_system as ac';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa';
|
||||||
|
$this->export_sql_end[$r] .=' ,'.MAIN_DB_PREFIX.'accounting_system as ac';
|
||||||
$this->export_sql_end[$r] .=' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') ';
|
$this->export_sql_end[$r] .=' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') ';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -211,21 +211,21 @@ class modBom extends DolibarrModules
|
|||||||
$r=0;
|
$r=0;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Read bom of Bom'; // Permission label
|
$this->rights[$r][1] = 'Read bom of Bom'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Create/Update bom of Bom'; // Permission label
|
$this->rights[$r][1] = 'Create/Update bom of Bom'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Delete bom of Bom'; // Permission label
|
$this->rights[$r][1] = 'Delete bom of Bom'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2)
|
||||||
|
|
||||||
|
|||||||
@ -93,8 +93,8 @@ class modBookmark extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 333; // id de la permission
|
$this->rights[$r][0] = 333; // id de la permission
|
||||||
$this->rights[$r][1] = 'Supprimer les bookmarks'; // libelle de la permission
|
$this->rights[$r][1] = 'Supprimer les bookmarks'; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'r'; // type de la permission (d<EFBFBD>pr<EFBFBD>ci<EFBFBD> <20> ce jour)
|
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par d<EFBFBD>faut
|
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'supprimer';
|
$this->rights[$r][4] = 'supprimer';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -134,7 +134,7 @@ class modCron extends DolibarrModules
|
|||||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||||
'type'=>'left', // This is a Left menu entry
|
'type'=>'left', // This is a Left menu entry
|
||||||
'titre'=>'CronList',
|
'titre'=>'CronList',
|
||||||
'url'=>'/cron/list.php?status=-2&leftmenu=admintools',
|
'url'=>'/cron/list.php?leftmenu=admintools',
|
||||||
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||||
'position'=>200,
|
'position'=>200,
|
||||||
'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||||
|
|||||||
@ -188,21 +188,21 @@ class modDav extends DolibarrModules
|
|||||||
$r=0;
|
$r=0;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Read myobject of dav'; // Permission label
|
$this->rights[$r][1] = 'Read myobject of dav'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label
|
$this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Delete myobject of dav'; // Permission label
|
$this->rights[$r][1] = 'Delete myobject of dav'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -185,21 +185,21 @@ class modEmailCollector extends DolibarrModules
|
|||||||
$r=0;
|
$r=0;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Read myobject of dav'; // Permission label
|
$this->rights[$r][1] = 'Read myobject of dav'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label
|
$this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Delete myobject of dav'; // Permission label
|
$this->rights[$r][1] = 'Delete myobject of dav'; // Permission label
|
||||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -150,7 +150,7 @@ class modExpenseReport extends DolibarrModules
|
|||||||
$this->rights[$r][0] = 777;
|
$this->rights[$r][0] = 777;
|
||||||
$this->rights[$r][1] = 'Read expense reports of everybody';
|
$this->rights[$r][1] = 'Read expense reports of everybody';
|
||||||
$this->rights[$r][2] = 'r';
|
$this->rights[$r][2] = 'r';
|
||||||
$this->rights[$r][3] = 1;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'readall';
|
$this->rights[$r][4] = 'readall';
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
|
|||||||
@ -169,6 +169,7 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_permission[$r]=array(array("produit","export"));
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
$this->export_fields_array[$r]=array(
|
$this->export_fields_array[$r]=array(
|
||||||
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",
|
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",
|
||||||
|
'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode",
|
||||||
'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",
|
'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",
|
||||||
'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
|
'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
|
||||||
'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
||||||
@ -184,7 +185,8 @@ class modProduct extends DolibarrModules
|
|||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
||||||
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
|
||||||
$this->export_TypeFields_array[$r]=array(
|
$this->export_TypeFields_array[$r]=array(
|
||||||
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",
|
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
|
||||||
|
'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
|
||||||
'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",
|
'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",
|
||||||
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",
|
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",
|
||||||
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'
|
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'
|
||||||
@ -289,7 +291,8 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_permission[$r]=array(array("produit","export"));
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
$this->export_fields_array[$r]=array(
|
$this->export_fields_array[$r]=array(
|
||||||
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",
|
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",
|
||||||
'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",
|
'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode",
|
||||||
|
'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",
|
||||||
'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode',
|
'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode',
|
||||||
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",
|
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",
|
||||||
'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
||||||
@ -298,7 +301,8 @@ class modProduct extends DolibarrModules
|
|||||||
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
|
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
|
||||||
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty','pa.incdec'=>'ComposedProductIncDecStock'));
|
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty','pa.incdec'=>'ComposedProductIncDecStock'));
|
||||||
$this->export_TypeFields_array[$r]=array(
|
$this->export_TypeFields_array[$r]=array(
|
||||||
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",
|
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
|
||||||
|
'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
|
||||||
'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text',
|
'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text',
|
||||||
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
|
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
|
||||||
'p.datec'=>'Date','p.tms'=>'Date'
|
'p.datec'=>'Date','p.tms'=>'Date'
|
||||||
@ -308,7 +312,8 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
|
$this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
|
||||||
$this->export_entities_array[$r]=array(
|
$this->export_entities_array[$r]=array(
|
||||||
'p.rowid'=>"virtualproduct",'p.ref'=>"virtualproduct",'p.label'=>"virtualproduct",'p.description'=>"virtualproduct",'p.url'=>"virtualproduct",
|
'p.rowid'=>"virtualproduct",'p.ref'=>"virtualproduct",'p.label'=>"virtualproduct",'p.description'=>"virtualproduct",'p.url'=>"virtualproduct",
|
||||||
'p.accountancy_code_sell'=>'virtualproduct','p.accountancy_code_buy'=>'virtualproduct','p.note'=>"virtualproduct",'p.length'=>"virtualproduct",
|
'p.accountancy_code_sell'=>'virtualproduct','p.accountancy_code_sell_intra'=>'virtualproduct','p.accountancy_code_sell_export'=>'virtualproduct',
|
||||||
|
'p.accountancy_code_buy'=>'virtualproduct','p.note'=>"virtualproduct",'p.length'=>"virtualproduct",
|
||||||
'p.surface'=>"virtualproduct",'p.volume'=>"virtualproduct",'p.weight'=>"virtualproduct",'p.customcode'=>'virtualproduct',
|
'p.surface'=>"virtualproduct",'p.volume'=>"virtualproduct",'p.weight'=>"virtualproduct",'p.customcode'=>'virtualproduct',
|
||||||
'p.price_base_type'=>"virtualproduct",'p.price'=>"virtualproduct",'p.price_ttc'=>"virtualproduct",'p.tva_tx'=>"virtualproduct",
|
'p.price_base_type'=>"virtualproduct",'p.price'=>"virtualproduct",'p.price_ttc'=>"virtualproduct",'p.tva_tx'=>"virtualproduct",
|
||||||
'p.tosell'=>"virtualproduct",'p.tobuy'=>"virtualproduct",'p.datec'=>"virtualproduct",'p.tms'=>"virtualproduct"
|
'p.tosell'=>"virtualproduct",'p.tobuy'=>"virtualproduct",'p.datec'=>"virtualproduct",'p.tms'=>"virtualproduct"
|
||||||
@ -492,6 +497,8 @@ class modProduct extends DolibarrModules
|
|||||||
'p.duration' => "eg. 365d/12m/1y",
|
'p.duration' => "eg. 365d/12m/1y",
|
||||||
'p.url' => 'link to product (no https)',
|
'p.url' => 'link to product (no https)',
|
||||||
'p.accountancy_code_sell' => "",
|
'p.accountancy_code_sell' => "",
|
||||||
|
'p.accountancy_code_sell_intra' => "",
|
||||||
|
'p.accountancy_code_sell_export' => "",
|
||||||
'p.accountancy_code_buy' => "",
|
'p.accountancy_code_buy' => "",
|
||||||
'p.weight' => "",
|
'p.weight' => "",
|
||||||
'p.weight_units' => 'use a unit of measure from the dictionary. g/Kg/T etc....matches field "Short Label" for unit type "weight" in table "' . MAIN_DB_PREFIX . 'c_units',
|
'p.weight_units' => 'use a unit of measure from the dictionary. g/Kg/T etc....matches field "Short Label" for unit type "weight" in table "' . MAIN_DB_PREFIX . 'c_units',
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class modTakePos extends DolibarrModules
|
|||||||
$this->descriptionlong = "Point Of Sales (compliant with touch screen)";
|
$this->descriptionlong = "Point Of Sales (compliant with touch screen)";
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = 'experimental';
|
$this->version = 'dolibarr';
|
||||||
// Key used in llx_const table to save module status enabled/disabled (where TAKEPOS is value of property name of module in uppercase)
|
// Key used in llx_const table to save module status enabled/disabled (where TAKEPOS is value of property name of module in uppercase)
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
// Name of image file used for this module.
|
// Name of image file used for this module.
|
||||||
|
|||||||
@ -151,7 +151,7 @@ class modTicket extends DolibarrModules
|
|||||||
$this->rights[$r][0] = 56001; // id de la permission
|
$this->rights[$r][0] = 56001; // id de la permission
|
||||||
$this->rights[$r][1] = "Read ticket"; // libelle de la permission
|
$this->rights[$r][1] = "Read ticket"; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
|
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
|
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'read';
|
$this->rights[$r][4] = 'read';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
|
|||||||
@ -77,10 +77,21 @@ class modWorkflow extends DolibarrModules
|
|||||||
$this->langfiles = array("@workflow");
|
$this->langfiles = array("@workflow");
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
// List of particular constants to add when module is enabled
|
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
||||||
//Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0),
|
// Example: $this->const=array(1 => array('MYMODULE_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1),
|
||||||
// 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) );
|
// 2 => array('MYMODULE_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1)
|
||||||
$this->const=array();
|
// );
|
||||||
|
$this->const=array(
|
||||||
|
//0=>array('WORKFLOW_PROPAL_AUTOCREATE_ORDER', 'chaine', '1', 'WORKFLOW_PROPAL_AUTOCREATE_ORDER', 0, 'current', 0),
|
||||||
|
//0=>array('WORKFLOW_ORDER_AUTOCREATE_INVOICE', 'chaine', '1', 'WORKFLOW_ORDER_AUTOCREATE_INVOICE', 0, 'current', 0),
|
||||||
|
0=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL', 0, 'current', 0),
|
||||||
|
1=>array('WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL', 'chaine', '1', 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL', 0, 'current', 0),
|
||||||
|
2=>array('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING', 0, 'current', 0),
|
||||||
|
4=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 0, 'current', 0),
|
||||||
|
5=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 0, 'current', 0),
|
||||||
|
6=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0),
|
||||||
|
7=>array('WORKFLOW_BILL_ON_RECEPTION', 'chaine', '1', 'WORKFLOW_BILL_ON_RECEPTION', 0, 'current', 0)
|
||||||
|
);
|
||||||
|
|
||||||
// Boxes
|
// Boxes
|
||||||
$this->boxes = array();
|
$this->boxes = array();
|
||||||
|
|||||||
@ -423,15 +423,7 @@ class pdf_standard extends ModelePDFProduct
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -669,15 +661,8 @@ class pdf_standard extends ModelePDFProduct
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
|
|||||||
@ -115,7 +115,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Company object that emits
|
* @var Societe object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -179,6 +179,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->posxtva=110;
|
$this->posxtva=110;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
|
$this->posxunit=162;
|
||||||
}
|
}
|
||||||
$this->posxdiscount=162;
|
$this->posxdiscount=162;
|
||||||
$this->postotalht=174;
|
$this->postotalht=174;
|
||||||
@ -368,14 +369,16 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->atleastonediscount++;
|
$this->atleastonediscount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
|
if (empty($this->atleastonediscount))
|
||||||
{
|
{
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
$delta = ($this->postotalht - $this->posxdiscount);
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
$this->posxpicture+=$delta;
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
$this->posxtva+=$delta;
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
$this->posxup+=$delta;
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
$this->posxqty+=$delta;
|
||||||
//$this->postotalht;
|
$this->posxunit+=$delta;
|
||||||
|
$this->posxdiscount+=$delta;
|
||||||
|
// post of fields after are not modified, stay at same position
|
||||||
}
|
}
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
@ -574,15 +577,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -1395,15 +1390,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
|
|||||||
@ -1863,22 +1863,6 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
'border-left' => true, // add left line separator
|
'border-left' => true, // add left line separator
|
||||||
);
|
);
|
||||||
|
|
||||||
$rank = $rank + 10;
|
|
||||||
$this->cols['progress'] = array(
|
|
||||||
'rank' => $rank,
|
|
||||||
'width' => 19, // in mm
|
|
||||||
'status' => false,
|
|
||||||
'title' => array(
|
|
||||||
'textkey' => 'Progress'
|
|
||||||
),
|
|
||||||
'border-left' => false, // add left line separator
|
|
||||||
);
|
|
||||||
|
|
||||||
if($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$this->cols['progress']['status'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$rank = $rank + 10;
|
$rank = $rank + 10;
|
||||||
$this->cols['unit'] = array(
|
$this->cols['unit'] = array(
|
||||||
'rank' => $rank,
|
'rank' => $rank,
|
||||||
|
|||||||
@ -637,89 +637,11 @@ class pdf_standard extends ModelePDFStock
|
|||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
// VAT Rate
|
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
|
|
||||||
{
|
|
||||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
|
|
||||||
$pdf->SetXY($this->posxtva, $curY);
|
|
||||||
$pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit price before discount
|
|
||||||
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
|
||||||
$pdf->SetXY($this->posxup, $curY);
|
|
||||||
$pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
|
|
||||||
|
|
||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
// Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
|
||||||
$pdf->SetXY($this->posxunit, $curY);
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxunit-0.8, 4, $unit, 0, 'L');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Discount on line
|
|
||||||
$pdf->SetXY($this->posxdiscount, $curY);
|
|
||||||
if ($object->lines[$i]->remise_percent)
|
|
||||||
{
|
|
||||||
$pdf->SetXY($this->posxdiscount-2, $curY);
|
|
||||||
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Total HT line
|
|
||||||
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
|
|
||||||
$pdf->SetXY($this->postotalht, $curY);
|
|
||||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
|
|
||||||
|
|
||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
|
||||||
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
|
|
||||||
else $tvaligne=$object->lines[$i]->total_tva;
|
|
||||||
|
|
||||||
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
|
||||||
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
|
||||||
$localtax1_rate=$object->lines[$i]->localtax1_tx;
|
|
||||||
$localtax2_rate=$object->lines[$i]->localtax2_tx;
|
|
||||||
$localtax1_type=$object->lines[$i]->localtax1_type;
|
|
||||||
$localtax2_type=$object->lines[$i]->localtax2_type;
|
|
||||||
|
|
||||||
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
|
||||||
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
|
||||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
|
||||||
|
|
||||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
|
||||||
|
|
||||||
// Retrieve type from database for backward compatibility with old records
|
|
||||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
|
||||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
|
||||||
{
|
|
||||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc);
|
|
||||||
$localtax1_type = $localtaxtmp_array[0];
|
|
||||||
$localtax2_type = $localtaxtmp_array[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
// retrieve global local tax
|
|
||||||
if ($localtax1_type && $localtax1ligne != 0)
|
|
||||||
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
|
|
||||||
if ($localtax2_type && $localtax2ligne != 0)
|
|
||||||
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
|
||||||
|
|
||||||
// Add line
|
// Add line
|
||||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||||
|
|||||||
@ -153,6 +153,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$this->posxtva=112;
|
$this->posxtva=112;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
|
$this->posxunit=162;
|
||||||
$this->posxdiscount=162;
|
$this->posxdiscount=162;
|
||||||
$this->postotalht=174;
|
$this->postotalht=174;
|
||||||
|
|
||||||
@ -302,14 +303,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$this->atleastonediscount++;
|
$this->atleastonediscount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
|
if (empty($this->atleastonediscount))
|
||||||
{
|
{
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
$delta = ($this->postotalht - $this->posxdiscount);
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
$this->posxpicture+=$delta;
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
$this->posxtva+=$delta;
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
$this->posxup+=$delta;
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
$this->posxqty+=$delta;
|
||||||
//$this->postotalht;
|
$this->posxunit+=$delta;
|
||||||
|
$this->posxdiscount+=$delta;
|
||||||
|
// post of fields after are not modified, stay at same position
|
||||||
}
|
}
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
@ -447,15 +450,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -470,7 +465,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
if ($object->lines[$i]->remise_percent)
|
if ($object->lines[$i]->remise_percent)
|
||||||
{
|
{
|
||||||
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent."%", 0, 'R');
|
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total HT line
|
// Total HT line
|
||||||
@ -892,15 +887,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
|
|||||||
@ -1550,22 +1550,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
'border-left' => true, // add left line separator
|
'border-left' => true, // add left line separator
|
||||||
);
|
);
|
||||||
|
|
||||||
$rank = $rank + 10;
|
|
||||||
$this->cols['progress'] = array(
|
|
||||||
'rank' => $rank,
|
|
||||||
'width' => 19, // in mm
|
|
||||||
'status' => false,
|
|
||||||
'title' => array(
|
|
||||||
'textkey' => 'Progress'
|
|
||||||
),
|
|
||||||
'border-left' => false, // add left line separator
|
|
||||||
);
|
|
||||||
|
|
||||||
if($this->situationinvoice)
|
|
||||||
{
|
|
||||||
$this->cols['progress']['status'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$rank = $rank + 10;
|
$rank = $rank + 10;
|
||||||
$this->cols['unit'] = array(
|
$this->cols['unit'] = array(
|
||||||
'rank' => $rank,
|
'rank' => $rank,
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Company object that emits
|
* @var Societe object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
|
|
||||||
// Defini position des colonnes
|
// Define position of columns
|
||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
$this->posxdiscount=162;
|
$this->posxdiscount=162;
|
||||||
$this->postotalht=174;
|
$this->postotalht=174;
|
||||||
@ -174,6 +174,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->posxtva=110;
|
$this->posxtva=110;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
|
$this->posxunit=162;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference
|
||||||
@ -350,14 +351,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->atleastonediscount++;
|
$this->atleastonediscount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
|
if (empty($this->atleastonediscount))
|
||||||
{
|
{
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
$delta = ($this->postotalht - $this->posxdiscount);
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
$this->posxpicture+=$delta;
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
$this->posxtva+=$delta;
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
$this->posxup+=$delta;
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
$this->posxqty+=$delta;
|
||||||
//$this->postotalht;
|
$this->posxunit+=$delta;
|
||||||
|
$this->posxdiscount+=$delta;
|
||||||
|
// post of fields after are not modified, stay at same position
|
||||||
}
|
}
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
@ -526,15 +529,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -1077,22 +1072,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
if (empty($hidetop)) {
|
if (empty($hidetop)) {
|
||||||
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
||||||
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
|
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
|
||||||
'C');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1310,10 +1297,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||||
|
|
||||||
|
|
||||||
|
// If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER'
|
||||||
// If BILLING contact defined on order, we use it
|
|
||||||
$usecontact=false;
|
$usecontact=false;
|
||||||
$arrayidcontact=$object->getIdContact('external', 'BILLING');
|
$arrayidcontact=$object->getIdContact('external', 'CUSTOMER');
|
||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$usecontact=true;
|
$usecontact=true;
|
||||||
|
|||||||
@ -171,6 +171,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$this->posxtva=102;
|
$this->posxtva=102;
|
||||||
$this->posxup=126;
|
$this->posxup=126;
|
||||||
$this->posxqty=145;
|
$this->posxqty=145;
|
||||||
|
$this->posxunit=162;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva;
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva;
|
||||||
@ -339,14 +340,16 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$this->atleastonediscount++;
|
$this->atleastonediscount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
|
if (empty($this->atleastonediscount))
|
||||||
{
|
{
|
||||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
$delta = ($this->postotalht - $this->posxdiscount);
|
||||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
$this->posxpicture+=$delta;
|
||||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
$this->posxtva+=$delta;
|
||||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
$this->posxup+=$delta;
|
||||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
$this->posxqty+=$delta;
|
||||||
//$this->postotalht;
|
$this->posxunit+=$delta;
|
||||||
|
$this->posxdiscount+=$delta;
|
||||||
|
// post of fields after are not modified, stay at same position
|
||||||
}
|
}
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
@ -519,15 +522,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
// Quantity
|
// Quantity
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 3, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -1236,22 +1231,14 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
|
||||||
if (empty($hidetop)) {
|
if (empty($hidetop)) {
|
||||||
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
|
||||||
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
|
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
|
||||||
'C');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -210,10 +210,55 @@ if ($action == 'presend')
|
|||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters);
|
complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters);
|
||||||
|
|
||||||
// Find the good contact adress
|
// Find the good contact address
|
||||||
|
$tmpobject = $object;
|
||||||
|
if (($object->element == 'shipping'|| $object->element == 'reception')) {
|
||||||
|
$origin = $object->origin;
|
||||||
|
$origin_id = $object->origin_id;
|
||||||
|
|
||||||
|
if (!empty($origin) && !empty($origin_id)) {
|
||||||
|
$element = $subelement = $origin;
|
||||||
|
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||||
|
$element = $regs[1];
|
||||||
|
$subelement = $regs[2];
|
||||||
|
}
|
||||||
|
// For compatibility
|
||||||
|
if ($element == 'order') {
|
||||||
|
$element = $subelement = 'commande';
|
||||||
|
}
|
||||||
|
if ($element == 'propal') {
|
||||||
|
$element = 'comm/propal';
|
||||||
|
$subelement = 'propal';
|
||||||
|
}
|
||||||
|
if ($element == 'contract') {
|
||||||
|
$element = $subelement = 'contrat';
|
||||||
|
}
|
||||||
|
if ($element == 'inter') {
|
||||||
|
$element = $subelement = 'ficheinter';
|
||||||
|
}
|
||||||
|
if ($element == 'shipping') {
|
||||||
|
$element = $subelement = 'expedition';
|
||||||
|
}
|
||||||
|
if ($element == 'order_supplier') {
|
||||||
|
$element = 'fourn';
|
||||||
|
$subelement = 'fournisseur.commande';
|
||||||
|
}
|
||||||
|
if ($element == 'project') {
|
||||||
|
$element = 'projet';
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
|
||||||
|
$classname = ucfirst($origin);
|
||||||
|
$objectsrc = new $classname($db);
|
||||||
|
$objectsrc->fetch($origin_id);
|
||||||
|
|
||||||
|
$tmpobject = $objectsrc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$custcontact = '';
|
$custcontact = '';
|
||||||
$contactarr = array();
|
$contactarr = array();
|
||||||
$contactarr = $object->liste_contact(- 1, 'external');
|
$contactarr = $tmpobject->liste_contact(- 1, 'external');
|
||||||
|
|
||||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||||
|
|||||||
@ -70,7 +70,7 @@ $colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normal
|
|||||||
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||||
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
|
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
|
||||||
?>
|
?>
|
||||||
<body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
|
<body class="body bodylogin" style="background-image: url('<?php echo dol_escape_htmltag($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND); ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -112,7 +112,8 @@ if ($massaction == 'presend')
|
|||||||
$formmail->withtoreadonly = 1;
|
$formmail->withtoreadonly = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1);
|
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1);
|
||||||
|
|
||||||
$formmail->withto = empty($liste)?(GETPOST('sendto', 'alpha')?GETPOST('sendto', 'alpha'):array()):$liste;
|
$formmail->withto = empty($liste)?(GETPOST('sendto', 'alpha')?GETPOST('sendto', 'alpha'):array()):$liste;
|
||||||
$formmail->withtofree = empty($liste)?1:0;
|
$formmail->withtofree = empty($liste)?1:0;
|
||||||
$formmail->withtocc = 1;
|
$formmail->withtocc = 1;
|
||||||
|
|||||||
@ -783,6 +783,35 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
}
|
}
|
||||||
|
elseif($action == 'TICKET_ASSIGNED')
|
||||||
|
{
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("agenda","other","projects"));
|
||||||
|
|
||||||
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TICKET_ASSIGNEDInDolibarr", $object->ref);
|
||||||
|
$object->actionmsg=$langs->transnoentities("TICKET_ASSIGNEDInDolibarr", $object->ref);
|
||||||
|
if ($object->oldcopy->fk_user_assign > 0)
|
||||||
|
{
|
||||||
|
$tmpuser=new User($this->db);
|
||||||
|
$tmpuser->fetch($object->oldcopy->fk_user_assign);
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("OldUser").': '.$langs->trans("None");
|
||||||
|
}
|
||||||
|
if ($object->fk_user_assign > 0)
|
||||||
|
{
|
||||||
|
$tmpuser=new User($this->db);
|
||||||
|
$tmpuser->fetch($object->fk_user_assign);
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("NewUser").': '.$tmpuser->getFullName($langs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("NewUser").': '.$langs->trans("None");
|
||||||
|
}
|
||||||
|
$object->sendtoid=0;
|
||||||
|
}
|
||||||
// TODO Merge all previous cases into this generic one
|
// TODO Merge all previous cases into this generic one
|
||||||
else // $action = TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ...
|
else // $action = TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ...
|
||||||
{
|
{
|
||||||
|
|||||||
@ -121,6 +121,8 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
$res = $userstat->fetch($object->fk_user_assign);
|
$res = $userstat->fetch($object->fk_user_assign);
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
{
|
{
|
||||||
|
// Send email to notification email
|
||||||
|
|
||||||
if (empty($conf->global->TICKET_DISABLE_ALL_MAILS))
|
if (empty($conf->global->TICKET_DISABLE_ALL_MAILS))
|
||||||
{
|
{
|
||||||
// Init to avoid errors
|
// Init to avoid errors
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if (!empty($cancel))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2');
|
header("Location: ".DOL_URL_ROOT.'/cron/list.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2');
|
Header("Location: ".DOL_URL_ROOT.'/cron/list.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -557,7 +557,7 @@ else
|
|||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("CronTask"), -1, 'cron');
|
dol_fiche_head($head, 'card', $langs->trans("CronTask"), -1, 'cron');
|
||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?status=-2&restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|||||||
@ -50,7 +50,7 @@ $head = cron_prepare_head($object);
|
|||||||
|
|
||||||
dol_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron');
|
dol_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron');
|
||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?status=-2&restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/cron/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|||||||
@ -56,7 +56,6 @@ if (! $sortfield) $sortfield='t.status,t.priority';
|
|||||||
if (! $sortorder) $sortorder='DESC,ASC';
|
if (! $sortorder) $sortorder='DESC,ASC';
|
||||||
|
|
||||||
$search_status=GETPOST('search_status', 'int')?GETPOST('search_status', 'int'):GETPOST('status', 'int');
|
$search_status=GETPOST('search_status', 'int')?GETPOST('search_status', 'int'):GETPOST('status', 'int');
|
||||||
if ($search_status == '') $search_status=-2;
|
|
||||||
|
|
||||||
//Search criteria
|
//Search criteria
|
||||||
$search_label=GETPOST("search_label", 'alpha');
|
$search_label=GETPOST("search_label", 'alpha');
|
||||||
@ -253,7 +252,6 @@ $sql.= " t.test";
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t";
|
||||||
$sql.= " WHERE entity IN (0,".$conf->entity.")";
|
$sql.= " WHERE entity IN (0,".$conf->entity.")";
|
||||||
if ($search_status >= 0 && $search_status < 2) $sql.= " AND t.status = ".(empty($search_status)?'0':'1');
|
if ($search_status >= 0 && $search_status < 2) $sql.= " AND t.status = ".(empty($search_status)?'0':'1');
|
||||||
if ($search_status == 2) $sql.= " AND t.status = 2";
|
|
||||||
//Manage filter
|
//Manage filter
|
||||||
if (is_array($filter) && count($filter)>0) {
|
if (is_array($filter) && count($filter)>0) {
|
||||||
foreach($filter as $key => $value) {
|
foreach($filter as $key => $value) {
|
||||||
@ -299,11 +297,11 @@ $num = $db->num_rows($result);
|
|||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
if ($search_status) $param.='&search_status='.$search_status;
|
if ($search_status) $param.='&search_status='.urlencode($search_status);
|
||||||
if ($search_label) $param.='&search_label='.$search_label;
|
if ($search_label) $param.='&search_label='.urlencode($search_label);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
@ -393,7 +391,7 @@ print '<td class="liste_titre"> </td>';
|
|||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled"), '-2'=>$langs->trans("EnabledAndDisabled"), '2'=>$langs->trans("Archived")), $search_status, 1);
|
print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled")), $search_status, 1);
|
||||||
print '</td><td class="liste_titre right">';
|
print '</td><td class="liste_titre right">';
|
||||||
$searchpicto=$form->showFilterButtons();
|
$searchpicto=$form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
|
|||||||
@ -14,6 +14,9 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* You can test with the WebDav client cadaver:
|
||||||
|
* cadaver http://myurl/dav/fileserver.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,8 +61,9 @@ $entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : (!empty($conf->
|
|||||||
$publicDir = $conf->dav->multidir_output[$entity].'/public';
|
$publicDir = $conf->dav->multidir_output[$entity].'/public';
|
||||||
$privateDir = $conf->dav->multidir_output[$entity].'/private';
|
$privateDir = $conf->dav->multidir_output[$entity].'/private';
|
||||||
$ecmDir = $conf->ecm->multidir_output[$entity];
|
$ecmDir = $conf->ecm->multidir_output[$entity];
|
||||||
$tmpDir = $conf->dav->multidir_temp[$entity];
|
$tmpDir = $conf->dav->multidir_output[$entity]; // We need root dir, not a dir that can be deleted
|
||||||
//var_dump($tmpDir);exit;
|
//var_dump($tmpDir);mkdir($tmpDir);exit;
|
||||||
|
|
||||||
|
|
||||||
// Authentication callback function
|
// Authentication callback function
|
||||||
$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) {
|
$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) {
|
||||||
@ -152,8 +156,11 @@ $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend);
|
|||||||
$server->addPlugin($lockPlugin);
|
$server->addPlugin($lockPlugin);
|
||||||
|
|
||||||
// Support for html frontend
|
// Support for html frontend
|
||||||
$browser = new \Sabre\DAV\Browser\Plugin();
|
if (empty($conf->global->DAV_DISABLE_BROWSER))
|
||||||
$server->addPlugin($browser);
|
{
|
||||||
|
$browser = new \Sabre\DAV\Browser\Plugin();
|
||||||
|
$server->addPlugin($browser);
|
||||||
|
}
|
||||||
|
|
||||||
// Automatically guess (some) contenttypes, based on extension
|
// Automatically guess (some) contenttypes, based on extension
|
||||||
//$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
|
//$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
|
||||||
|
|||||||
@ -441,7 +441,7 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
setEventMessages($langs->trans($object->error), $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -757,7 +757,7 @@ class Expedition extends CommonObject
|
|||||||
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref));
|
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[]=$mouvS->error;
|
$this->error = $mouvS->error;
|
||||||
$this->errors = array_merge($this->errors, $mouvS->errors);
|
$this->errors = array_merge($this->errors, $mouvS->errors);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -771,7 +771,7 @@ class Expedition extends CommonObject
|
|||||||
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
|
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[]=$mouvS->error;
|
$this->error = $mouvS->error;
|
||||||
$this->errors = array_merge($this->errors, $mouvS->errors);
|
$this->errors = array_merge($this->errors, $mouvS->errors);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -851,11 +851,6 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($this->errors as $errmsg)
|
|
||||||
{
|
|
||||||
dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR);
|
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
|
||||||
}
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1*$error;
|
return -1*$error;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2019 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
|
||||||
* 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
|
||||||
@ -69,7 +70,7 @@ if (!$sortfield) $sortfield="d.date_debut";
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||||
$search_ref = GETPOST('search_ref');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_user = GETPOST('search_user', 'int');
|
$search_user = GETPOST('search_user', 'int');
|
||||||
$search_amount_ht = GETPOST('search_amount_ht', 'alpha');
|
$search_amount_ht = GETPOST('search_amount_ht', 'alpha');
|
||||||
$search_amount_vat = GETPOST('search_amount_vat', 'alpha');
|
$search_amount_vat = GETPOST('search_amount_vat', 'alpha');
|
||||||
@ -340,9 +341,9 @@ if ($resql)
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($user->rights->expensereport->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->expensereport->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
|
|||||||
@ -305,9 +305,9 @@ if ($resql)
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($user->rights->ficheinter->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->ficheinter->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||||
if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||||
|
|
||||||
if (! defined('EURO')) define('EURO', chr(128));
|
if (! defined('EURO')) define('EURO', chr(128));
|
||||||
|
|
||||||
|
|||||||
@ -264,7 +264,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= " c.note_private, c.note_public, c.model_pdf, c.extraparams, c.billed,";
|
$sql.= " c.note_private, c.note_public, c.model_pdf, c.extraparams, c.billed,";
|
||||||
$sql.= " c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc,";
|
$sql.= " c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc,";
|
||||||
$sql.= " cm.libelle as methode_commande,";
|
$sql.= " cm.libelle as methode_commande,";
|
||||||
$sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle,";
|
$sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc,";
|
||||||
$sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle";
|
$sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle";
|
||||||
$sql.= ', c.fk_incoterms, c.location_incoterms';
|
$sql.= ', c.fk_incoterms, c.location_incoterms';
|
||||||
$sql.= ', i.libelle as libelle_incoterms';
|
$sql.= ', i.libelle as libelle_incoterms';
|
||||||
@ -322,7 +322,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->cond_reglement_id = $obj->fk_cond_reglement;
|
$this->cond_reglement_id = $obj->fk_cond_reglement;
|
||||||
$this->cond_reglement_code = $obj->cond_reglement_code;
|
$this->cond_reglement_code = $obj->cond_reglement_code;
|
||||||
$this->cond_reglement = $obj->cond_reglement_libelle;
|
$this->cond_reglement = $obj->cond_reglement_libelle;
|
||||||
$this->cond_reglement_doc = $obj->cond_reglement_libelle;
|
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
|
||||||
$this->fk_account = $obj->fk_account;
|
$this->fk_account = $obj->fk_account;
|
||||||
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
||||||
$this->mode_reglement_code = $obj->mode_reglement_code;
|
$this->mode_reglement_code = $obj->mode_reglement_code;
|
||||||
@ -2639,6 +2639,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::initAsSpecimen");
|
dol_syslog(get_class($this)."::initAsSpecimen");
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|||||||
@ -1474,8 +1474,6 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@ -1492,11 +1490,11 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
|
|
||||||
if ($this->statut == self::STATUS_DRAFT)
|
if ($this->statut == self::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING);
|
dol_syslog(__METHOD__." already draft status", LOG_WARNING);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -1958,7 +1958,7 @@ elseif (! empty($object->id))
|
|||||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>';
|
||||||
if ($object->date_commande)
|
if ($object->date_commande)
|
||||||
{
|
{
|
||||||
print dol_print_date($object->date_commande, "dayhourtext")."\n";
|
print dol_print_date($object->date_commande, "dayhour")."\n";
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
|||||||
@ -414,13 +414,13 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if ($object->methode_commande_id > 0) {
|
if ($object->methode_commande_id > 0) {
|
||||||
print '<tr><td class="titlefield">' . $langs->trans("Date") . '</td><td>';
|
print '<tr><td class="titlefield">' . $langs->trans("Date") . '</td><td>';
|
||||||
if ($object->date_commande) {
|
if ($object->date_commande) {
|
||||||
print dol_print_date($object->date_commande, "dayhourtext") . "\n";
|
print dol_print_date($object->date_commande, "dayhour") . "\n";
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
|
|
||||||
// Line of orders
|
// Line of orders
|
||||||
if ($object->statut <= CommandeFournisseur::STATUS_ACCEPTED || $object->statut >= CommandeFournisseur::STATUS_CANCELED) {
|
if ($object->statut <= CommandeFournisseur::STATUS_ACCEPTED || $object->statut >= CommandeFournisseur::STATUS_CANCELED) {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("OrderStatusNotReadyToDispatch").'</span>';
|
print '<br><span class="opacitymedium">'.$langs->trans("OrderStatusNotReadyToDispatch").'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->statut == CommandeFournisseur::STATUS_ORDERSENT
|
if ($object->statut == CommandeFournisseur::STATUS_ORDERSENT
|
||||||
@ -714,13 +714,12 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
if ($nbproduct)
|
if ($nbproduct)
|
||||||
{
|
{
|
||||||
$checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
|
$checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print '<div class="center">';
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
// modified by hook
|
// modified by hook
|
||||||
@ -737,7 +736,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
}
|
}
|
||||||
empty($conf->reception->enabled)?$dispatchBt=$langs->trans("DispatchVerb"):$dispatchBt=$langs->trans("Receive");
|
empty($conf->reception->enabled)?$dispatchBt=$langs->trans("DispatchVerb"):$dispatchBt=$langs->trans("Receive");
|
||||||
|
|
||||||
print '<br><input type="submit" class="button" value="' . $dispatchBt. '"';
|
print '<br><input type="submit" class="button" name="dispatch" value="' . dol_escape_htmltag($dispatchBt). '"';
|
||||||
if (count($listwarehouses) <= 0)
|
if (count($listwarehouses) <= 0)
|
||||||
print ' disabled';
|
print ' disabled';
|
||||||
print '>';
|
print '>';
|
||||||
@ -747,6 +746,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
|
|
||||||
// Message if nothing to dispatch
|
// Message if nothing to dispatch
|
||||||
if (! $nbproduct) {
|
if (! $nbproduct) {
|
||||||
|
print "<br>\n";
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
|
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
|
||||||
print '<div class="opacitymedium">'.$langs->trans("NoPredefinedProductToDispatch").'</div>'; // No predefined line at all
|
print '<div class="opacitymedium">'.$langs->trans("NoPredefinedProductToDispatch").'</div>'; // No predefined line at all
|
||||||
else
|
else
|
||||||
|
|||||||
@ -620,9 +620,9 @@ if ($resql)
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
//if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
//if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
if ($user->rights->fournisseur->commande->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->fournisseur->commande->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
|
|||||||
@ -454,9 +454,9 @@ if ($resql)
|
|||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'validate'=>$langs->trans("Validate"),
|
'validate'=>$langs->trans("Validate"),
|
||||||
'generate_doc'=>$langs->trans("Generate"),
|
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
//if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
//if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
if ($user->rights->fournisseur->facture->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
if ($user->rights->fournisseur->facture->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||||
|
|||||||
@ -251,21 +251,32 @@ if (empty($reshook))
|
|||||||
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||||
|
|
||||||
// Clean parameters amount if payment is for a credit note
|
// Clean parameters amount if payment is for a credit note
|
||||||
if (GETPOST('type', 'int') == FactureFournisseur::TYPE_CREDIT_NOTE)
|
foreach ($amounts as $key => $value) // How payment is dispatched
|
||||||
{
|
{
|
||||||
foreach ($amounts as $key => $value) // How payment is dispatch
|
$tmpinvoice = new FactureFournisseur($db);
|
||||||
|
$tmpinvoice->fetch($key);
|
||||||
|
if ($tmpinvoice->type == FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
$newvalue = price2num($value, 'MT');
|
$newvalue = price2num($value, 'MT');
|
||||||
$amounts[$key] = -$newvalue;
|
$amounts[$key] = - abs($newvalue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch
|
foreach ($multicurrency_amounts as $key => $value) // How payment is dispatched
|
||||||
|
{
|
||||||
|
$tmpinvoice = new FactureFournisseur($db);
|
||||||
|
$tmpinvoice->fetch($key);
|
||||||
|
if ($tmpinvoice->type == FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
$newvalue = price2num($value, 'MT');
|
$newvalue = price2num($value, 'MT');
|
||||||
$multicurrency_amounts[$key] = -$newvalue;
|
$multicurrency_amounts[$key] = - abs($newvalue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//var_dump($amounts);
|
||||||
|
//var_dump($multicurrency_amounts);
|
||||||
|
//exit;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -491,26 +502,35 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Autres factures impayees
|
* All unpayed supplier invoices
|
||||||
*/
|
*/
|
||||||
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef as df,';
|
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.type, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef as df, f.date_lim_reglement as dlr,';
|
||||||
$sql.= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am, f.date_lim_reglement as dlr';
|
$sql.= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
||||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
$sql.= ' AND f.fk_soc = '.$object->socid;
|
$sql.= ' AND f.fk_soc = '.$object->socid;
|
||||||
$sql.= ' AND f.paye = 0';
|
$sql.= ' AND f.paye = 0';
|
||||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
||||||
$sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef, f.date_lim_reglement';
|
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||||
|
{
|
||||||
|
$sql .= ' AND f.type IN (0,1,3,5)'; // Standard invoice, replacement, deposit, situation
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql .= ' AND f.type = 2'; // If paying back a credit note, we show all credit notes
|
||||||
|
}
|
||||||
|
// Group by because we have a total
|
||||||
|
$sql.= ' GROUP BY f.datef, f.ref, f.ref_supplier, f.rowid, f.type, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef, f.date_lim_reglement';
|
||||||
|
// Sort invoices by date and serial number: the older one comes first
|
||||||
|
$sql.= ' ORDER BY f.datef ASC, f.ref ASC';
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$sign=1;
|
|
||||||
if ($object->type == 2) $sign=-1;
|
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -551,8 +571,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$sign=1;
|
||||||
|
if ($objp->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign=-1;
|
||||||
|
|
||||||
$invoice=new FactureFournisseur($db);
|
$invoice=new FactureFournisseur($db);
|
||||||
$invoice->fetch($objp->facid);
|
$invoice->fetch($objp->facid);
|
||||||
|
|
||||||
|
$invoicesupplierstatic->ref=$objp->ref;
|
||||||
|
$invoicesupplierstatic->id=$objp->facid;
|
||||||
|
|
||||||
$paiement = $invoice->getSommePaiement();
|
$paiement = $invoice->getSommePaiement();
|
||||||
$creditnotes=$invoice->getSumCreditNotesUsed();
|
$creditnotes=$invoice->getSumCreditNotesUsed();
|
||||||
$deposits=$invoice->getSumDepositsUsed();
|
$deposits=$invoice->getSumDepositsUsed();
|
||||||
@ -572,9 +599,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td>';
|
print '<td class="nowraponall">';
|
||||||
$invoicesupplierstatic->ref=$objp->ref;
|
|
||||||
$invoicesupplierstatic->id=$objp->facid;
|
|
||||||
print $invoicesupplierstatic->getNomUrl(1);
|
print $invoicesupplierstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -582,7 +607,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
print '<td>'.$objp->ref_supplier.'</td>';
|
print '<td>'.$objp->ref_supplier.'</td>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if ($objp->df > 0 )
|
if ($objp->df > 0)
|
||||||
{
|
{
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print dol_print_date($db->jdate($objp->df), 'day').'</td>';
|
print dol_print_date($db->jdate($objp->df), 'day').'</td>';
|
||||||
@ -593,7 +618,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Date Max Payment
|
// Date Max Payment
|
||||||
if ($objp->dlr > 0 )
|
if ($objp->dlr > 0)
|
||||||
{
|
{
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||||
@ -648,7 +673,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
print '<td class="right">'.price($sign * $remaintopay).'</td>';
|
print '<td class="right">'.price($sign * $remaintopay).'</td>';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<td class="center">';
|
print '<td class="center nowraponall">';
|
||||||
|
|
||||||
$namef = 'amount_'.$objp->facid;
|
$namef = 'amount_'.$objp->facid;
|
||||||
$nameRemain = 'remain_'.$objp->facid;
|
$nameRemain = 'remain_'.$objp->facid;
|
||||||
@ -711,12 +736,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||||
print '<td class="right"><b>'.price($total_ttc).'</b></td>';
|
print '<td class="right"><b>'.price($sign * $total_ttc).'</b></td>';
|
||||||
print '<td class="right"><b>'.price($totalrecu);
|
print '<td class="right"><b>'.price($sign * $totalrecu);
|
||||||
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
|
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
|
||||||
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
|
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
|
||||||
print '</b></td>';
|
print '</b></td>';
|
||||||
print '<td class="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
print '<td class="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||||
print '<td class="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
print '<td class="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
if (!empty($conf->multicurrency->enabled)) print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user