From 28cba09d46af27eacec669c44a30d23cb34d2421 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 12 Jul 2010 19:04:57 +0000 Subject: [PATCH] FS#125 - after saving, for the different ledger we have a link to the detail of the operation --- include/class_acc_ledger_purchase.php | 2 +- include/class_acc_ledger_sold.php | 2 +- include/compta_ach.inc.php | 7 +++++-- include/compta_fin.inc.php | 2 +- include/compta_ven.inc.php | 10 ++++++++-- include/quick_writing.inc.php | 6 +++++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php index 462194a3d..0018c2581 100644 --- a/include/class_acc_ledger_purchase.php +++ b/include/class_acc_ledger_purchase.php @@ -64,7 +64,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger { /* check for a double reload */ - if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 ) + if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 ) throw new Exception (_('Double Encodage'),5); /* check if there is a customer */ diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php index bdeeaa9c3..cb3a45528 100644 --- a/include/class_acc_ledger_sold.php +++ b/include/class_acc_ledger_sold.php @@ -57,7 +57,7 @@ class Acc_Ledger_Sold extends Acc_Ledger { public function verify($p_array) { extract ($p_array); /* check for a double reload */ - if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 ) + if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 ) throw new Exception (_('Double Encodage'),5); /* check if we can write into this ledger */ diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 5462006c1..bc9dc0845 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -158,7 +158,9 @@ if ( $def==1 || $def == 4 ) { } /* Show button */ - echo '

'.$Ledger->get_name().'

'; + $jr_id=$cn->get_value('select jr_id from jrn where jr_internal=$1',array($internal)); + + echo '

'.$Ledger->get_name().'

'; echo "

"._('Opération sauvée')." $internal "; if ( $Ledger->pj != '') echo ' Piece : '.h($Ledger->pj); echo "

"; @@ -171,7 +173,8 @@ if ( $def==1 || $def == 4 ) { /* Save the additional information into jrn_info */ $obj=new Acc_Ledger_Info($cn); $obj->save_extra($Ledger->jr_id,$_POST); - + printf ('%s
', + $jr_id,dossier::id(),$internal); echo HtmlInput::button_anchor(_('Nouvelle dépense'),$href.'?p_action=ach&sa=n&'.dossier::get()); echo ''; exit(); diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php index 1749298b1..71814d999 100644 --- a/include/compta_fin.inc.php +++ b/include/compta_fin.inc.php @@ -148,7 +148,7 @@ if ( $def == 1 ) { if ( !isset($correct)) { echo '
'; $a= $Ledger->insert($_POST); - echo '

'._('Opération sauvée').'

'; + echo '

'._('Opération sauvée').'

'; echo $a; echo '
'; echo '
'; diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index ccdc4a8c1..e51c035e9 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -171,16 +171,22 @@ if ( $def==1 || $def == 4 ) { } /* Show button */ - echo '

'.$Ledger->get_name().'

'; - echo "

"._('Opération sauvée')." $internal "; + echo '

'.$Ledger->get_name().'

'; + $jr_id=$cn->get_value('select jr_id from jrn where jr_internal=$1',array($internal)); + + echo "

"._('Opération sauvée'); if ( $Ledger->pj != '') echo ' Piece : '.h($Ledger->pj); echo "

"; if ( strcmp($Ledger->pj,$_POST['e_pj']) != 0 ) { echo '

'._('Attention numéro pièce existante, elle a du être adaptée').'

'; } + + printf ('%s
', + $jr_id,dossier::id(),$internal); /* Show link for Invoice */ if (isset ($Ledger->doc) ) { echo $Ledger->doc; echo '
';} + /* Save the additional information into jrn_info */ $obj=new Acc_Ledger_Info($cn); $obj->save_extra($Ledger->jr_id,$_POST); diff --git a/include/quick_writing.inc.php b/include/quick_writing.inc.php index 2ea6a2688..565fe3c60 100644 --- a/include/quick_writing.inc.php +++ b/include/quick_writing.inc.php @@ -283,10 +283,14 @@ if ( isset($_POST['save_it' ])) { try { $ledger->save($array); - echo '

Opération enregistrée '.$ledger->jr_internal.' Piece '.h($ledger->pj).'

'; + $jr_id=$cn->get_value('select jr_id from jrn where jr_internal=$1',array($ledger->internal)); + + echo '

Opération enregistrée Piece '.h($ledger->pj).'

'; if ( strcmp($ledger->pj,$_POST['e_pj']) != 0 ) { echo '

'._('Attention numéro pièce existante, elle a du être adaptée').'

'; } + printf ('%s
', + $jr_id,dossier::id(),$ledger->internal); echo HtmlInput::button_anchor(_('Autre opération dans ce journal'), "?".dossier::get().