Skip to content

Commit 599aed4

Browse files
committed
Debug save of the ecotax completary text
1 parent ed0f24e commit 599aed4

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

htdocs/ecotaxdeee/admin/index.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
2222
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
2323
if (! $res) die("Include of main fails");
24-
24+
/**
25+
* @var Conf $conf
26+
* @var DoliDB $db
27+
* @var Translate $langs
28+
* @var User $user
29+
*/
2530
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
2631
require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
2732
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
@@ -37,6 +42,8 @@
3742

3843
$action = GETPOST("action", 'aZ09');
3944

45+
$error = 0;
46+
4047

4148
/*
4249
* Actions
@@ -49,7 +56,7 @@
4956
$res = dolibarr_set_const($db, 'ECOTAXDEEE_USE_ON_CUSTOMER_ORDER', trim(GETPOST("ECOTAXDEEE_USE_ON_CUSTOMER_ORDER")), 'chaine', 0, '', $conf->entity);
5057
$res = dolibarr_set_const($db, 'ECOTAXDEEE_USE_ON_CUSTOMER_INVOICE', trim(GETPOST("ECOTAXDEEE_USE_ON_CUSTOMER_INVOICE")), 'chaine', 0, '', $conf->entity);
5158
$res = dolibarr_set_const($db, 'ECOTAXDEEE_LABEL_LINE', trim(GETPOST("ECOTAXDEEE_LABEL_LINE")), 'chaine', 0, '', $conf->entity);
52-
$res = dolibarr_set_const($db, 'ECOTAXDEEE_DOC_FOOTER', trim(GETPOST("ECOTAXDEEE_DOC_FOOTER")), 'chaine', 0, '', $conf->entity);
59+
$res = dolibarr_set_const($db, 'ECOTAXDEEE_DOC_FOOTER', trim(dol_string_nohtmltag(GETPOST("ECOTAXDEEE_DOC_FOOTER", 'restricthtml'), 2, 'UTF-8', 0, 0)), 'chaine', 0, '', $conf->entity);
5360

5461
$product_wee=$_POST["WEEE_PRODUCT_ID"];
5562
if ($product_wee < 0) {
@@ -194,7 +201,7 @@
194201
print '<tr class="oddeven">';
195202
print "<td>".$langs->trans("ECOTAXDEEE_DOC_FOOTER")." (Dolibarr 3.6+)</td>";
196203
print "<td>";
197-
$selectedvalue=getDolGlobalString('ECOTAXDEEE_DOC_FOOTER');
204+
$selectedvalue = getDolGlobalString('ECOTAXDEEE_DOC_FOOTER');
198205
$doleditor=new DolEditor("ECOTAXDEEE_DOC_FOOTER", $selectedvalue, '', '250', 'dolibarr_details', 'In', 1, 1, 1, ROWS_8, '90%');
199206
$doleditor->Create(0, '');
200207
print '<br>';

htdocs/ecotaxdeee/admin/setup.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
3636
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
3737
if (! $res) die("Include of main fails");
38-
38+
/**
39+
* @var Conf $conf
40+
* @var DoliDB $db
41+
* @var Translate $langs
42+
* @var User $user
43+
*/
3944
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
4045
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
4146
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
@@ -55,8 +60,7 @@
5560

5661
$action = GETPOST('action', 'alpha');
5762
$code = GETPOST('codeecotax');
58-
$amount = GETPOST('amount');
59-
63+
$amount = (float) price2num(GETPOST('amount'), '', 2);
6064

6165

6266
if ($action == 'save') {
@@ -90,7 +94,7 @@
9094
$object = $ecotax->fetch($key);
9195

9296
$code_update = (empty(GETPOST('codeecotax')) ? $object->code : GETPOST('codeecotax'));
93-
$amount_update = (empty(GETPOST('amount')) ? $object->amount : GETPOST('amount'));
97+
$amount_update = (empty(GETPOST('amount')) ? $object->amount : $amount);
9498
$ecotax->code = $code_update;
9599
$ecotax->amount = $amount_update;
96100
$result = $ecotax->update($key);

0 commit comments

Comments
 (0)