diff --git a/include/class/class_acc_ledger.php b/include/class/class_acc_ledger.php index 192bc13ab..b1d8b0562 100644 --- a/include/class/class_acc_ledger.php +++ b/include/class/class_acc_ledger.php @@ -3976,6 +3976,33 @@ class Acc_Ledger extends jrn_def_sql $button = HtmlInput::button_anchor(_("Nouvelle opération"), 'do.php?'.$url); return '

'.$button.'

'; } - + /** + *@brief Show a button to create an operation identical to the recorded + * one. It is a form POST since it is a limit with get + */ + public function copy_information() + { + echo '
'; + echo HtmlInput::post_to_hidden( + array("gDossier","ac","p_jrn","e_client","nb_item") + ); + echo HtmlInput::hidden("correct","copy"); + // e_march + $nb=HtmlInput::default_value_post("nb_item",0); + for ( $i=0;$i<$nb;$i++) + { + echo HtmlInput::post_to_hidden( + array( + "e_march".$i, + "e_march".$i."_price", + "e_march".$i."_quant", + "e_march".$i."_label", + "e_march".$i."_tva_amount" + )); + } + echo HtmlInput::submit("copy_operation",_("Même opération")); + + echo '
'; + } } ?> \ No newline at end of file diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index b5a14ea98..9d3ae2489 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -199,6 +199,7 @@ if (isset($_POST['record'])) } } echo $Ledger->button_new_operation(); + echo $Ledger->copy_operation(); echo ''; return; } diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index 068c1e768..32ccd4b7e 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -130,13 +130,13 @@ elseif (isset($_POST['save'])) } echo $ledger->button_new_operation(); - + echo $Ledger->copy_operation(); } 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 4fe073afb..aec0b24cd 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -216,7 +216,7 @@ show_tab(a_tab,'facturation_div_id'); } echo $Ledger->button_new_operation(); - + echo $Ledger->copy_operation(); echo ''; return; }