diff --git a/.travis.yml b/.travis.yml
index db0f3196cf8..509578e57ef 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,7 @@ php:
- '5.3'
- '5.4'
- '5.5'
-- '5.6.29'
+- '5.6'
- '7.0'
- '7.1'
- nightly
diff --git a/ChangeLog b/ChangeLog
index 9cd6f11d1b8..2417a7db682 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,10 +4,127 @@ English Dolibarr ChangeLog
***** ChangeLog for 6.0.0 compared to 5.0.* *****
+NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
+NEW: Add a payment module for Stripe.
+NEW: Add module "Product variant" (like red, blue for the product shoes)
+NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC)
+NEW: Add a tracking id into mass emailing.
+NEW: Tax system more compatible with the new tax roollout in India (IGST / CGST / SGST).
+NEW: Add calculation function for Loan schedule
+NEW: Add "depends on" and "required by" into module informations
+NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO
+NEW: Add key __USERID__ and __ENTITYID__ as key for dynamic filters.
+NEW: Add last activation author and ip of modules
+NEW: Add mass actions (pdf merge and delete) for interventions
+NEW: Add module resources import/export
+NEW: Add option PROJECT_THIRDPARTY_REQUIRED
+NEW: Add page statistics for project tasks
+NEW: add property to show warnings when activating modules
+NEW: add rapport file for supplier paiement
+NEW: Add statistics on supplier tab.
+NEW: Add tooltip help on shipment weight and volume calculation
+NEW: An external module can hook and add mass actions
+NEW: Better reponsive design
+NEW: Bookmarks are into a combo list.
+NEW: Bulk actions available on supplier orders
+NEW: Can add a background image on login page
+NEW: Can change customer from POS
+NEW: Can clone expense report on another user
+NEW: Can control constants values into file integrity checker
+NEW: Can define default values for create forms.
+NEW: Can define default filters for list pages.
+NEW: Can define default sort order for list pages.
+NEW: Can deploy an external module from the module setup area.
+NEW: Can disable all overwrote translations in one click.
+NEW: Can edit background color for odd and even lines in tables
+NEW: Can filter on code in dictionnaries
+NEW: Can filter on year and product tags on the product statistic page
+NEW: Can import users
+NEW: Can read time spent of others (hierarchy only or all if granted)
+NEW: Can send an email to a user from its card.
+NEW: Can send email to multiple destinaries from the mailform combo list.
+NEW: Can set margins of PDFs
+NEW: Can set number of dump to keep with job "local database backup"
+NEW: Can sort customer balance summary on date.
+NEW: Can sort thumbs visible on product card.
+NEW: Can use a credit note into a "down payment/deposit".
+NEW: Can use dol_fiche_end without showing bottom border.
+NEW: Can use translations into all substitutions (watermark, freetext...)
+NEW: Change to allow a specific numbering rule for invoice with POS module.
+NEW: convert exceiss received to reduc
+NEW: custom dir is enabled dy default on first install.
+NEW: Description of feature of a module visible into a dedicated popup.
+NEW: Direct open of card after a search if one record only found.
+NEW: download button
+NEW: Enable bulk actions delete on supplier invoices.
+NEW: Extrafields support formulas to be computed using PHP expressions.
+NEW: Feature to crop/resize images available on user and expense reports.
+NEW: Filechecker can include custom dir and report added files.
+NEW: fix listview class and add a demo for product list
+NEW: [FP17] Accountancy - Add select field in list of accounts
+NEW: get amount base on hourly rate for ficheinter
+NEW: hidden Easter egg to display commitstrip strip on login page
+NEW: Include an hourglass icon when we click on online payment button
+NEW: Index upload files into database.
+NEW: Introduce mass action on product list ('delete' for the moment)
+NEW: Introduce mass actions on contacts
+NEW: Introduce option MAIN_HTTP_CONTENT_SECURITY_POLICY
+NEW: It's easier to switch between sandbox and live for paypal
+NEW: Mass action delete available on project and tasks
+NEW: Move login information on home page into a widget
+NEW: new demo entry page
+NEW: No external check of version without explicit click in about page.
+NEW: ODT docs for USER USERGROUP CONTRACT and PRODUCT class
+NEW: odt usergroup
+NEW: On invoices generated by template, we save if invoice come from a source template.
+NEW: option to copy into attachement files of events, files send by mail (with auto event creation)
+NEW: PDF with numbertoword
+NEW: Permit multiple file upload in linked documents
+NEW: PHP 7.1 compatibility
+NEW: Reduce memory usage by removing deprecated constant loading.
+NEW: Report page and menu for suppliers paiements
+NEW: Show by default README.md file found into root dir of ext module.
+NEW: Show company into combo list of projects
+NEW: show files in the bank statement + download
+NEW: Show local taxes in facture list
+NEW: Show local taxes in supplier facture list
+NEW: Small PDF template for products
+NEW: Option SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT
+NEW: The substitution keys available for emailing edition are now visible into a popup.
+NEW: Uniformize behaviour: Action to make order is an action button.
+NEW: Use autocompletion on the "Add widget list".
+NEW: Use html5 type "number" on select field for year and duration.
+NEW: Can use pdktk to concat mass pdf because tcpdf generate avoid to split large file into multiple smaller file (all have same size) encounter issue with mailer provider virtual delivery service
+NEW: Default theme of v6 is cleaner.
+NEW: When down payment is entered, discount to reuse into final invoice is automatically created. This save one click into invoice workflow.
+NEW: Add UI to configure MEMBER_NEWFORM_FORCETYPE
+NEW: #2763 Go to document block after clicking in Generate document button
+NEW: #6280: Generate PDF after creating an invoice from a customer order
+NEW: #6915 Simplest change.
+NEW: Uniformize the look and feel with v6 new look.
+
For developers:
NEW: Add a lot of API REST: dictionaryevents, memberstypes, ...
NEW: Big refactorization of multicompany transverse mode.
NEW: getEntity function use true $shared value by default.
+NEW: Add font-awesome css.
+NEW: Add function ajax_autoselect
+NEW: Add function dolMd2Html
+NEW: Add hook doUpgrade2
+NEW: Add hook "formatNotificationMessage"
+NEW: Add index and constraints keys on supplier proposal detail table
+NEW: Add phpunit to check the engine is defined into sql create files.
+NEW: Add project and Hook to Loan
+NEW: Add REST API to push a file.
+NEW: Allow extrafields list select to be dependands on other standard list and not only other extrafields list
+NEW: Architecture to manage search criteria persistance (using save_lastsearch_values=1 on exit links and restore_lastsearch_values=1 in entry links)
+NEW: data files are now also parsed by phpunit for sql syntax
+NEW: Hook to allow inserting custom product head #6001
+NEW: Introduce fields that can be computed during export in export profiles.
+NEW: Introduce function dol_compress_dir
+NEW: Removed commande_pdf_create, contract_pdf_create,expedition_pdf_create, facture_pdf_create, delivery_order_pdf_create, task_pdf_create, project_pdf_create, propale_pdf_create, supplier_invoice_pdf_create, supplier_order_pdf_create, supplier_proposal_pdf_create deprecated functions
+NEW: tooltip can be on hover or on click with textwithpicto function.
+NEW: Upgrade jquery to 3.3.1 and jquery-ui to 1.12
WARNING:
diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss
index 34757a5123a..2ef8ab32f22 100644
--- a/build/exe/doliwamp/doliwamp.iss
+++ b/build/exe/doliwamp/doliwamp.iss
@@ -353,10 +353,12 @@ begin
begin
// TODO Copy file or ask to install package ?
//CustomMessage('YouWillInstallDoliWamp')+#13#13
- MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
+ MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
end;
-
-
+ // Pb seems similar with msvcp110.dll
+ //vcredist_x64.exe
+
+
// If we have a new database version, we should only copy old my.ini file into new directory
// and change only all basedir= strings to use new version. Like this, data dir is still correct.
// Install of service and stop/start scripts are already rebuild by installer.
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index c2d983653cb..1843f3c8cfd 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -592,6 +592,8 @@ if ($nboftargetok) {
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
+ print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
+ $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
}
# Build package for each target
@@ -972,9 +974,11 @@ if ($nboftargetok) {
$ret=`$cmd`;
$ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`;
+ $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`;
+ $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_myobject.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`;
- $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject_api_class.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`;
+ $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`;
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`;
diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec
index 33dc951309d..55898481691 100755
--- a/build/rpm/dolibarr_fedora.spec
+++ b/build/rpm/dolibarr_fedora.spec
@@ -162,6 +162,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
+%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec
index 42a89675abf..e5b346278ab 100755
--- a/build/rpm/dolibarr_generic.spec
+++ b/build/rpm/dolibarr_generic.spec
@@ -242,6 +242,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
+%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec
index 9dd2100b02c..04a3138d9f9 100755
--- a/build/rpm/dolibarr_mandriva.spec
+++ b/build/rpm/dolibarr_mandriva.spec
@@ -159,6 +159,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
+%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec
index d780c47da99..c77661fe420 100755
--- a/build/rpm/dolibarr_opensuse.spec
+++ b/build/rpm/dolibarr_opensuse.spec
@@ -170,6 +170,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
+%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 9b82bd05b2a..3b9ef4cc447 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -5,7 +5,7 @@ in Dolibarr root.
ALL:
----
-Check "DOL_CHANGE"
+Check "@CHANGE"
CKEDITOR (4.6.2):
diff --git a/dev/resources/iso-normes/world_tax_rates.txt b/dev/resources/iso-normes/world_tax_rates.txt
index e5bb64a86f2..740062288dc 100644
--- a/dev/resources/iso-normes/world_tax_rates.txt
+++ b/dev/resources/iso-normes/world_tax_rates.txt
@@ -1 +1,4 @@
-http://www.taxrates.cc/index.html
\ No newline at end of file
+http://www.taxrates.cc/index.html
+
+For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst
+
diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php
index 9136c192739..f65cefd7f94 100755
--- a/dev/translation/sanity_check_en_langfiles.php
+++ b/dev/translation/sanity_check_en_langfiles.php
@@ -25,7 +25,7 @@ $path=dirname(__FILE__).'/';
$web=0;
// Test if batch mode
-if (substr($sapi_type, 0, 3) == 'cgi')
+if (substr($sapi_type, 0, 3) == 'cgi')
{
$web=1;
}
@@ -35,9 +35,9 @@ if ($web)
{
echo "";
echo "
";
-
+
echo "";
-
+
echo "";
}
@@ -142,9 +142,9 @@ foreach ($files AS $file) {
}
}
-foreach ($langstrings_3d AS $filename => $file)
+foreach ($langstrings_3d AS $filename => $file)
{
- foreach ($file AS $linenum => $value)
+ foreach ($file AS $linenum => $value)
{
$keys = array_keys($langstrings_full, $value);
if (count($keys)>1)
@@ -173,11 +173,11 @@ $sininstallandadmin='';
$sother='';
$count = 0;
-foreach ($dups as $string => $pages)
+foreach ($dups as $string => $pages)
{
$count++;
$s='';
-
+
// Keyword $string
if ($web) $s.="
";
if ($web) $s.="
";
@@ -188,32 +188,32 @@ foreach ($dups as $string => $pages)
if ($web) $s.="
";
if ($web) $s.="
";
if (! $web) $s.= ' : ';
-
+
// Loop on each files keyword was found
$duplicateinsamefile=0;
$inmain=0;
$inadmin=0;
- foreach ($pages AS $file => $lines)
+ foreach ($pages AS $file => $lines)
{
if ($file == 'main.lang') { $inmain=1; $inadmin=0; }
if ($file == 'admin.lang' && ! $inmain) { $inadmin=1; }
-
+
$s.=$file." ";
-
+
// Loop on each line keword was found into file.
$listoffilesforthisentry=array();
- foreach ($lines as $line => $translatedvalue)
+ foreach ($lines as $line => $translatedvalue)
{
if (! empty($listoffilesforthisentry[$file])) $duplicateinsamefile=1;
$listoffilesforthisentry[$file]=1;
-
+
$s.= "(".$line." - ".htmlentities($translatedvalue).") ";
}
if ($web) $s.=" ";
}
if ($web) $s.="
";
$s.="\n";
-
+
if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
else if ($inmain) $sinmainandother .= $s;
else if ($inadmin) $sininstallandadmin .= $s;
@@ -252,7 +252,7 @@ if ($web)
if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true'))
{
print "***** Strings in en_US that are never used:\n";
-
+
$unused=array();
foreach ($langstrings_dist AS $value => $line)
{
@@ -288,7 +288,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
if (preg_match('/^JuridicalStatus/', $value)) $qualifiedforclean=0;
if (preg_match('/^CalcMode/', $value)) $qualifiedforclean=0;
if (preg_match('/^newLT/', $value)) $qualifiedforclean=0;
- if (preg_match('/^LT\d/', $value)) $qualifiedforclean=0;
+ if (preg_match('/^LT[0-9]/', $value)) $qualifiedforclean=0;
if (preg_match('/^TypeContact_contrat_/', $value)) $qualifiedforclean=0;
if (preg_match('/^ErrorPriceExpression/', $value)) $qualifiedforclean=0;
if (preg_match('/^Language_/', $value)) $qualifiedforclean=0;
@@ -315,7 +315,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
// orders
if (preg_match('/^OrderSource/', $value)) $qualifiedforclean=0;
if (preg_match('/^TypeContact_/', $value)) $qualifiedforclean=0;
- // other.lang
+ // other.lang
if (preg_match('/^Notify_/', $value)) $qualifiedforclean=0;
if (preg_match('/^PredefinedMail/', $value)) $qualifiedforclean=0;
if (preg_match('/^DemoCompany/', $value)) $qualifiedforclean=0;
@@ -336,17 +336,17 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
if (preg_match('/OppStatus/', $value)) $qualifiedforclean=0;
if (preg_match('/AvailabilityType/', $value)) $qualifiedforclean=0;
if (preg_match('/CardProduct/', $value)) $qualifiedforclean=0;
-
+
if (preg_match('/sms/i', $value)) $qualifiedforclean=0;
if (preg_match('/TF_/i', $value)) $qualifiedforclean=0;
if (preg_match('/WithBankUsing/i', $value)) $qualifiedforclean=0;
if (preg_match('/descWORKFLOW_/i', $value)) $qualifiedforclean=0;
-
+
if (! $qualifiedforclean)
{
- continue;
+ continue;
}
-
+
//$search = '\'trans("'.$value.'")\'';
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')" -e "('.$value.',"';
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
@@ -356,7 +356,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
$unused[$value] = $line;
echo $line; // $trad contains the \n
}
- else
+ else
{
unset($output);
//print 'X'.$output.'Y';
@@ -364,7 +364,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
}
if (empty($unused)) print "No string not used found.\n";
- else
+ else
{
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index e369081f7e1..905fd8b97ef 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -97,7 +97,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_account = "";
$search_label = "";
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index 311aab692ff..c72ce8cc134 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -98,7 +98,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_ref = '';
$search_label = '';
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index e742f4651cf..fb503c17ca0 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -98,7 +98,7 @@ if (! empty($search_accountancy_code_end)) {
* Action
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index c6d84ec9b57..d05dc11ed26 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -72,15 +72,24 @@ if ($action == "confirm_update") {
$error = 0;
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
- setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
- $error ++;
+ $error++;
+ setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
+ $action='update';
}
+ if (empty($account_number) || $account_number == '-1')
+ {
+ $error++;
+ setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
+ $action='update';
+ }
- if (empty($error)) {
+ if (! $error)
+ {
$book = new BookKeeping($db);
$result = $book->fetch($id, null, $mode);
if ($result < 0) {
+ $error++;
setEventMessages($book->error, $book->errors, 'errors');
} else {
$book->numero_compte = $account_number;
@@ -120,12 +129,20 @@ if ($action == "confirm_update") {
else if ($action == "add") {
$error = 0;
- if (empty($debit) && empty($credit)) {
- setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
- $error ++;
+ if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
+ {
+ $error++;
+ setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
+ $action='';
+ }
+ if (empty($account_number) || $account_number == '-1')
+ {
+ $error++;
+ setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
+ $action='';
}
- if (empty($error)) {
+ if (! $error) {
$book = new BookKeeping($db);
$book->numero_compte = $account_number;
@@ -567,7 +584,7 @@ if ($action == 'create') {
if ($action == 'update' && $line->id == $id) {
print '
';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
@@ -583,8 +600,8 @@ if ($action == 'create') {
print '
';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
@@ -638,24 +655,30 @@ if ($action == 'create') {
print '
";
}
print '';
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 114b765e658..93968644a8f 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2013-2016 Florian Henry
- * Copyright (C) 2013-2017 Alexandre Spangaro
- * Copyright (C) 2016 Laurent Destailleur
+/* Copyright (C) 2013-2016 Olivier Geffroy
+ * Copyright (C) 2013-2016 Florian Henry
+ * Copyright (C) 2013-2017 Alexandre Spangaro
+ * Copyright (C) 2016-2017 Laurent Destailleur
*
* 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
@@ -16,7 +16,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
*/
/**
@@ -112,7 +111,7 @@ if ($action != 'export_file' && ! isset($_POST['begin']) && ! isset($_GET['begin
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_mvt_num = '';
$search_doc_type = '';
@@ -377,28 +376,28 @@ print '
';
-print $langs->trans('From');
+print $langs->trans('From').' ';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
@@ -411,7 +410,7 @@ else
}
print '
';
print '
';
-print $langs->trans('to');
+print $langs->trans('to').' ';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
@@ -455,7 +454,10 @@ print "