From 702052f55227f7c40142705e89a8ed385b52243f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 23 Jan 2017 20:27:31 +0100 Subject: [PATCH 1/3] Fix Bug : Predefined operation in Sales , impossible to add new items --- include/class/class_pre_op_ven.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/class/class_pre_op_ven.php b/include/class/class_pre_op_ven.php index 26e322d0a..1e9dbb866 100644 --- a/include/class/class_pre_op_ven.php +++ b/include/class/class_pre_op_ven.php @@ -30,10 +30,11 @@ require_once NOALYSS_INCLUDE.'/class/class_pre_operation.php'; class Pre_op_ven extends Pre_operation_detail { var $op; + //< Pre_operation function __construct($cn,$p_id=0) { parent::__construct($cn,$p_id); - $this->operation->od_direct='f'; + $this->operation->od_direct='f'; //< Pre_operation } function get_post() @@ -137,7 +138,13 @@ class Pre_op_ven extends Pre_operation_detail } } } - $array['nb_item']=$count; + // Find the ledger + $ledger=new Acc_Ledger($this->db,$this->operation->jrn_def_id); + // Find the max line of the ledger + $max_row=$ledger->GetDefLine(); + + // compute nb_item + $array['nb_item']=($max_row > $count)?$max_row:$count; return $array; } /*!\brief load the data from the database and return an array From 24862178182f1bced39daa843754e69bcb562f1b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 23 Jan 2017 20:33:05 +0100 Subject: [PATCH 2/3] Fix bug : duplicate doesn't take in account the TVA_ID --- include/class/class_acc_ledger.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/class/class_acc_ledger.php b/include/class/class_acc_ledger.php index f8b8d8190..3417b2567 100644 --- a/include/class/class_acc_ledger.php +++ b/include/class/class_acc_ledger.php @@ -3996,6 +3996,7 @@ class Acc_Ledger extends jrn_def_sql "e_march".$i."_price", "e_march".$i."_quant", "e_march".$i."_label", + "e_march".$i."_tva_id", "e_march".$i."_tva_amount" )); } From 3c922f98fb5919e20f811a254f4c2d4e15e99ba3 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 23 Jan 2017 20:48:27 +0100 Subject: [PATCH 3/3] Esthetic for duplicate operation & Correct esthetic --- include/class/class_acc_ledger.php | 11 ++++++++--- include/compta_ach.inc.php | 8 +++++++- include/compta_ods.inc.php | 14 ++++++++++---- include/compta_ven.inc.php | 7 ++++++- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/include/class/class_acc_ledger.php b/include/class/class_acc_ledger.php index 3417b2567..b28b52280 100644 --- a/include/class/class_acc_ledger.php +++ b/include/class/class_acc_ledger.php @@ -3972,7 +3972,7 @@ class Acc_Ledger extends jrn_def_sql function button_new_operation() { $url=http_build_query(array('ac'=>$_REQUEST['ac'],'gDossier'=>$_REQUEST['gDossier'],'p_jrn'=>$_REQUEST['p_jrn'])); - $button = HtmlInput::button_anchor(_("Nouvelle opération"), 'do.php?'.$url); + $button = HtmlInput::button_anchor(_("Nouvelle opération"), 'do.php?'.$url,"","","smallbutton"); return '

'.$button.'

'; } /** @@ -3983,7 +3983,7 @@ class Acc_Ledger extends jrn_def_sql { echo '
'; echo HtmlInput::post_to_hidden( - array("gDossier","ac","p_jrn","e_client","nb_item") + array("gDossier","ac","p_jrn","e_client","nb_item","desc","e_comm") ); echo HtmlInput::hidden("correct","copy"); // e_march @@ -3997,7 +3997,12 @@ class Acc_Ledger extends jrn_def_sql "e_march".$i."_quant", "e_march".$i."_label", "e_march".$i."_tva_id", - "e_march".$i."_tva_amount" + "e_march".$i."_tva_amount", + "poste".$i, + "ld".$i, + "amount".$i, + "ck".$i + )); } echo HtmlInput::submit("copy_operation",_("Même opération")); diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 099e404cf..f7623ebc7 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -198,9 +198,15 @@ if (isset($_POST['record'])) echo '

'._('Date invalide, opération non extournée').'

'; } } + echo '
    '; + echo "
  • "; echo $Ledger->button_new_operation(); + echo "
  • "; + echo "
  • "; echo $Ledger->button_copy_operation(); - echo ''; + echo "
  • "; + echo "
"; + echo ''; return; } } diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index be27c9e33..d4dd5bdae 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -19,7 +19,8 @@ // Copyright Author Dany De Bontridder danydb@aevalys.eu -/**\file +/** + * \file * * * \brief to write directly into the ledgers,the stock and the tables @@ -128,15 +129,20 @@ elseif (isset($_POST['save'])) echo '

'._('Date invalide, opération non extournée').'

'; } } - + echo '
    '; + echo "
  • "; echo $ledger->button_new_operation(); - echo $Ledger->button_copy_operation(); + echo "
  • "; + echo "
  • "; + echo $ledger->button_copy_operation(); + echo "
  • "; + echo "
"; } catch (Exception $e) { require NOALYSS_INCLUDE.'/operation_ods_new.inc.php'; alert($e->getMessage()); - $p_msg=$e->getMessage(); + $p_msg=$e->getMessage(); } echo ''; return; diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index c4825320f..cd76f170e 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -214,9 +214,14 @@ show_tab(a_tab,'facturation_div_id'); echo '

'._('Date invalide, opération non extournée').'

'; } } - + echo '
    '; + echo "
  • "; echo $Ledger->button_new_operation(); + echo "
  • "; + echo "
  • "; echo $Ledger->button_copy_operation(); + echo "
  • "; + echo "
"; echo ''; return; }