From 398e9bad942d2622c1a799eb1e39b36d0e79a086 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Sep 2015 18:35:18 +0200 Subject: [PATCH 1/6] Add ignore Conflicts: htdocs/.gitignore --- htdocs/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/.gitignore b/htdocs/.gitignore index e26ae1a0f45..0b4d7b82790 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -12,3 +12,4 @@ /test.php /ultimatepdf* /lead +/dolimed* From 8bea703363c927f99acf7a2cc595b59ebf49ad7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Sep 2015 19:42:07 +0200 Subject: [PATCH 2/6] Fix deadlock feature. Can't reconciliate cash bank account. Sometimes users need. I introduce a hidden option to fix this quickly. --- htdocs/compta/bank/class/account.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 72aa176b7b6..a7e55afb3cb 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -122,8 +122,10 @@ class Account extends CommonObject */ function canBeConciliated() { + global $conf; + if (empty($this->rappro)) return -1; - if ($this->courant == 2) return -2; + if ($this->courant == 2 && empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) return -2; if ($this->clos) return -3; return 1; } From 304a71710e0f2f47fd7d9d33b1903990543acfb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Sep 2015 00:57:11 +0200 Subject: [PATCH 3/6] Fix not complete info --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 298c580c170..a30c76e19d0 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -339,7 +339,7 @@ MinLength=Minimum length LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory ExamplesWithCurrentSetup=Examples with current running setup ListOfDirectories=List of OpenDocument templates directories -ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.

Put here full path of directories.
Add a carriage return between eah directory.
To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

Files in those directories must end with .odt. +ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.

Put here full path of directories.
Add a carriage return between eah directory.
To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

Files in those directories must end with .odt or .ods. NumberOfModelFilesFound=Number of ODT/ODS templates files found in those directories ExampleOfDirectoriesForModelGen=Examples of syntax:
c:\mydir
/home/mydir
DOL_DATA_ROOT/ecm/ecmdir FollowingSubstitutionKeysCanBeUsed=
To know how to create your odt document templates, before storing them in those directories, read wiki documentation: From a21b015cbba100f55644e47bceb0b1e5c203e6aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Sep 2015 20:03:02 +0200 Subject: [PATCH 4/6] Fix XSS --- htdocs/holiday/list.php | 2 +- htdocs/projet/card.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f5d67b13517..c350fb003e6 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -282,7 +282,7 @@ print "\n"; // FILTRES print ''; print ''; -print ''; +print ''; print ''; // DATE CREATE diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 49923afa2ea..24968839960 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -310,10 +310,11 @@ if (empty($reshook)) { $langs->load("other"); $upload_dir = $conf->projet->dir_output . "/"; - $file = $upload_dir . '/' . GETPOST('file'); + $urlfile=GETPOST('urlfile','alpha'); + $file = $upload_dir . '/' . $filetodelete; $ret=dol_delete_file($file); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", $urlfile)); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", $urlfile), 'errors'); } } From aaa639a3ab6fbe3d63dd4e9f425445f04331f035 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Sep 2015 14:54:25 +0200 Subject: [PATCH 5/6] Fix error when mark rate is 100% and buying price is 0, no way to recalculate the unit price. Fix cancel button was disabled if mark rate was not valid Fix if mark rate is a number with space, does not hang. --- htdocs/core/tpl/objectline_edit.tpl.php | 29 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 605b03d9c72..a9140c46dd0 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -23,7 +23,7 @@ * $object (invoice, order, ...) * $conf * $langs - * $seller, $nuyer + * $seller, $buyer * $dateSelector * $forceall (0 by default, 1 for supplier invoices/orders) * $senderissupplier (0 by default, 1 for supplier invoices/orders) @@ -259,6 +259,7 @@ if (! empty($conf->margin->enabled)) /* Init field buying_price and fournprice */ $.post('/fourn/ajax/getSupplierPrices.php', {'idprod': fk_product?$line->fk_product:0; ?>}, function(data) { + console.log(data); if (data && data.length > 0) { var options = ''; var trouve=false; @@ -302,9 +303,10 @@ if (! empty($conf->margin->enabled)) $('#savelinebutton').click(function (e) { return checkEditLine(e, "np_marginRate"); }); + /* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'. $("input[name='np_marginRate']:first").blur(function(e) { return checkEditLine(e, "np_marginRate"); - }); + });*/ global->DISPLAY_MARK_RATES)) @@ -313,9 +315,10 @@ if (! empty($conf->margin->enabled)) $('#savelinebutton').click(function (e) { return checkEditLine(e, "np_markRate"); }); + /* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'. $("input[name='np_markRate']:first").blur(function(e) { return checkEditLine(e, "np_markRate"); - }); + });*/ @@ -323,7 +326,7 @@ if (! empty($conf->margin->enabled)) /* If margin rate field empty, do nothing. */ - /* Force content of price_ht to 0 or if a discount is set recalculate it from margin rate */ + /* Force content of price_ht to 0 or if a discount is set, recalculate it from margin rate */ function checkEditLine(e, npRate) { var buying_price = $("input[name='buying_price']:first"); @@ -332,16 +335,16 @@ if (! empty($conf->margin->enabled)) var rate = $("input[name='"+npRate+"']:first"); if (rate.val() == '' || (typeof rate.val()) == 'undefined' ) return true; - if (! $.isNumeric(rate.val().replace(',','.'))) + if (! $.isNumeric(rate.val().replace(' ','').replace(',','.'))) { - alert('trans("rateMustBeNumeric"); ?>'); + alert('transnoentitiesnoconv("rateMustBeNumeric"); ?>'); e.stopPropagation(); setTimeout(function () { rate.focus() }, 50); return false; } if (npRate == "np_markRate" && rate.val() >= 100) { - alert('trans("markRateShouldBeLesserThan100"); ?>'); + alert('transnoentitiesnoconv("markRateShouldBeLesserThan100"); ?>'); e.stopPropagation(); setTimeout(function () { rate.focus() }, 50); return false; @@ -354,14 +357,20 @@ if (! empty($conf->margin->enabled)) { bpjs=price2numjs(buying_price.val()); ratejs=price2numjs(rate.val()); - /* console.log(npRate+" - "+bpjs+" - "+ratejs); */ if (npRate == "np_marginRate") - price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100)); + price = ((bpjs * (1 + (ratejs / 100))) / (1 - remisejs / 100)); else if (npRate == "np_markRate") - price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100)); + { + if (ratejs != 100) + { + price = ((bpjs / (1 - (ratejs / 100))) / (1 - remisejs / 100)); + } + else price=$("input[name='price_ht']:first").val(); + } } + /* console.log("new price ht = "+price); */ $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value return true; From 822d4d1b39f68af7fc5c3245d50b2559fbc09373 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Sep 2015 15:06:13 +0200 Subject: [PATCH 6/6] Fix remove log --- htdocs/core/tpl/objectline_edit.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index a9140c46dd0..4b024175423 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -259,8 +259,7 @@ if (! empty($conf->margin->enabled)) /* Init field buying_price and fournprice */ $.post('/fourn/ajax/getSupplierPrices.php', {'idprod': fk_product?$line->fk_product:0; ?>}, function(data) { - console.log(data); - if (data && data.length > 0) { + if (data && data.length > 0) { var options = ''; var trouve=false; $(data).each(function() {