From b1cafb3e70575830bad449eb38bf278d9b902345 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 29 Feb 2016 01:31:07 +0100 Subject: [PATCH] Bug : remove information when coming from an operation template --- html/js/acc_ledger.js | 1 - include/class/class_acc_ledger_sold.php | 1 - include/compta_ach.inc.php | 4 ++-- include/compta_fin.inc.php | 2 +- include/compta_ven.inc.php | 4 ++-- include/operation_ods_new.inc.php | 4 ++-- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js index 487a40d51..ad61786f7 100644 --- a/html/js/acc_ledger.js +++ b/html/js/acc_ledger.js @@ -241,7 +241,6 @@ function success_update_bank(req) */ function get_last_date() { - if (String.trim(document.getElementsByName('e_date')[0].value) != "") return; var jrn = g('p_jrn').value; var dossier = g('gDossier').value; var qs = 'gDossier=' + dossier + '&op=lastdate&p_jrn=' + jrn; diff --git a/include/class/class_acc_ledger_sold.php b/include/class/class_acc_ledger_sold.php index aa1733435..cfc81d173 100644 --- a/include/class/class_acc_ledger_sold.php +++ b/include/class/class_acc_ledger_sold.php @@ -1028,7 +1028,6 @@ EOF; else $op_date = (!isset($e_date) ) ? '' : $e_date; - $e_ech = (isset($e_ech)) ? $e_ech : ""; $e_comm = (isset($e_comm)) ? $e_comm : ""; diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 240e85dfd..fa0fa2544 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -254,7 +254,7 @@ try $payment=HtmlInput::default_value_request("e_mp", 0); echo "
"; /* request for a predefined operation */ - if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct'])) + if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct']) && ! isset($correct) ) { // used a predefined operation // @@ -296,7 +296,7 @@ catch (Exception $e) alert($e->getMessage()); return; } -if (!isset($_POST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y') +if (!isset($_REQUEST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y') echo create_script(" get_last_date()"); echo create_script(" update_name()"); echo ''; diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php index 136b567eb..fdeae116a 100644 --- a/include/compta_fin.inc.php +++ b/include/compta_fin.inc.php @@ -151,7 +151,7 @@ try echo HtmlInput::submit('save',_('Sauve')); echo HtmlInput::reset(_('Effacer')); - if ( ! isset ($_POST['e_date'])&& $g_parameter->MY_DATE_SUGGEST=='Y') + if ( ! isset($_REQUEST['e_date'])&& $g_parameter->MY_DATE_SUGGEST=='Y') { echo create_script(" get_last_date();ajax_saldo('first_sold');"); }else { diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index 68877f106..d7ffd22e6 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -269,7 +269,7 @@ try echo ""; /* request for a predefined operation */ - if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct'])) + if (isset($_REQUEST['pre_def'])&&!isset($_POST['correct']) && ! isset($correct)) { // used a predefined operation // @@ -334,7 +334,7 @@ echo '
'; { echo ''; } - if (!isset($_POST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y') + if (!isset($_REQUEST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y') { echo create_script(" get_last_date()"); } diff --git a/include/operation_ods_new.inc.php b/include/operation_ods_new.inc.php index 396b87143..99e8a5a86 100644 --- a/include/operation_ods_new.inc.php +++ b/include/operation_ods_new.inc.php @@ -61,7 +61,7 @@ echo '
'; // Show the predef operation // Don't forget the p_jrn $p_post=$_POST; -if ( isset ($_GET['action']) && ! isset($_POST['correct'])) +if ( isset ($_GET['action']) && ! isset($_POST['correct']) && ! isset($correct) ) { if ( $_GET['action']=='use_opd') { @@ -108,7 +108,7 @@ echo '
'; echo ""; echo create_script(" update_name()"); -if ($g_parameter->MY_DATE_SUGGEST=='Y') +if (!isset($_REQUEST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y') { echo create_script(" get_last_date()"); }