Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Florian HENRY 2015-02-19 10:09:38 +01:00
commit 99153915dc
1282 changed files with 26503 additions and 5882 deletions

View File

@ -236,24 +236,12 @@ source_file = htdocs/langs/en_US/paypal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printgcp]
file_filter = htdocs/langs/<lang>/printgcp.lang
source_file = htdocs/langs/en_US/printgcp.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printing]
file_filter = htdocs/langs/<lang>/printing.lang
source_file = htdocs/langs/en_US/printing.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printipp]
file_filter = htdocs/langs/<lang>/printipp.lang
source_file = htdocs/langs/en_US/printipp.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.productbatch]
file_filter = htdocs/langs/<lang>/productbatch.lang
source_file = htdocs/langs/en_US/productbatch.lang

View File

@ -47,9 +47,9 @@ Long description (Can span accross multiple lines).
Where KEYWORD is one of:
- void: don't put a keyword if the commit is not introducing feature or closing a bug.
- NEW: for new features (May be followed by the task number i.e: #123)
- FIXED: for bug fixes (May be followed by the bug number i.e: #456)
- "FIXED:" for bug fixes (May be followed by the bug number i.e: #456)
- "NEW:" for new features (May be followed by the task number i.e: #123)
- void, don't put a keyword if the commit is not introducing feature or closing a bug.
### Resources
[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)

View File

@ -13,6 +13,7 @@ Component Version License GPL Compatible
-------------------------------------------------------------------------------------
PHP libraries:
AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package)
ChromePHP 4.3.3 Apache Software License 2.0 Yes Return server log to chrome browser console
CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management
FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management
@ -20,6 +21,7 @@ GeoIP 1.4 LGPL-2.1+ Yes
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.6 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
TCPDF 6.0.093 LGPL-3+ Yes PDF generation
@ -53,7 +55,10 @@ Copyright
---------
Copyright (C) 2015
- Laurent Destailleur <eldy@users.sourceforge.net>
- Marcos García <marcosgdf@gmail.com>
- Alexandre Spangaro <alexandre.spangaro@gmail.com>
- Frederic France <frederic.france@free.fr>
Copyright (C) 2014
- Laurent Destailleur <eldy@users.sourceforge.net>
@ -66,6 +71,7 @@ Copyright (C) 2014
- Maxime Kohlhaas <mko@atm-consulting.fr>
- Juanjo Menent <jmenent@2byte.es>
- Alexandre Spangaro <alexandre.spangaro@gmail.com>
- Frederic France <frederic.france@free.fr>
Copyright (C) 2013
- Christophe Battarel <christophe.battarel@altairis.fr>

View File

@ -8,6 +8,7 @@ For users:
- New: Add check list from table for extrafield type
- New: Use new combobox.
- New: Add hidden option MAXTABS_IN_CARD.
- New: A default label is suggested for stock correction and transfer instead of empty string.
- Fix / Improve : [ bug #1747 ] Remove creation of batch 'Undefined'
- Add Weighted average price as default price for buying price for margin calculation. Add option
MARGIN_PMP_AS_DEFAULT_BUY_PRICE to replace with first supplier price.
@ -107,6 +108,8 @@ For users:
- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export.
- New : Option on extrafields to have them always editable regardless of the document status.
- New : New module PrintIPP to print without opening document is available as stable.
- New : Introduce hidden option STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS to solve at no risk
a missing control on missing warehouse.
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
@ -128,6 +131,7 @@ For users:
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
- Fix: datepicker first day of week can be monday by setting into display setup
- Fix: [ bug #575 ] GED doesn't works if there is "/" in a mask
- Fix: [ task #1728 ] Deactivate RIB suggest in proposals / invoices / orders
For users, new experimental module (need to set feature level of instance to experimental to see them):
- New: Module Accounting Expert to manage accountancy
@ -194,29 +198,37 @@ Dolibarr better:
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service
- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid.
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
- Fix: amarok is a bugged theme making dolidroid failed. We switch to eldy automatically with dolidroid.
- Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
- Fix: withdrawal create error if in the same month are deleted previous withdrawals.
- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database
- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects
- Fix: [ bug #1804 ] SQL error when sending email without addresee
- Fix: [ bug #1804 ] SQL error when sending email without address
- Fix: [ bug #1803 ] AJAX company contact input is not aligned
- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook
- Fix: [ bug #1796 ] Unable to use numeration modules from an external module
- Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON
- Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount
- Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme
- Fix: Tracking number not visible on shipment pdf
- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL database
- Fix: [ bug #1819 ] SQL error when searching for an invoice payment
- Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes
- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL
- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object
- Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php
- Fix: [ bug #1830 ] Salaries payment only allows checking accounts
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
- Fix: bug 1588 : relative discount.
- Fix: label of input method not tranlated.
- Fix: box of customer and propsects were not correctly disabled.
- Fix: label of input method not translated.
- Fix: box of customer and prospects were not correctly disabled.
- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
- Fix: Civility & birthdate wasn't save into adherent module.
- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
- Fix: webservice Thirdparty parameter lastname for individual creation is now lastname and not ref
- Fix: Chars - is no more allowed into value for code for extra fields.
- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state
@ -244,14 +256,14 @@ For users:
- Fix: Iban was used instead of Bic into SEPA file.
- Fix: Must unaccent strings into SEPA file.
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
- Fix: cents for indian ruppes are calle paisa and paise.
- Fix: cents for indian ruppes are called paisa and paise.
- Fix: Invoices payments may be older than invoices.
- Fix: Withdrawal total amount is double
- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line
- Fix: Web service categorie WDSL declaration is correct
- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined
- Fix: Category creation failed and no message output
- Fix: Lanf for Payment Type
- Fix: Lang for Payment Type
- Fix: PHPCheckstyle 1.5.5
***** ChangeLog for 3.6 compared to 3.5.* *****
@ -273,12 +285,12 @@ For users:
- New: Improved Opensurvey module:
Added options to disable comments and disable public votes.
Limit dates use calendar popup.
Description of survey use wysiwig editor.
Description of survey use wysiwyg editor.
More information shown on result tab.
Renamed "survey" into "poll" (better translation).
- New: Add filter on text and status into survey list. Can also sort on id, text and date end.
- New: The box "balance of bank accounts" show all opened accounts.
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale represnative into public
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale representative into public
note of generated documents.
- New: Add warning if supplier payment is higher that due amount.
- New: Increase length of url into bookmark module.
@ -291,7 +303,7 @@ For users:
- New: Add barcode fields into user database.
- New: Add manager name (ceo, director, president...) into main company information page.
- New: Add field url as product properties.
- New: More options to create a credit note (can be filled autatically according to remain to pay).
- New: More options to create a credit note (can be filled automatically according to remain to pay).
- New: Can define custom fields for categories.
- New: Prepare generation of SEPA files into module withdrawal.
- New: [ task #1164 ] Add "Ref. supplier" search box in supplier orders
@ -308,7 +320,7 @@ For users:
- New: [ task #926 ] Add extrafield feature on order lines.
- New: [ task #927 ] Add extrafield feature on Proposal lines.
- New: [ task #928 ] Add extrafield feature on invoice lines.
- New: Paypal/paybox email sent after backcall of a payment is now a formated and translated
- New: Paypal/paybox email sent after backcall of a payment is now a formatted and translated
HTML content. For member subscription renewal, there is also a link to member.
- New: When a subscription is recorded with invoice and payment:
- the document (PDF) of invoice is also generated.
@ -364,11 +376,11 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable
default standard behaviour.
- Properties "civilite_id" were renamed into "civility_id".
- Remove add_photo_web() that is ot used anymore by core code.
- Remove add_photo_web() that is not used anymore by core code.
***** ChangeLog for 3.5.7 compared to 3.5.6 *****
Fix: Paypal link were broken dur to SSL v3 closed.
Fix: Paypal link were broken due to SSL v3 closed.
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
Fix: [ bug #1757 ] Sorting breaks product/service statistics
@ -387,7 +399,7 @@ Fix: Bad days and month reported by function.
Fix: Bad margin calculation.
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: Holiday module was broken. Initialization of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: Fusion PDF button on unpaid invoice is no more displayed.
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click).
@ -422,7 +434,7 @@ Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender.
Fix: Question about warehouse must not be done when module stock is disabled.
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
(missing test at some places).
Fix: Renaming a project with uplaoded files failed.
Fix: Renaming a project with uploaded files failed.
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
@ -443,7 +455,7 @@ Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and
Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler.
Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order.
Fix: [ bug #1454 ] Mention de bas de page erroné
Fix: Do not display dictionnay for non activated module
Fix: Do not display dictionary for non activated module
Fix: Link element from element project pages
Fix: [ bug #1509 ] Expedition admin free text & watermark submit error
Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card

View File

@ -951,6 +951,8 @@ if ($nboftargetok) {
print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n";
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
print "Check that in your Wine setup, you create a Z: drive that point to your /tmp directory.\n";
$SOURCEBACK=$SOURCE;
$SOURCEBACK =~ s/\//\\/g;
@ -958,7 +960,7 @@ if ($nboftargetok) {
$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n";
$cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
$cmd= "ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
print "$cmd\n";
$ret= `$cmd`;
#print "$ret\n";

View File

@ -190,7 +190,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -270,7 +270,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -187,7 +187,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -198,7 +198,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -184,149 +184,35 @@
<rule ref="PEAR.Commenting.ClassComment" />
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
<rule ref="PEAR.Commenting.ClassComment.Missing" />
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn" />
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" />
<rule ref="PEAR.Commenting.FunctionComment.Missing" />
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag" />
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
<rule ref="PEAR.Commenting.ClassComment.Missing" />
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn" />
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" />
<rule ref="PEAR.Commenting.FunctionComment.Missing" />
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
>>>>>>> refs/remotes/origin/3.7
<!--
<rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
@ -339,15 +225,40 @@
<severity>0</severity>
</rule>
-->
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.Empty">
<severity>5</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity>
</rule>

View File

@ -57,7 +57,7 @@ class modMyModule extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Description of module MyModule";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = '1.0';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
@ -113,9 +113,9 @@ class modMyModule extends DolibarrModules
$this->const = array();
// Array to add new pages in new tabs
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
// where objecttype can be
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
// 'contact' to add a tab in contact view

View File

@ -26,7 +26,7 @@ fi
if [ "x$1" = "xall" ]
then
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
do
echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3

View File

@ -25,7 +25,7 @@ fi
if [ "x$1" = "xall" ]
then
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
do
echo "tx push --skip -t -l $fic $2 $3"
tx push --skip -t -l $fic $2 $3

View File

@ -94,7 +94,6 @@ if ($result)
while ($i < $num && $i < $max)
{
$obj = $db->fetch_object($result);
$fiscalyearstatic->ref=$obj->rowid;
$fiscalyearstatic->id=$obj->rowid;
print '<tr '.$bc[$var].'>';
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';

View File

@ -229,7 +229,7 @@ else if ($id)
// Ref
print "<tr>";
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
print $object->ref;
print $object->rowid;
print '</td></tr>';
// Label
@ -283,7 +283,7 @@ else if ($id)
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
print $object->ref;
print $object->rowid;
print '</td><td width="25%">';
print $linkback;
print '</td></tr>';

View File

@ -66,8 +66,8 @@ class AccountancySystem
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_system");
if ($id > 0) {
$this->id = $id;
$result = $this->id;
$this->rowid = $id;
$result = $this->rowid;
} else {
$result = - 2;
$this->error = "AccountancySystem::Create Erreur $result";

View File

@ -123,7 +123,7 @@ class AccountingAccount extends CommonObject
*/
function create($user, $notrigger = 0)
{
global $conf, $langs;
global $conf;
$error = 0;
$now = dol_now();
@ -191,7 +191,7 @@ class AccountingAccount extends CommonObject
if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount");
if (! $notrigger) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -201,7 +201,7 @@ class AccountingAccount extends CommonObject
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
// }
}
// Commit or rollback
@ -226,8 +226,6 @@ class AccountingAccount extends CommonObject
*/
function update($user)
{
global $langs;
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
@ -295,7 +293,6 @@ class AccountingAccount extends CommonObject
*/
function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
$result = $this->checkUsage();
@ -304,8 +301,8 @@ class AccountingAccount extends CommonObject
$this->db->begin();
if (! $error) {
if (! $notrigger) {
// if (! $error) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -315,8 +312,8 @@ class AccountingAccount extends CommonObject
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
}
// }
// }
if (! $error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
@ -393,8 +390,6 @@ class AccountingAccount extends CommonObject
*/
function account_desactivate($id)
{
global $langs;
$result = $this->checkUsage();
if ($result > 0) {
@ -428,8 +423,6 @@ class AccountingAccount extends CommonObject
*/
function account_activate($id)
{
global $langs;
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";

View File

@ -225,8 +225,6 @@ class BookKeeping extends CommonObject
*/
function create($user='')
{
global $conf, $user, $langs;
$this->piece_num = 0;
// first check if line not yet in bookkeeping
@ -355,7 +353,6 @@ class BookKeeping extends CommonObject
*/
function create_std($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters
@ -445,7 +442,7 @@ class BookKeeping extends CommonObject
if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping");
if (! $notrigger) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -455,7 +452,7 @@ class BookKeeping extends CommonObject
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
// }
}
// Commit or rollback
@ -481,7 +478,6 @@ class BookKeeping extends CommonObject
*/
function update($user = 0, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters
@ -550,8 +546,8 @@ class BookKeeping extends CommonObject
$this->errors[] = "Error " . $this->db->lasterror();
}
if (! $error) {
if (! $notrigger) {
// if (! $error) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -561,8 +557,8 @@ class BookKeeping extends CommonObject
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
}
// }
// }
// Commit or rollback
if ($error) {
@ -587,7 +583,6 @@ class BookKeeping extends CommonObject
*/
function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
$this->db->begin();
@ -642,10 +637,10 @@ class BookKeeping extends CommonObject
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
$resql = $this->db->query($sql);
dol_syslog(get_class($this) . "::export_bookkeping sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->linesexport = array ();

View File

@ -50,10 +50,6 @@ class FormVentilation extends Form
*/
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
{
global $langs;
$date_array = array ();
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
$sql .= ' ORDER BY import_key DESC';
@ -100,7 +96,7 @@ class FormVentilation extends Form
*/
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array())
{
global $conf, $user, $langs;
global $conf;
$out = '';
@ -161,7 +157,7 @@ class FormVentilation extends Form
*/
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array())
{
global $conf, $user, $langs;
global $conf;
$out = '';
@ -217,7 +213,7 @@ class FormVentilation extends Form
*/
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
{
global $conf, $user, $langs;
global $conf;
$out = '';

View File

@ -599,17 +599,15 @@ else
// Bank
foreach ( $tabbq[$key] as $k => $mt ) {
if (1) {
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $reflabel . "</td>";
print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $langs->trans('Bank') . "</td>";
print "<td>" . $val["type_payment"] . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>";
}
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $reflabel . "</td>";
print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $langs->trans('Bank') . "</td>";
print "<td>" . $val["type_payment"] . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>";
}
// Third party

View File

@ -249,7 +249,6 @@ if ($action == 'writebookkeeping')
$bookkeeping->doc_type = 'customer_invoice';
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_facturedet"];
$bookkeeping->fk_compte = $compte->id;
$bookkeeping->code_tiers = '';
$bookkeeping->numero_compte = $k;
$bookkeeping->label_compte = $langs->trans("VAT");
@ -446,7 +445,6 @@ if ($action == 'export_csv')
$invoicestatic->id = $key;
$invoicestatic->ref = $val["ref"];
$invoicestatic->type = $val["type"];
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
$date = dol_print_date($db->jdate($val["date"]), 'day');

View File

@ -186,9 +186,9 @@ if ($result) {
if (empty($objp->code_buy)) {
$code_buy_notset = 'color:red';
if ($objp->type == 1) {
$objp->code_buy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$objp->code_buy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
} else {
$objp->code_buy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$objp->code_buy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
}
}else {
$code_buy_notset = 'color:blue';

View File

@ -219,7 +219,7 @@ if ($conf->facture->enabled)
print '<input type="hidden" name="constname" value="ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
print '<td>';
print $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print '</td>';

View File

@ -27,6 +27,10 @@
*/
abstract class ActionsAdherentCardCommon
{
/**
* Database handler
* @var DoliDB
*/
var $db;
var $dirmodule;
var $targetmodule;

View File

@ -1159,7 +1159,7 @@ else
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">';
if ($object->user_id)
{
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
}
else print $langs->trans("NoDolibarrAccess");
print '</td></tr>';
@ -1516,13 +1516,13 @@ else
print '</td><td colspan="2" class="valeur">';
if ($action == 'editlogin')
{
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
}
else
{
if ($object->user_id)
{
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
}
else print $langs->trans("NoDolibarrAccess");
}

View File

@ -674,13 +674,13 @@ if ($rowid)
{
$include=array($object->user_id,$user->id);
}*/
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
}
else
{
if ($object->user_id)
{
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none');
}
else print $langs->trans("NoDolibarrAccess");
}

View File

@ -6,6 +6,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -641,10 +642,6 @@ class Adherent extends CommonObject
*/
function update_end_date($user)
{
global $conf, $langs;
$error=0;
$this->db->begin();
// Search for last subscription id and end date
@ -1725,17 +1722,15 @@ class Adherent extends CommonObject
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return int <0 if KO, >0 if OK
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf;
$now=dol_now();
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
$this->nbtodo=$this->nbtodolate=0;
$now=dol_now();
$sql = "SELECT a.rowid, a.datefin";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
@ -1746,12 +1741,24 @@ class Adherent extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$langs->load("members");
$response = new WorkboardResponse();
$response->warning_delay=$conf->adherent->cotisation->warning_delay/60/60/24;
$response->label=$langs->trans("MembersWithSubscriptionToReceive");
$response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&amp;statut=1';
$response->img=img_object($langs->trans("Members"),"user");
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->adherent->cotisation->warning_delay)) $this->nbtodolate++;
$response->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->adherent->cotisation->warning_delay)) {
$response->nbtodolate++;
}
}
return 1;
return $response;
}
else
{

View File

@ -36,6 +36,13 @@ class AdherentType extends CommonObject
public $element = 'adherent_type';
var $id;
/**
* @var int
* @deprecated Use rowid
*/
public $ref;
var $libelle;
var $statut;
var $cotisation; // Soumis a la cotisation

View File

@ -32,6 +32,12 @@ $langs->load("members");
$filter=$_GET["filter"];
$statut=isset($_GET["statut"])?$_GET["statut"]:1;
$search_ref=GETPOST('search_ref');
$search_lastname=GETPOST('search_lastname');
$search_login=GETPOST('search_login');
$search_note=GETPOST('search_note');
$search_account=GETPOST('search_account','int');
$search_amount=GETPOST('search_amount','int');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -43,7 +49,6 @@ $pagenext = $page + 1;
if (! $sortorder) { $sortorder="DESC"; }
if (! $sortfield) { $sortfield="c.dateadh"; }
$msg='';
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
// Security check
@ -54,14 +59,27 @@ $result=restrictedArea($user,'adherent','','','cotisation');
* Actions
*/
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search="";
$search_ref="";
$search_lastname="";
$search_firstname="";
$search_login="";
$search_note="";
$search_amount="";
$search_account="";
}
/*
* View
*/
$form=new Form($db);
llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
if ($msg) print $msg.'<br>';
// List of subscriptions
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
@ -77,6 +95,31 @@ if (isset($date_select) && $date_select != '')
{
$sql.= " AND c.dateadh LIKE '".$date_select."%'";
}
if ($search_ref)
{
if (is_numeric($search_ref)) $sql.= " AND (c.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_lastname)
{
$sql.= " AND (d.firstname LIKE '%".$db->escape($search_lastname)."%' OR d.lastname LIKE '%".$db->escape($search_lastname)."%' OR d.societe LIKE '%".$db->escape($search_lastname)."%')";
}
if ($search_login)
{
$sql.= " AND d.login LIKE '%".$db->escape($search_login)."%'";
}
if ($search_note)
{
$sql.= " AND c.note LIKE '%".$db->escape($search_note)."%'";
}
if ($search_account > 0)
{
$sql.= " AND b.fk_account = ".$search_account;
}
if ($search_amount)
{
$sql.=" AND c.cotisation = ".$db->escape($search_amount);
}
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
@ -90,10 +133,23 @@ if ($result)
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
$param="";
$param.="&amp;statut=$statut&amp;date_select=$date_select";
$param.="&statut=$statut&date_select=$date_select";
if ($search_lastname) $param.="&search_lastname=".$search_lastname;
if ($search_login) $param.="&search_login=".$search_login;
if ($search_acount) $param.="&search_account=".$search_account;
if ($search_amount) $param.="&search_amount=".$search_amount;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
if ($sall)
{
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
}
$param="";
$param.="&statut=$statut&date_select=$date_select";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -107,9 +163,47 @@ if ($result)
}
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'colspan="2" align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Line for filters fields
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_ref" value="'.$search_ref.'" size="4"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_note" value="'.$search_note.'" size="7"></td>';
if (! empty($conf->banque->enabled))
{
print '<td class="liste_titre">';
print $form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
}
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" class="liste_titre">';
print '<input class="flat" type="text" name="search_amount" value="'.$search_amount.'" size="4">';
print '</td><td align="right" class="liste_titre" width="60px">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print ' ';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print "</tr>\n";
// Static objects
$cotisation=new Cotisation($db);
$adherent=new Adherent($db);
@ -133,11 +227,6 @@ if ($result)
$var=!$var;
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "<form method=\"post\" action=\"cotisations.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
print "<tr ".$bc[$var].">";
// Ref
@ -167,19 +256,6 @@ if ($result)
else
{
print "<td>";
if ($allowinsertbankafter && $objp->cotisation)
{
print '<input type="hidden" name="action" value="2bank">';
print '<input type="hidden" name="rowid" value="'.$objp->crowid.'">';
$form->select_comptes('','accountid',0,'',1);
print '<br>';
$form->select_types_paiements('','paymenttypeid');
print '<input name="num_chq" type="text" class="flat" size="5">';
}
else
{
print '&nbsp;';
}
print "</td>\n";
}
}
@ -191,13 +267,10 @@ if ($result)
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
// Price
print '<td align="right">'.price($objp->cotisation).'</td>';
print '<td align="right" colspan="2">'.price($objp->cotisation).'</td>';
print "</tr>";
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "</form>\n";
}
$i++;
}
@ -214,13 +287,11 @@ if ($result)
}
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print "<td align=\"right\">".price($total)."</td>\n";
print '<td align="right" colspan="2">'.price($total)."</td>\n";
print "</tr>\n";
print "</table>";
print "<br>\n";
print '</form>';
}
else
{
@ -228,6 +299,5 @@ else
}
$db->close();
llxFooter();
$db->close();

View File

@ -152,7 +152,7 @@ $nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
if ($resql) $nbtotalofrecords = $db->num_rows($result);
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
else dol_print_error($db);
}
// Add order and limit
@ -233,7 +233,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre
// Line for filters fields
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
@ -263,7 +263,7 @@ if ($resql)
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print "</tr>\n";
print "</tr>\n";
$var=True;
while ($i < $num && $i < $conf->liste_limit)

View File

@ -92,7 +92,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
if ($adht->libelle)
{
$id=$adht->create($user->id);
$id=$adht->create($user);
if ($id > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
@ -127,7 +127,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
$adht->update($user->id);
$adht->update($user);
header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]);
exit;

View File

@ -133,7 +133,7 @@ print '<tr '.$bc[$var].'>'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right" class="nowrap">'."\n";
print $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 1);
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 1);
print '</td></tr>'."\n";
// AGENDA_DEFAULT_FILTER_STATUS

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
*
@ -327,7 +327,7 @@ if (! empty($conf->product->enabled))
print "<tr ".$bc[$var].">";
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" align="right">';
print $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
$formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
print '</td><td align="right">';
print '<input type="submit" class="button" name="submit_PRODUIT_DEFAULT_BARCODE_TYPE" value="'.$langs->trans("Modify").'">';
print "</td>";
@ -430,6 +430,5 @@ print '</form>';
print "<br>";
$db->close();
llxFooter();
$db->close();

View File

@ -119,7 +119,8 @@ if ($action == 'edit') // Edit
clearstatcache();
$var=true;
print_fiche_titre($langs->trans("Language"),'','').'<br>';
print_fiche_titre($langs->trans("Language"),'','');
print '<br>';
print '<table summary="edit" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print '<td width="20">&nbsp;</td>';
@ -322,7 +323,8 @@ else // Show
$var=true;
// Language
print_fiche_titre($langs->trans("Language"),'','').'<br>';
print_fiche_titre($langs->trans("Language"),'','');
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td><td>&nbsp;</td></tr>';

View File

@ -183,10 +183,10 @@ if ($action == 'edit')
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuManager").'</td>';
print '<td>';
print $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled="disabled"');
$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled="disabled"');
print '</td>';
print '<td>';
print $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled="disabled"');
$formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled="disabled"');
print '</td>';
print '</tr>';
@ -194,10 +194,10 @@ if ($action == 'edit')
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
print '<td>';
print $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled="disabled"');
$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled="disabled"');
print '</td>';
print '<td>';
print $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled="disabled"');
$formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled="disabled"');
print '</td>';
print '</tr>';

View File

@ -299,7 +299,7 @@ if ($action == 'create')
// Handler
print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td>';
print '<td>';
print $formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu);
$formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu);
print '</td>';
print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';

View File

@ -149,7 +149,7 @@ print '</tr>';
// Bank account (from Banks module)
print '<tr class="impair"><td>'.$langs->trans("BankToReceiveWithdraw").'</td>';
print '<td align="left">';
print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1);
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1);
print '</td></tr>';
// ICS

View File

@ -81,33 +81,32 @@ if ($action == 'set')
{
$db->begin();
$activeModules = array();
$newActiveModules = array();
$selectedModules = (isset($_POST['SYSLOG_HANDLERS']) ? $_POST['SYSLOG_HANDLERS'] : array());
foreach ($selectedModules as $syslogHandler)
//var_dump($selectedModules);
foreach ($syslogModules as $syslogHandler)
{
if (in_array($syslogHandler, $syslogModules))
{
$module = new $syslogHandler;
if ($module->isActive())
if (in_array($syslogHandler, $selectedModules)) $newActiveModules[] = $syslogHandler;
foreach ($module->configure() as $option)
{
$activeModules[] = $syslogHandler;
foreach ($module->configure() as $option)
if (isset($_POST[$option['constant']]))
{
if ($_POST[$option['constant']])
{
dolibarr_del_const($db, $option['constant'], 0);
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0);
}
$_POST[$option['constant']] = trim($_POST[$option['constant']]);
dolibarr_del_const($db, $option['constant'], 0);
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0);
}
}
}
}
$activeModules = $newActiveModules;
dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0);
if (! $error)
{
$db->commit();
@ -165,6 +164,9 @@ if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity)
$option = 'disabled="disabled"';
}
//print "conf->global->MAIN_FEATURES_LEVEL = ".$conf->global->MAIN_FEATURES_LEVEL."<br><br>\n";
// Output mode
print_titre($langs->trans("SyslogOutput"));
@ -190,7 +192,7 @@ foreach ($syslogModules as $moduleName)
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td width="140">';
print '<input '.$bc[$var].' type="checkbox" name="SYSLOG_HANDLERS[]" value="'.$moduleName.'" '.(in_array($moduleName, $activeModules) ? 'checked="checked"' : '').(!$moduleactive ? 'disabled="disabled"' : '').'> ';
print '<input '.$bc[$var].' type="checkbox" name="SYSLOG_HANDLERS[]" value="'.$moduleName.'" '.(in_array($moduleName, $activeModules) ? 'checked="checked"' : '').($moduleactive <= 0 ? 'disabled="disabled"' : '').'> ';
print $module->getName();
print '</td>';
@ -205,6 +207,7 @@ foreach ($syslogModules as $moduleName)
else $value = (isset($option['default']) ? $option['default'] : '');
print $option['name'].': <input type="text" class="flat" name="'.$option['constant'].'" value="'.$value.'"'.(isset($option['attr']) ? ' '.$option['attr'] : '').'>';
if (! empty($option['example'])) print '<br>'.$langs->trans("Example").': '.$option['example'];
}
}
print '</td>';

View File

@ -97,7 +97,7 @@ jQuery(document).ready(function() {
if (jQuery("#select_sql_compat").val() == 'POSTGRESQL')
{
jQuery("#checkbox_dump_disable-add-locks").attr('checked',true);
};
}
});
<?php

View File

@ -97,7 +97,7 @@ function compare($x, $y)
*/
function revcompare($x, $y)
{
global $sortby, $langs;
global $sortby;
if ($x[$sortby] == $y[$sortby]) {
return 0;
@ -146,16 +146,16 @@ function create_script_table($list)
if($sortby == "file")
print ($order == "asc" ? "&darr;" : "&uarr;").'</th>';
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=mtime&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Date").'</a>&nbsp;';
if($sortby == "mtime")
if($sortby == "mtime")
print ($order == "asc" ? "&darr;" : "&uarr;").'</th>';
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=size&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Size").'</a>&nbsp;';
if($sortby == "size")
if($sortby == "size")
print ($order == "asc" ? "&darr;" : "&uarr;").'</th>';
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=reloads&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Reloads").'</a>&nbsp;';
if($sortby == "reloads")
if($sortby == "reloads")
print ($order == "asc" ? "&darr;" : "&uarr;").'</th>';
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=hits&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Hits").'</a>&nbsp;';
if($sortby == "hits")
if($sortby == "hits")
print ($order == "asc" ? "&darr;" : "&uarr;").'</th>';
print '</tr>';
switch ($sortby) {

View File

@ -469,7 +469,6 @@ function backup_tables($outputfile, $tables='*')
$sql='SELECT * FROM '.$table;
$result = $db->query($sql);
$num_fields = $db->num_rows($result);
while($row = $db->fetch_row($result))
{
// For each row of data we print a line of INSERT

View File

@ -102,7 +102,7 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin)
{
$error++;
dol_syslog($securityevent->error, LOG_ERR);
$db->rolback();
$db->rollback();
}
}

View File

@ -41,7 +41,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
/**
* Empty header
*
* @return none
* @return void
*/
function llxHeader()
{
@ -53,7 +53,7 @@ function llxHeader()
/**
* Empty footer
*
* @return none
* @return void
*/
function llxFooter()
{

View File

@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("admin");
$langs->load("members");
$langs->load("errors");
$langs->load("other");
// Choice of print year or current year.
$now = dol_now();
@ -210,7 +211,8 @@ if ($conf->societe->enabled)
{
$nbno=$nbtotal=0;
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','').'<br>'."\n";
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','');
print '<br>'."\n";
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
$resql=$db->query($sql);
if ($resql)
@ -229,7 +231,7 @@ if ($conf->societe->enabled)
}
else dol_print_error($db);
print $langs->trans("CurrentlyNWithoutBarCode", $nbno, $nbtotal, $langs->transnoentitiesnoconv("Thirdparties")).'<br>'."\n";
print $langs->trans("CurrentlyNWithoutBarCode", $nbno, $nbtotal, $langs->transnoentitiesnoconv("ThirdParties")).'<br>'."\n";
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled="checked" ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled="disabled"';
@ -250,11 +252,13 @@ if ($conf->product->enabled || $conf->product->service)
$nbno=$nbtotal=0;
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','').'<br>'."\n";
$sql ="SELECT count(rowid) as nb, fk_product_type";
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','');
print '<br>'."\n";
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
$sql.=" FROM ".MAIN_DB_PREFIX."product";
$sql.=" WHERE barcode IS NULL OR barcode = ''";
$sql.=" GROUP BY fk_product_type";
$sql.=" GROUP BY fk_product_type, datec";
$sql.=" ORDER BY datec";
$resql=$db->query($sql);
if ($resql)

View File

@ -360,7 +360,7 @@ print '<br>';
print '<input id="fillfromproduct" type="radio" '.((GETPOST("selectorforbarcode")=='fillfromproduct')?'checked="checked" ':'').'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"> '.$langs->trans("FillBarCodeTypeAndValueFromProduct").' &nbsp; ';
print '<br>';
print '<div class="showforproductselector">';
print $form->select_produits(GETPOST('productid'), 'productid', '');
$form->select_produits(GETPOST('productid'), 'productid', '');
print ' &nbsp; <input type="submit" id="submitproduct" name="submitproduct" class="button" value="'.(dol_escape_htmltag($langs->trans("GetBarCode"))).'">';
print '</div>';

View File

@ -38,8 +38,6 @@ function printBookmarksList($aDb, $aLangs)
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
$bookm = new Bookmark($db);
$langs->load("bookmarks");
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');

View File

@ -94,9 +94,12 @@ if ($resql)
print "<tr class=\"liste_titre\">";
//print "<td>&nbsp;</td>";
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Title"),'','')."</td>";
print_liste_field_titre($langs->trans("Link"),'','')."</td>";
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"')."</td>";
print_liste_field_titre($langs->trans("Title"),'','');
print "</td>";
print_liste_field_titre($langs->trans("Link"),'','');
print "</td>";
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"');
print "</td>";
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);

View File

@ -130,7 +130,16 @@ if (! empty($conf->stock->enabled))
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
print '<td colspan="2">';
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
if (empty($conf->productbatch->enabled)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
}
else
{
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
}
print $langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch');
}
print '</td></tr>';
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;

View File

@ -31,7 +31,7 @@ $langs->load("bills");
function popupTicket()
{
largeur = 600;
hauteur = 500
hauteur = 500;
opt = 'width='+largeur+', height='+hauteur+', left='+(screen.width - largeur)/2+', top='+(screen.height-hauteur)/2+'';
window.open('validation_ticket.php?facid=<?php echo $_GET['facid']; ?>', '<?php echo $langs->trans('PrintTicket') ?>', opt);
}

View File

@ -278,7 +278,7 @@ if ($socid)
// Address
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">';
print dol_print_address($soc->address,'gmap','thirdparty',$soc->id);
dol_print_address($soc->address,'gmap','thirdparty',$soc->id);
print '</td></tr>';
// Zip / Town
@ -609,7 +609,7 @@ else if ($id || $ref)
* @param Object $object Object we want to see categories it can be classified into
* @param int $typeid Type of category (0, 1, 2, 3)
* @param int $socid Id thirdparty
* @param string $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
* @param int $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
* @return int 0
*/
function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)

View File

@ -297,7 +297,6 @@ class Categorie extends CommonObject
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookCategorydao'));
$parameters=array();
$action='update';
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
@ -334,7 +333,7 @@ class Categorie extends CommonObject
* Delete a category from database
*
* @param User $user Object user that ask to delete
* @return void
* @return int <0 KO >0 OK
*/
function delete($user)
{
@ -689,7 +688,9 @@ class Categorie extends CommonObject
*/
function containsObject($type, $object_id)
{
$field = ''; $classname = ''; $category_table = ''; $object_table = '';
$field = '';
$category_table = '';
if ($type == 'product') {
$field = 'product';
}
@ -726,7 +727,7 @@ class Categorie extends CommonObject
/**
* Return childs of a category
*
* @return void
* @return array|int <0 KO, array ok
*/
function get_filles()
{
@ -1045,7 +1046,7 @@ class Categorie extends CommonObject
* Retourne les categories de premier niveau (qui ne sont pas filles)
*
* @param int $type Type of category
* @return void
* @return array
*/
function get_main_categories($type=null)
{
@ -1058,7 +1059,7 @@ class Categorie extends CommonObject
*
* @param string $sep Separator
* @param string $url Url
* @return void
* @return array
*/
function print_all_ways($sep = " &gt;&gt; ", $url='')
{
@ -1088,7 +1089,7 @@ class Categorie extends CommonObject
/**
* Retourne un tableau contenant la liste des categories meres
*
* @return void
* @return int|array <0 KO, array OK
*/
function get_meres()
{
@ -1123,7 +1124,7 @@ class Categorie extends CommonObject
* Retourne dans un tableau tous les chemins possibles pour arriver a la categorie
* en partant des categories principales, representes par des tableaux de categories
*
* @return void
* @return array
*/
function get_all_ways()
{
@ -1315,7 +1316,7 @@ class Categorie extends CommonObject
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
$result=dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage))
{
@ -1560,8 +1561,6 @@ class Categorie extends CommonObject
*/
function initAsSpecimen()
{
global $user,$langs,$conf;
dol_syslog(get_class($this)."::initAsSpecimen");
// Initialise parametres

View File

@ -66,7 +66,9 @@ if ($id > 0)
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->id) $result = $object->add_photo($upload_dir, $_FILES['userfile']);
if ($object->id) {
$object->add_photo($upload_dir, $_FILES['userfile']);
}
}
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer)

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -37,27 +38,67 @@ class ActionComm extends CommonObject
public $table_rowid = 'id';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* Id of the event
* @var int
*/
var $id;
/**
* Id of the event. Use $id as possible
* @var int
*/
public $ref;
var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
var $label;
/**
* @var string
* @deprecated Use $label
*/
public $libelle;
var $datec; // Date creation record (datec)
var $datem; // Date modification record (tms)
var $author; // Object user that create action //deprecated
var $usermod; // Object user that modified action // deprecated
/**
* Object user that create action
* @var User
* @deprecated
*/
var $author;
/**
* Object user that modified action
* @var User
* @deprecated
*/
var $usermod;
var $authorid; // Id user that create action
var $usermodid; // Id user that modified action
var $datep; // Date action start (datep)
var $datef; // Date action end (datep2)
var $durationp = -1; // -1=Unkown duration // deprecated
/**
* @var int -1=Unkown duration
* @deprecated
*/
var $durationp = -1;
var $fulldayevent = 0; // 1=Event on full day
var $punctual = 1; // Milestone // deprecated. Milestone is already event with end date = start date
/**
* Milestone
* @var int
* @deprecated Milestone is already event with end date = start date
*/
var $punctual = 1;
var $percentage; // Percentage
var $location; // Location
@ -68,14 +109,41 @@ class ActionComm extends CommonObject
var $userassigned = array(); // Array of user ids
var $userownerid; // Id of user owner
var $userdoneid; // Id of user done
var $usertodo; // Object user of owner // deprecated
var $userdone; // Object user that did action // deprecated
/**
* Object user of owner
* @var User
* @deprecated
*/
var $usertodo;
/**
* Object user that did action
* @var User
* @deprecated
*/
var $userdone;
var $socid;
var $contactid;
var $societe; // Company linked to action (optional)
var $contact; // Contact linked to action (optional)
var $fk_project; // Id of project (optional)
/**
* Company linked to action (optional)
* @var Societe|null
*/
var $societe;
/**
* Contact linked to action (optional)
* @var Contact|null
*/
var $contact;
/**
* Id of project (optional)
* @var int
*/
var $fk_project;
// Properties for links to other objects
var $fk_element; // Id of record
@ -95,8 +163,6 @@ class ActionComm extends CommonObject
*/
function __construct($db)
{
global $langs;
$this->db = $db;
$this->societe = new stdClass(); // deprecated
@ -246,7 +312,6 @@ class ActionComm extends CommonObject
{
if (! is_array($val)) // For backward compatibility when val=id
{
$tmpid=$val;
$val=array('id'=>$val);
}
@ -344,12 +409,13 @@ class ActionComm extends CommonObject
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,";
$sql.= " u.firstname, u.lastname as lastname";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a ";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id ";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
$sql.= " WHERE a.fk_action=c.id";
if ($ref) $sql.= " AND a.id=".$ref; // No field ref, we use id
else $sql.= " AND a.id=".$id;
$sql.= " WHERE ";
if ($ref) $sql.= " a.id=".$ref; // No field ref, we use id
else $sql.= " a.id=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
@ -428,9 +494,7 @@ class ActionComm extends CommonObject
*/
function fetch_userassigned()
{
global $langs;
$sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
$resql2=$this->db->query($sql);
@ -712,18 +776,14 @@ class ActionComm extends CommonObject
}
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return int <0 if KO, >0 if OK
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf, $user;
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
global $conf, $user, $langs;
$sql = "SELECT a.id, a.datep as dp";
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
@ -739,13 +799,25 @@ class ActionComm extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$now = dol_now();
$response = new WorkboardResponse();
$response->warning_delay = $conf->actions->warning_delay/60/60/24;
$response->label = $langs->trans("ActionsToDo");
$response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&amp;mainmenu=agenda';
$response->img = img_object($langs->trans("Actions"),"action");
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if (isset($obj->dp) && $this->db->jdate($obj->dp) < ($now - $conf->actions->warning_delay)) $this->nbtodolate++;
$response->nbtodo++;
if (isset($obj->dp) && $this->db->jdate($obj->dp) < ($now - $conf->actions->warning_delay)) {
$response->nbtodolate++;
}
}
return 1;
return $response;
}
else
{
@ -892,7 +964,7 @@ class ActionComm extends CommonObject
* @param int $overwritepicto 1=Overwrite picto
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0)
{
global $conf,$langs;
@ -1155,7 +1227,7 @@ class ActionComm extends CommonObject
*/
function initAsSpecimen()
{
global $user,$langs,$conf,$user;
global $user;
$now=dol_now();
@ -1172,6 +1244,7 @@ class ActionComm extends CommonObject
$this->datef=$now;
$this->author=$user;
$this->usermod=$user;
$this->usertodo=$user;
$this->fulldayevent=0;
$this->punctual=0;
$this->percentage=0;

View File

@ -99,10 +99,10 @@ class CActionComm
/**
* Return list of event types: array(id=>label) or array(code=>label)
*
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
* @param int $onlyautoornot Group list by auto events or not
* @return mixed Array of all event types if OK, <0 if KO
*/
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)

View File

@ -261,7 +261,7 @@ class ICal
*/
function ical_rrule($value)
{
$result=aray();
$result=array();
$rrule = explode(';',$value);
foreach ($rrule as $line)
{

View File

@ -1144,7 +1144,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color (Hex string like '0088FF') and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1;
$color=-1; $colorindex=-1;
if (in_array($user->id, $keysofuserassigned))
{
$nummytasks++; $cssclass='family_mytasks';

View File

@ -313,7 +313,7 @@ if ($resql)
$actionstatic->id=$obj->id;
$actionstatic->type_code=$obj->type_code;
$actionstatic->type_label=$obj->type_label;
$actionstatic->libelle=$obj->label;
$actionstatic->label=$obj->label;
print $actionstatic->getNomUrl(1,28);
print '</td>';

View File

@ -804,7 +804,7 @@ $db->close();
* @param int $minheight Minimum height for each event. 60px by default.
* @param boolean $showheader Show header
* @param array $colorsbytype Array with colors by type
* @param string $var true or false for alternat style on tr/td
* @param bool $var true or false for alternat style on tr/td
* @return void
*/
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)

View File

@ -396,6 +396,10 @@ if ($id > 0)
print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer);
print '</td><td colspan="3">';
print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer,'amount',($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
// display amount and link to unpaid bill
$outstandigBills = $object->get_OutstandingBill();
if ($outstandigBills != 0)
print " / <a href='".DOL_URL_ROOT."/compta/facture/list.php?socid=".$object->id."&search_status=1'>".price($outstandigBills).'</a>';
print '</td>';
print '</tr>';
}
@ -933,7 +937,7 @@ if ($id > 0)
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))

View File

@ -448,7 +448,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
print "<tr ".$bc[$var]."><td><a href=\"../contrat/card.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"), 'contract')." ".$obj->ref."</a></td>";
print '<td>';
$companystatic->id=$objp->rowid;
$companystatic->name=$objp->name;

View File

@ -140,9 +140,7 @@ if (empty($reshook))
{
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{
//TODO: What is this for?
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message
// As security measure, we don't allow send from the GUI
setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
setEventMessage('<textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
@ -197,7 +195,7 @@ if (empty($reshook))
$now=dol_now();
// Positionne date debut envoi
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate($now)." WHERE rowid=".$object->id;
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".$object->id;
$resql2=$db->query($sql);
if (! $resql2)
{
@ -293,7 +291,7 @@ if (empty($reshook))
dol_syslog("comm/mailing/card.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
$sql.=" SET statut=1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql);
if (! $resql2)
{
@ -340,7 +338,7 @@ if (empty($reshook))
dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
$sql.=" SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql);
if (! $resql2)
{

View File

@ -118,8 +118,7 @@ if ($action == 'add')
if (GETPOST('clearlist'))
{
// Chargement de la classe
$classname = "MailingTargets";
$obj = new $classname($db);
$obj = new MailingTargets($db);
$obj->clear_target($id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
@ -135,8 +134,7 @@ if ($action == 'delete')
{
if (!empty($id))
{
$classname = "MailingTargets";
$obj = new $classname($db);
$obj = new MailingTargets($db);
$obj->update_nb($id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);

View File

@ -10,7 +10,7 @@
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -116,10 +116,6 @@ class Propal extends CommonObject
var $labelstatut=array();
var $labelstatut_short=array();
// Pour board
var $nbtodo;
var $nbtodolate;
var $specimen;
@ -296,15 +292,15 @@ class Propal extends CommonObject
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*
* @param string $desc Description de la ligne
* @param double $pu_ht Prix unitaire
* @param double $qty Quantite
* @param double $txtva Taux de tva
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
* @param float $pu_ht Prix unitaire
* @param float $qty Quantite
* @param float $txtva Taux de tva
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id du produit/service predefini
* @param double $remise_percent Pourcentage de remise de la ligne
* @param float $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC
* @param double $pu_ttc Prix unitaire TTC
* @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $type Type of line (product, service)
* @param int $rang Position of line
@ -320,7 +316,7 @@ class Propal extends CommonObject
*
* @see add_product
*/
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
{
global $mysoc;
@ -477,14 +473,14 @@ class Propal extends CommonObject
* Update a proposal line
*
* @param int $rowid Id de la ligne
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type)
* @param double $qty Quantity
* @param double $remise_percent Remise effectuee sur le produit
* @param double $txtva Taux de TVA
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
* @param float $pu Prix unitaire (HT ou TTC selon price_base_type)
* @param float $qty Quantity
* @param float $remise_percent Remise effectuee sur le produit
* @param float $txtva Taux de TVA
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param string $desc Description
* @param double $price_base_type HT ou TTC
* @param string $price_base_type HT ou TTC
* @param int $info_bits Miscellaneous informations
* @param int $special_code Special code (also used by externals modules!)
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
@ -498,9 +494,9 @@ class Propal extends CommonObject
* @param array $array_option extrafields array
* @return int 0 if OK, <0 if KO
*/
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0)
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0)
{
global $conf,$user,$langs, $mysoc;
global $mysoc;
dol_syslog(get_class($this)."::updateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@ -1869,8 +1865,6 @@ class Propal extends CommonObject
*/
function set_draft($user)
{
global $conf,$langs;
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0";
$sql.= " WHERE rowid = ".$this->id;
@ -2351,15 +2345,12 @@ class Propal extends CommonObject
*
* @param User $user Object user
* @param int $mode "opened" for proposal to close, "signed" for proposal to invoice
* @return int <0 if KO, >0 if OK
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user,$mode)
{
global $conf, $user;
global $conf, $user, $langs;
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE";
$sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin";
@ -2378,25 +2369,43 @@ class Propal extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
if ($mode == 'opened') $delay_warning=$conf->propal->cloture->warning_delay;
if ($mode == 'signed') $delay_warning=$conf->propal->facturation->warning_delay;
$langs->load("propal");
$now=dol_now();
if ($mode == 'opened') {
$delay_warning=$conf->propal->cloture->warning_delay;
$statut = 1;
$label = $langs->trans("PropalsToClose");
}
if ($mode == 'signed') {
$delay_warning=$conf->propal->facturation->warning_delay;
$statut = 2;
$label = $langs->trans("PropalsToBill");
}
$response = new WorkboardResponse();
$response->warning_delay = $delay_warning;
$response->label = $label;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut;
$response->img = img_object($langs->trans("Propals"),"propal");
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
$response->nbtodo++;
if ($mode == 'opened')
{
$datelimit = $this->db->jdate($obj->datefin);
if ($datelimit < ($now - $delay_warning))
{
$this->nbtodolate++;
$response->nbtodolate++;
}
}
// TODO Definir regle des propales a facturer en retard
// if ($mode == 'signed' && ! count($this->FactureListeArray($obj->rowid))) $this->nbtodolate++;
}
return 1;
return $response;
}
else
{

View File

@ -193,8 +193,6 @@ class PropaleStats extends Stats
*/
function getAllByProduct($year)
{
global $user;
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";

View File

@ -144,7 +144,9 @@ if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,';
if (! $sall) $sql = 'SELECT';
else $sql = 'SELECT DISTINCT';
$sql.= ' s.rowid, s.nom as name, s.town, s.client, s.code_client,';
$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';

View File

@ -41,8 +41,6 @@ class Prospect extends Societe
*/
function __construct($db)
{
global $config;
$this->db = $db;
return 0;
@ -56,7 +54,7 @@ class Prospect extends Societe
*/
function load_state_board()
{
global $conf, $user;
global $user;
$this->nb=array("customers" => 0,"prospects" => 0);
$clause = "WHERE";

View File

@ -534,7 +534,7 @@ if ($socid > 0)
}
else
{
print dol_print_error($db);
dol_print_error($db);
}
}

View File

@ -137,8 +137,10 @@ if (empty($reshook))
}
// Reopen a closed order
else if ($action == 'reopen' && $user->rights->commande->creer) {
if ($object->statut == 3) {
else if ($action == 'reopen' && $user->rights->commande->creer)
{
if ($object->statut == 3)
{
$result = $object->set_reopen($user);
if ($result > 0)
{
@ -153,21 +155,26 @@ if (empty($reshook))
}
// Suppression de la commande
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer) {
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer)
{
$result = $object->delete($user);
if ($result > 0) {
if ($result > 0)
{
header('Location: index.php');
exit;
}
else {
else
{
setEventMessage($object->error, 'errors');
}
}
// Remove a product line
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->commande->creer) {
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->commande->creer)
{
$result = $object->deleteline($lineid);
if ($result > 0) {
if ($result > 0)
{
// Define output language
$outputlangs = $langs;
$newlang = '';
@ -194,12 +201,14 @@ if (empty($reshook))
}
// Categorisation dans projet
else if ($action == 'classin' && $user->rights->commande->creer) {
else if ($action == 'classin' && $user->rights->commande->creer)
{
$object->setProject(GETPOST('projectid'));
}
// Add order
else if ($action == 'add' && $user->rights->commande->creer) {
else if ($action == 'add' && $user->rights->commande->creer)
{
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
@ -239,7 +248,8 @@ if (empty($reshook))
$object->contactid = GETPOST('contactid');
// If creation from another object of another module (Example: origin=propal, originid=1)
if (! empty($origin) && ! empty($originid)) {
if (! empty($origin) && ! empty($originid))
{
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
@ -301,37 +311,37 @@ if (empty($reshook))
for($i = 0; $i < $num; $i ++)
{
$label = (! empty($lines [$i]->label) ? $lines [$i]->label : '');
$desc = (! empty($lines [$i]->desc) ? $lines [$i]->desc : $lines [$i]->libelle);
$product_type = (! empty($lines [$i]->product_type) ? $lines [$i]->product_type : 0);
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : '');
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle);
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
// Dates
// TODO mutualiser
$date_start = $lines [$i]->date_debut_prevue;
if ($lines [$i]->date_debut_reel)
$date_start = $lines [$i]->date_debut_reel;
if ($lines [$i]->date_start)
$date_start = $lines [$i]->date_start;
$date_end = $lines [$i]->date_fin_prevue;
if ($lines [$i]->date_fin_reel)
$date_end = $lines [$i]->date_fin_reel;
if ($lines [$i]->date_end)
$date_end = $lines [$i]->date_end;
$date_start = $lines[$i]->date_debut_prevue;
if ($lines[$i]->date_debut_reel)
$date_start = $lines[$i]->date_debut_reel;
if ($lines[$i]->date_start)
$date_start = $lines[$i]->date_start;
$date_end = $lines[$i]->date_fin_prevue;
if ($lines[$i]->date_fin_reel)
$date_end = $lines[$i]->date_fin_reel;
if ($lines[$i]->date_end)
$date_end = $lines[$i]->date_end;
// Reset fk_parent_line for no child products and special product
if (($lines [$i]->product_type != 9 && empty($lines [$i]->fk_parent_line)) || $lines [$i]->product_type == 9) {
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
$fk_parent_line = 0;
}
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines [$i], 'fetch_optionals')) // For avoid conflicts if
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
// trigger used
{
$lines [$i]->fetch_optionals($lines [$i]->rowid);
$array_option = $lines [$i]->array_options;
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_option = $lines[$i]->array_options;
}
$result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option);
$result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_option);
if ($result < 0) {
$error ++;
@ -339,7 +349,7 @@ if (empty($reshook))
}
// Defined the new fk_parent_line
if ($result > 0 && $lines [$i]->product_type == 9) {
if ($result > 0 && $lines[$i]->product_type == 9) {
$fk_parent_line = $result;
}
}
@ -385,8 +395,10 @@ if (empty($reshook))
}
// Insert default contacts if defined
if ($object_id > 0) {
if (GETPOST('contactid')) {
if ($object_id > 0)
{
if (GETPOST('contactid'))
{
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
if ($result < 0) {
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
@ -399,7 +411,8 @@ if (empty($reshook))
}
// End of object creation, we show it
if ($object_id > 0 && ! $error) {
if ($object_id > 0 && ! $error)
{
$db->commit();
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object_id);
exit();
@ -1155,7 +1168,7 @@ if (empty($reshook))
$action = 'edit_extras';
}
include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
/*
@ -1232,14 +1245,16 @@ $formorder = new FormOrder($db);
*
* *******************************************************************
*/
if ($action == 'create' && $user->rights->commande->creer) {
if ($action == 'create' && $user->rights->commande->creer)
{
print_fiche_titre($langs->trans('CreateOrder'));
$soc = new Societe($db);
if ($socid > 0)
$res = $soc->fetch($socid);
if (! empty($origin) && ! empty($originid)) {
if (! empty($origin) && ! empty($originid))
{
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
@ -1353,7 +1368,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
/*
* Contact de la commande
*/
*/
if ($socid > 0) {
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td colspan="2">';
$form->select_contacts($soc->id, $setcontact, 'contactid', 1, $srccontactslist);
@ -1592,7 +1607,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
/*
* Confirmation de la validation
*/
if ($action == 'validate') {
if ($action == 'validate')
{
// on verifie si l'objet est en numerotation provisoire
$ref = substr($object->ref, 1, 4);
if ($ref == 'PROV') {
@ -1602,7 +1618,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
}
$text = $langs->trans('ConfirmValidateOrder', $numref);
if (! empty($conf->notification->enabled)) {
if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';

View File

@ -7,7 +7,7 @@
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -106,10 +106,6 @@ class Commande extends CommonOrder
var $lines = array();
// Pour board
var $nbtodo;
var $nbtodolate;
/**
* Constructor
@ -162,7 +158,6 @@ class Commande extends CommonOrder
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
if ($numref != "")
@ -1082,19 +1077,19 @@ class Commande extends CommonOrder
* Add an order line into database (linked to product/service or not)
*
* @param string $desc Description of line
* @param double $pu_ht Unit price (without tax)
* @param double $qty Quantite
* @param double $txtva Taux de tva force, sinon -1
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
* @param float $pu_ht Unit price (without tax)
* @param float $qty Quantite
* @param float $txtva Taux de tva force, sinon -1
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id du produit/service predefini
* @param double $remise_percent Pourcentage de remise de la ligne
* @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes
* @param int $fk_remise_except Id remise
* @param string $price_base_type HT or TTC
* @param double $pu_ttc Prix unitaire TTC
* @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param float $pu_ttc Prix unitaire TTC
* @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $type Type of line (0=product, 1=service)
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
@ -1288,16 +1283,16 @@ class Commande extends CommonOrder
* $this->client must be loaded
*
* @param int $idproduct Product Id
* @param double $qty Quantity
* @param double $remise_percent Product discount relative
* @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param float $qty Quantity
* @param float $remise_percent Product discount relative
* @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @return void
*
* TODO Remplacer les appels a cette fonction par generation objet Ligne
* insere dans tableau $this->products
*/
function add_product($idproduct, $qty, $remise_percent=0, $date_start='', $date_end='')
function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='')
{
global $conf, $mysoc;
@ -1695,7 +1690,6 @@ class Commande extends CommonOrder
*/
function loadExpeditions($filtre_statut=-1)
{
$num=0;
$this->expeditions = array();
$sql = 'SELECT cd.rowid, cd.fk_product,';
@ -1964,7 +1958,7 @@ class Commande extends CommonOrder
* Set the order date
*
* @param User $user Object user making change
* @param timestamp $date Date
* @param int $date Date
* @return int <0 if KO, >0 if OK
*/
function set_date($user, $date)
@ -1998,7 +1992,7 @@ class Commande extends CommonOrder
* Set the planned delivery date
*
* @param User $user Objet utilisateur qui modifie
* @param timestamp $date_livraison Date de livraison
* @param int $date_livraison Date de livraison
* @return int <0 si ko, >0 si ok
*/
function set_date_livraison($user, $date_livraison)
@ -2327,16 +2321,16 @@ class Commande extends CommonOrder
*
* @param int $rowid Id of line to update
* @param string $desc Description de la ligne
* @param double $pu Prix unitaire
* @param double $qty Quantity
* @param double $remise_percent Pourcentage de remise de la ligne
* @param double $txtva Taux TVA
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
* @param float $pu Prix unitaire
* @param float $qty Quantity
* @param float $remise_percent Pourcentage de remise de la ligne
* @param float $txtva Taux TVA
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param string $price_base_type HT or TTC
* @param int $info_bits Miscellaneous informations on line
* @param timestamp $date_start Start date of the line
* @param timestamp $date_end End date of the line
* @param int $date_start Start date of the line
* @param int $date_end End date of the line
* @param int $type Type of line (0=product, 1=service)
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
* @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules)
@ -2347,7 +2341,7 @@ class Commande extends CommonOrder
* @param array $array_option extrafields array
* @return int < 0 if KO, > 0 if OK
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
{
global $conf, $mysoc;
@ -2581,6 +2575,8 @@ class Commande extends CommonOrder
*/
function update_extrafields($user)
{
global $hookmanager, $conf;
$action='create';
// Actions on extra fields (by external module or standard code)
@ -2729,15 +2725,12 @@ class Commande extends CommonOrder
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Object user
* @return int <0 if KO, >0 if OK
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf, $user;
global $conf, $user, $langs;
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE";
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut";
@ -2756,14 +2749,26 @@ class Commande extends CommonOrder
$resql=$this->db->query($sql);
if ($resql)
{
$now=dol_now();
$response = new WorkboardResponse();
$response->warning_delay=$conf->commande->client->warning_delay/60/60/24;
$response->label=$langs->trans("OrdersToProcess");
$response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3';
$response->img=img_object($langs->trans("Orders"),"order");
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
$response->nbtodo++;
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) {
$response->nbtodolate++;
}
}
return 1;
return $response;
}
else
{
@ -3182,7 +3187,7 @@ class Commande extends CommonOrder
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs,$hookmanager;
global $conf,$langs;
$langs->load("orders");

View File

@ -221,5 +221,5 @@ if ($id > 0 || ! empty($ref))
}
$db->close();
llxFooter();
$db->close();

View File

@ -506,7 +506,7 @@ if ($resql)
}
else
{
print dol_print_error($db);
dol_print_error($db);
}
llxFooter();

View File

@ -697,7 +697,7 @@ if (($action != 'create' && $action != 'add') || !$error)
}
else
{
print dol_print_error($db);
dol_print_error($db);
}
}

View File

@ -432,7 +432,7 @@ if ($id > 0 || ! empty($ref))
print '<td>';
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
$filtertype='';
print $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
$form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
print '</td>';
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
print '<td><input type="text" class="flat" name="req_desc" value="'.$req_desc.'" size="24"></td>';

View File

@ -245,10 +245,26 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
print '<td colspan="3">'.$account->iban.'</td></tr>';
print '<td colspan="3">'.$account->iban.'&nbsp;';
if (! empty($account->iban)) {
if (! checkIbanForAccount($account)) {
print img_picto($langs->trans("IbanNotValid"),'warning');
} else {
print img_picto($langs->trans("IbanValid"),'info');
}
}
print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
print '<td colspan="3">'.$account->bic.'</td></tr>';
print '<td colspan="3">'.$account->bic.'&nbsp;';
if (! empty($account->bic)) {
if (! checkSwiftForAccount($account)) {
print img_picto($langs->trans("SwiftNotValid"),'warning');
} else {
print img_picto($langs->trans("SwiftValid"),'info');
}
}
print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
print nl2br($account->domiciliation);

View File

@ -261,7 +261,7 @@ if ($action == 'create')
// Type
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
print '<td colspan="3">';
print $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
$formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
print '</td></tr>';
// Currency
@ -575,7 +575,7 @@ else
// Type
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
print '<td colspan="3">';
print $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
$formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
print '</td></tr>';
// Currency

View File

@ -5,6 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copytight (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -36,7 +37,12 @@ class Account extends CommonObject
public $element='bank_account';
public $table_element='bank_account';
var $rowid; // deprecated
/**
* //TODO: Discuss this. $rowid is preferred over $id
* @var
* @deprecated
*/
var $rowid;
var $id;
var $ref;
var $label;
@ -220,7 +226,7 @@ class Account extends CommonObject
/**
* Add an entry into table ".MAIN_DB_PREFIX."bank
*
* @param timestamp $date Date operation
* @param int $date Date operation
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
* @param string $label Descripton
* @param float $amount Amount
@ -881,18 +887,14 @@ class Account extends CommonObject
*
* @param User $user Objet user
* @param int $filteraccountid To get info for a particular account id
* @return int <0 if KO, 0=Nothing to show, >0 if OK
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user,$filteraccountid=0)
{
global $conf;
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
$sql = "SELECT b.rowid, b.datev as datefin";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b,";
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba";
@ -902,17 +904,27 @@ class Account extends CommonObject
$sql.= " AND (ba.rappro = 1 AND ba.courant != 2)"; // Compte rapprochable
if ($filteraccountid) $sql.=" AND ba.rowid = ".$filteraccountid;
//print $sql;
$resql=$this->db->query($sql);
if ($resql)
{
$num=$this->db->num_rows($resql);
$langs->load("banks");
$now=dol_now();
$response = new WorkboardResponse();
$response->warning_delay=$conf->bank->rappro->warning_delay/60/60/24;
$response->label=$langs->trans("TransactionsToConciliate");
$response->url=DOL_URL_ROOT.'/compta/bank/index.php?leftmenu=bank&amp;mainmenu=bank';
$response->img=img_object($langs->trans("TransactionsToConciliate"),"payment");
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->rappro->warning_delay)) $this->nbtodolate++;
$response->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->rappro->warning_delay)) {
$response->nbtodolate++;
}
}
return $num;
return $response;
}
else
{
@ -1351,7 +1363,7 @@ class AccountLine extends CommonObject
$sql.= ")";
dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG);
$resql = $this->db->query($sql);
$this->db->query($sql);
// No error check. Can fail if category already affected
}

View File

@ -384,7 +384,7 @@ if ($result)
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<td colspan="3">';
print $form->select_types_paiements($objp->fk_type,"value",'',2);
$form->select_types_paiements($objp->fk_type,"value",'',2);
print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
if ($objp->receiptid)
{

View File

@ -146,9 +146,14 @@ if (empty($num))
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("AccountStatement").'</td></tr>';
print '<td>'.$langs->trans("AccountStatement").'</td>';
print '<td align="right">'.$langs->trans("InitialBankBalance").'</td>';
print '<td align="right">'.$langs->trans("EndBankBalance").'</td>';
print '</tr>';
$balancestart=array();
$content=array();
//while ($i < min($numrows,$conf->liste_limit)) // retrait de la limite tant qu'il n'y a pas de pagination
while ($i < min($numrows,$conf->liste_limit))
{
$objp = $db->fetch_object($result);
@ -159,7 +164,37 @@ if (empty($num))
}
else
{
print '<tr '.$bc[$var].'><td><a href="releve.php?num='.$objp->numr.'&amp;account='.$acct->id.'">'.$objp->numr.'</a></td></tr>'."\n";
print '<tr '.$bc[$var].'><td><a href="releve.php?num='.$objp->numr.'&amp;account='.$acct->id.'">'.$objp->numr.'</a></td>';
// Calculate start amount
$sql = "SELECT sum(b.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve < '".$db->escape($objp->numr)."'";
$sql.= " AND b.fk_account = ".$acct->id;
$resql=$db->query($sql);
if ($resql)
{
$obj=$db->fetch_object($resql);
$balancestart[$objp->numr] = $obj->amount;
$db->free($resql);
}
print '<td align="right">'.price($balancestart[$objp->numr],'',$langs,1,-1,-1,$conf->currency).'</td>';
// Calculate end amount
$sql = "SELECT sum(b.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve = '".$db->escape($objp->numr)."'";
$sql.= " AND b.fk_account = ".$acct->id;
$resql=$db->query($sql);
if ($resql)
{
$obj=$db->fetch_object($resql);
$content[$objp->numr] = $obj->amount;
$db->free($resql);
}
print '<td align="right">'.price(($balancestart[$objp->numr]+$content[$objp->numr]),'',$langs,1,-1,-1,$conf->currency).'</td>';
print '</tr>'."\n";
}
$i++;
}
@ -179,6 +214,7 @@ else
*/
$ve=$_GET["ve"];
// Define number of receipt to show (current, previous or next one ?)
$found=false;
if ($_GET["rel"] == 'prev')
{

View File

@ -167,11 +167,11 @@ print '</tr>';
$var=false;
print '<tr '.$bc[$var].'><td>';
print $form->select_comptes($account_from,'account_from',0,'',1);
$form->select_comptes($account_from,'account_from',0,'',1);
print "</td>";
print "<td>\n";
print $form->select_comptes($account_to,'account_to',0,'',1);
$form->select_comptes($account_to,'account_to',0,'',1);
print "</td>\n";
print "<td>";

View File

@ -252,7 +252,7 @@ if ($action == 'create')
print "<tr>";
print '<td width="25%" class="fieldrequired">'.$langs->trans("Type").'</td><td>';
print $form->select_type_fees(GETPOST('type','int'),'type',1);
$form->select_type_fees(GETPOST('type','int'),'type',1);
print '</td></tr>';
print "<tr>";
@ -347,7 +347,7 @@ else if ($id)
// Type
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
print $form->select_type_fees(GETPOST('type','int')?GETPOST('type','int'):$object->type,'type',0);
$form->select_type_fees(GETPOST('type','int')?GETPOST('type','int'):$object->type,'type',0);
print '</td></tr>';
// Who

View File

@ -376,11 +376,11 @@ class Deplacement extends CommonObject
* List of types
*
* @param int $active Active or not
* @return void
* @return array
*/
function listOfTypes($active=1)
{
global $conf,$langs;
global $langs;
$ret=array();

View File

@ -500,7 +500,7 @@ if (! empty($id) && $action != 'edit')
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
print $form->form_modes_reglement(null, $don->modepaiementid,'none');
$form->form_modes_reglement(null, $don->modepaiementid,'none');
print "</td></tr>\n";
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';

View File

@ -450,7 +450,7 @@ class Don extends CommonObject
function delete($rowid)
{
$this->db-begin();
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";

View File

@ -569,11 +569,15 @@ if (empty($reshook))
// Boucle sur chaque taux de tva
$i = 0;
foreach ($object->lines as $line) {
$amount_ht [$line->tva_tx] += $line->total_ht;
$amount_tva [$line->tva_tx] += $line->total_tva;
$amount_ttc [$line->tva_tx] += $line->total_ttc;
$i ++;
foreach ($object->lines as $line)
{
if ($line->total_ht!=0)
{ // no need to create discount if amount is null
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;
$amount_ttc[$line->tva_tx] += $line->total_ttc;
$i ++;
}
}
// Insert one discount by VAT rate category
@ -590,10 +594,12 @@ if (empty($reshook))
$discount->fk_facture_source = $object->id;
$error = 0;
foreach ($amount_ht as $tva_tx => $xxx) {
$discount->amount_ht = abs($amount_ht [$tva_tx]);
$discount->amount_tva = abs($amount_tva [$tva_tx]);
$discount->amount_ttc = abs($amount_ttc [$tva_tx]);
foreach ($amount_ht as $tva_tx => $xxx)
{
$discount->amount_ht = abs($amount_ht[$tva_tx]);
$discount->amount_tva = abs($amount_tva[$tva_tx]);
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
$discount->tva_tx = abs($tva_tx);
$result = $discount->create($user);
@ -2872,7 +2878,7 @@ if ($action == 'create')
} else {
if ($absolute_creditnote > 0) // If not, link will be added later
{
if ($object->statut == 0 && $object->type != TYPE_CREDIT_NOTE && $object->type != TYPE_DEPOSIT)
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ')<br>';
else
print '. ';
@ -3741,7 +3747,7 @@ if ($action == 'create')
$i ++;
}
print '</table>';
print '<br><div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> &nbsp; <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> &nbsp; <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
print '</form>';
$db->free($resqlorderlist);
} else {

View File

@ -591,8 +591,7 @@ class FactureRec extends Facture
parent::initAsSpecimen($option);
$this->usenewprice = 1;
$this->usenewprice = 1;
}
}

View File

@ -9,7 +9,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
@ -61,6 +61,11 @@ class Facture extends CommonInvoice
//! Id client
var $socid;
//! Objet societe client (to load with fetch_client method)
/**
* Customer
* @var Societe
*/
var $client;
var $author;
var $fk_user_author;
@ -84,7 +89,10 @@ class Facture extends CommonInvoice
var $total_tva=0;
var $total_ttc=0;
var $revenuestamp;
var $note; // deprecated
/**
* @deprecated
*/
var $note;
var $note_private;
var $note_public;
//! 0=draft,
@ -113,13 +121,13 @@ class Facture extends CommonInvoice
var $fk_account; // Id of bank account
var $fk_bank; // Field to store bank id to use when payment mode is withdraw
var $modelpdf;
var $products=array(); // deprecated
/**
* @deprecated
*/
var $products=array();
var $lines=array();
var $line;
var $extraparams=array();
//! Pour board
var $nbtodo;
var $nbtodolate;
var $specimen;
var $fac_rec;
@ -2006,8 +2014,8 @@ class Facture extends CommonInvoice
* @param double $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line
* @param timestamp $date_start Date start of service
* @param timestamp $date_end Date end of service
* @param int $date_start Date start of service
* @param int $date_end Date end of service
* @param int $ventil Code of dispatching into accountancy
* @param int $info_bits Bits de type de lignes
* @param int $fk_remise_except Id discount used
@ -2188,8 +2196,8 @@ class Facture extends CommonInvoice
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines)
* @param double $qty Quantity
* @param double $remise_percent Pourcentage de remise de la ligne
* @param date $date_start Date de debut de validite du service
* @param date $date_end Date de fin de validite du service
* @param int $date_start Date de debut de validite du service
* @param int $date_end Date de fin de validite du service
* @param double $txtva VAT Rate
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
@ -3062,7 +3070,7 @@ class Facture extends CommonInvoice
/**
* Supprime une demande de prelevement
*
* @param Use $user utilisateur creant la demande
* @param User $user utilisateur creant la demande
* @param int $did id de la demande a supprimer
* @return int <0 if OK, >0 if KO
*/
@ -3088,15 +3096,12 @@ class Facture extends CommonInvoice
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Object user
* @return int <0 if KO, >0 if OK
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf, $user;
global $conf, $user, $langs;
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE";
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin";
@ -3115,12 +3120,25 @@ class Facture extends CommonInvoice
$resql=$this->db->query($sql);
if ($resql)
{
$langs->load("bills");
$now=dol_now();
$response = new WorkboardResponse();
$response->warning_delay=$conf->facture->client->warning_delay/60/60/24;
$response->label=$langs->trans("CustomerBillsUnpaid");
$response->url=DOL_URL_ROOT.'/compta/facture/impayees.php';
$response->img=img_object($langs->trans("Bills"),"bill");
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) $this->nbtodolate++;
$response->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) {
$response->nbtodolate++;
}
}
return 1;
return $response;
}
else
{

View File

@ -326,7 +326,7 @@ if ($action == 'remove_file')
$langs->load("other");
$upload_dir = $diroutputpdf;
$file = $upload_dir . '/' . GETPOST('file');
$ret=dol_delete_file($file,0,0,0,'');
$ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
$action='';
@ -484,7 +484,8 @@ if ($resql)
$formmail = new FormMail($db);
print '<br>';
print_fiche_titre($langs->trans("SendRemind"),'','').'<br>';
print_fiche_titre($langs->trans("SendRemind"),'','');
print '<br>';
$topicmail="MailTopicSendRemindUnpaidInvoices";
$modelmail="facture_relance";

View File

@ -249,10 +249,6 @@ class Localtax extends CommonObject
*/
function delete($user)
{
global $conf, $langs;
$error=0;
// Call trigger
$result=$this->call_trigger('LOCALTAX_DELETE',$user);
if ($result < 0) return -1;
@ -270,7 +266,6 @@ class Localtax extends CommonObject
return -1;
}
return 1;
}

View File

@ -104,7 +104,7 @@ $fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
$fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
$calc=MAIN_INFO_LOCALTAX_CALC.$local;
$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
// Affiche en-tete du rapport
if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services
{

View File

@ -124,7 +124,7 @@ $fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
//$fsearch.=' <input type="text" name="min" value="'.$min.'">';
$calc=MAIN_INFO_LOCALTAX_CALC.$local;
$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
// Affiche en-tete du rapport
if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services
{

View File

@ -317,7 +317,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
if ($(\'#fieldchqemetteur\').val() == \'\')
{
var emetteur = ('.$facture->type.' == 2) ? \''.dol_escape_htmltag(MAIN_INFO_SOCIETE_NOM).'\' : jQuery(\'#thirdpartylabel\').val();
var emetteur = ('.$facture->type.' == 2) ? \''.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).'\' : jQuery(\'#thirdpartylabel\').val();
$(\'#fieldchqemetteur\').val(emetteur);
}
}

View File

@ -355,7 +355,7 @@ if ($action == 'new')
print $form->select_date($filterdate,'fd',0,0,1,'',1,1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("BankAccount").'</td><td>';
print $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
$form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
print '</td></tr>';
print '</table>';
print '<div class="center">';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -41,6 +42,8 @@ class RemiseCheque extends CommonObject
//! Numero d'erreur Plage 1024-1279
var $errno;
public $statut;
/**
* Constructor
*
@ -274,7 +277,7 @@ class RemiseCheque extends CommonObject
* Supprime la remise en base
*
* @param User $user Utilisateur qui effectue l'operation
* @return void
* @return int
*/
function delete($user='')
{
@ -292,25 +295,23 @@ class RemiseCheque extends CommonObject
{
$num = $this->db->affected_rows($resql);
if ($num <> 1)
{
$this->errno = -2;
dol_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)");
}
if ($num <> 1) {
$this->errno = -2;
dol_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)");
}
if ( $this->errno === 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
$sql.= " SET fk_bordereau = 0";
$sql.= " WHERE fk_bordereau = '".$this->id."'";
if ( $this->errno === 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
$sql.= " SET fk_bordereau = 0";
$sql.= " WHERE fk_bordereau = '".$this->id."'";
$resql = $this->db->query($sql);
if (!$resql)
{
$this->errno = -1028;
dol_syslog("RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
}
}
$resql = $this->db->query($sql);
if (!$resql)
{
$this->errno = -1028;
dol_syslog("RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
}
}
}
if ($this->errno === 0)
@ -432,18 +433,14 @@ class RemiseCheque extends CommonObject
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return int <0 if KO, >0 if OK
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf;
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
$now=dol_now();
$this->nbtodo=$this->nbtodolate=0;
$sql = "SELECT b.rowid, b.datev as datefin";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
@ -456,12 +453,25 @@ class RemiseCheque extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$langs->load("banks");
$now=dol_now();
$response = new WorkboardResponse();
$response->warning_delay=$conf->bank->cheque->warning_delay/60/60/24;
$response->label=$langs->trans("BankChecksToReceipt");
$response->url=DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&amp;mainmenu=accountancy';
$response->img=img_object($langs->trans("BankChecksToReceipt"),"payment");
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->cheque->warning_delay)) $this->nbtodolate++;
$response->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->cheque->warning_delay)) {
$response->nbtodolate++;
}
}
return 1;
return $response;
}
else
{
@ -476,7 +486,7 @@ class RemiseCheque extends CommonObject
* Build document
*
* @param string $model Model name
* @param Tranlsate $outputlangs Object langs
* @param Translate $outputlangs Object langs
* @return int <0 if KO, >0 if OK
*/
function generatePdf($model, $outputlangs)
@ -693,7 +703,7 @@ class RemiseCheque extends CommonObject
* Set the creation date
*
* @param User $user Object user
* @param timestamp $date Date creation
* @param int $date Date creation
* @return int <0 if KO, >0 if OK
*/
function set_date($user, $date)
@ -727,7 +737,7 @@ class RemiseCheque extends CommonObject
* Set the number of bordereau
*
* @param User $user Object user
* @param timestamp $number number of bordereau
* @param int $number number of bordereau
* @return int <0 if KO, >0 if OK
*/
function set_number($user, $number)

View File

@ -488,7 +488,7 @@ class Paiement extends CommonObject
$fac->thirdparty->name,
'company'
);
if ($result <= 0) dol_print_error($this->db);
if ($result <= 0) dol_syslog(get_class($this).'::addPaymentToBank '.$this->db->lasterror());
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
}
}
@ -506,7 +506,7 @@ class Paiement extends CommonObject
$fac->thirdparty->name,
'company'
);
if ($result <= 0) dol_print_error($this->db);
if ($result <= 0) dol_syslog(get_class($this).'::addPaymentToBank '.$this->db->lasterror());
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
}
}
@ -576,7 +576,7 @@ class Paiement extends CommonObject
/**
* Updates the payment date
*
* @param timestamp $date New date
* @param int $date New date
* @return int <0 if KO, 0 if OK
*/
function update_date($date)

View File

@ -121,10 +121,10 @@ else
else $sql.= " AND f.fk_user_author = ".$userid;
}
// Search criteria
if ($search_ref) $sql .=" AND p.rowid=".$search_ref;
if ($search_ref > 0) $sql .=" AND p.rowid=".$search_ref;
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
if ($search_paymenttype != "") $sql .=" AND c.code='".$search_paymenttype."'";
if ($search_amount) $sql .=" AND p.amount='".price2num($search_amount)."'";
if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
if ($search_amount) $sql .=" AND p.amount='".$db->escape(price2num($search_amount))."'";
if ($search_company) $sql .= natural_search('s.nom', $search_company);
}
$sql.= $db->order($sortfield,$sortorder);
@ -237,7 +237,7 @@ if ($resql)
if ($objp->statut == 0) print '</a>';
print '</td>';
}
print '<td>&nbsp;</td>';
print '</tr>';

View File

@ -403,7 +403,7 @@ class BonPrelevement extends CommonObject
* Set withdrawal to credited status
*
* @param User $user id of user
* @param timestamp $date date of action
* @param int $date date of action
* @return int >0 if OK, <0 if KO
*/
function set_infocredit($user, $date)
@ -525,7 +525,7 @@ class BonPrelevement extends CommonObject
* Set withdrawal to transmited status
*
* @param User $user id of user
* @param timestamp $date date of action
* @param int $date date of action
* @param string $method method of transmision to bank
* @return int >0 if OK, <0 if KO
*/
@ -667,9 +667,9 @@ class BonPrelevement extends CommonObject
{
$obj = $this->db->fetch_object($resql);
return $obj->nb;
$this->db->free($resql);
return $obj->nb;
}
else
{
@ -1161,7 +1161,7 @@ class BonPrelevement extends CommonObject
/**
* Delete a notification
*
* @param User $user notification user
* @param int $user notification user
* @param string $action notification action
* @return int >0 if OK, <0 if KO
*/
@ -1186,7 +1186,7 @@ class BonPrelevement extends CommonObject
* Add a notification
*
* @param DoliDB $db database handler
* @param User $user notification user
* @param int $user notification user
* @param string $action notification action
* @return int 0 if OK, <0 if KO
*/
@ -1625,7 +1625,7 @@ class BonPrelevement extends CommonObject
* Note: The tag PmtInf is opened here but closed into caller
*
* @param string $configuration conf
* @param date $ladate Date
* @param int $ladate Date
* @param int $nombre 0 or 1
* @param float $total Total
* @param string $CrLf End of line character

View File

@ -61,7 +61,7 @@ class LignePrelevement
* Recupere l'objet prelevement
*
* @param int $rowid id de la facture a recuperer
* @return void
* @return void|int
*/
function fetch($rowid)
{

View File

@ -71,7 +71,7 @@ class RejetPrelevement
* @param User $user User object
* @param int $id Id
* @param string $motif Motif
* @param timestamp $date_rejet Date rejet
* @param int $date_rejet Date rejet
* @param int $bonid Bon id
* @param int $facturation Facturation
* @return void
@ -272,7 +272,7 @@ class RejetPrelevement
/**
* Retrieve the list of invoices
*
* @return void
* @return array
*/
private function getListInvoices()
{
@ -318,7 +318,7 @@ class RejetPrelevement
* Retrieve withdrawal object
*
* @param int $rowid id of invoice to retrieve
* @return void
* @return int
*/
function fetch($rowid)
{

View File

@ -558,7 +558,6 @@ if ($conf->salaries->enabled)
$sql.= " WHERE p.entity = ".$conf->entity;
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
$sql.= " ORDER BY u.firstname";

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/compta/resultat/index.php
* \brief Page reporting resultat
* \brief Page reporting result
*/
require '../../main.inc.php';
@ -570,8 +570,8 @@ print '</tr>';
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right">'.$langs->trans("Outcome").'</td>';
print '<td align="right" class="borderrightlight">'.$langs->trans("Income").'</td>';
print '<td align="center">'.$langs->trans("Outcome").'</td>';
print '<td align="center" class="borderrightlight">'.$langs->trans("Income").'</td>';
}
print '</tr>';
@ -634,7 +634,7 @@ print "</tr>\n";
// Balance
$var=!$var;
print '<tr class="liste_total"><td>'.$langs->trans("Profit").'</td>';
print '<tr class="liste_total"><td>'.$langs->trans("AccountingResult").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right" colspan="2" class="borderrightlight"> ';

Some files were not shown because too many files have changed in this diff Show More