From 74470def1bdd46335dd5f7c17853a3a6c458355a Mon Sep 17 00:00:00 2001 From: sparkyx Date: Fri, 26 Mar 2004 16:12:12 +0000 Subject: [PATCH] Add user interface for expense --- include/user_action_ach.php | 40 +++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/include/user_action_ach.php b/include/user_action_ach.php index df9ccd6ef..e600c5faa 100644 --- a/include/user_action_ach.php +++ b/include/user_action_ach.php @@ -38,11 +38,16 @@ if ( $action == 'new' ) { // Submit button in the form $submit=' '; + // add a one-line calculator + $r=FormAch($cn,$g_jrn,$g_user,$submit,null,false); echo '
'; echo $r; + echo "

On-line calculator

".JS_CALC_LINE."
"; echo "
"; + + } // Add an item @@ -53,26 +58,57 @@ if ( $action == 'new' ) { // submit button in the form $submit=' - '; + '; $r=FormAch($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,false, $nb_number); echo '
'; echo $r; + echo "

On-line calculator

".JS_CALC_LINE."
"; echo "
"; } + // Correct it + if ( isset ($_POST['correct'])) { + // Get number of lines + $nb_number=$_POST["nb_item"]; + + // submit button in the form + $submit=' + '; + + $r=FormAch($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,false, $nb_number); + echo '
'; + echo $r; + echo "

On-line calculator

".JS_CALC_LINE."
"; + echo "
"; + } + // View the charge and show a submit button to save it if ( isset ($_POST['view_invoice']) ) { $nb_number=$_POST["nb_item"]; - $submit=''; + $submit=''; + $submit.=''; + $r=FormAch($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,true,$nb_number); echo '
'; echo $r; + echo "

On-line calculator

".JS_CALC_LINE."
"; echo "
"; } // Save the charge into database if ( isset($_POST['save'] )) { + $r=RecordAchat($cn,$HTTP_POST_VARS,$g_user,$g_jrn); + // Get number of lines + $nb_number=$_POST["nb_item"]; + // submit button in the form + $submit='

Recorded

'; + + $r.=FormAch($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,true, $nb_number); + echo '
'; + echo $r; + echo "
"; + }