diff --git a/include/user_action_ach.php b/include/user_action_ach.php index ff421c2b8..df9ccd6ef 100644 --- a/include/user_action_ach.php +++ b/include/user_action_ach.php @@ -18,4 +18,103 @@ */ // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr /* $Revision$ */ -?> \ No newline at end of file +echo_debug("include user_action_ach.php"); +include_once("form_input.php"); +// phpinfo(); +if ( ! isset ($_GET['action']) && ! isset ($_POST["action"]) ) { + return; +} +include_once ("preference.php"); +include_once ("user_common.php"); + +$dossier=sprintf("dossier%d",$g_dossier); +$cn=DbConnect($dossier); +$action=(isset($_GET['action']))?$_GET['action']:$_POST['action']; + +// action = new +if ( $action == 'new' ) { +// We request a new form + if ( isset($_GET['blank'] )) { + // Submit button in the form + $submit=' + '; + + $r=FormAch($cn,$g_jrn,$g_user,$submit,null,false); + echo '
'; + echo $r; + echo "
"; + } + + // Add an item + if ( isset ($_POST['add_item'])) { + // Add a line + $nb_number=$_POST["nb_item"]; + $nb_number++; + + // submit button in the form + $submit=' + '; + + $r=FormAch($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,false, $nb_number); + echo '
'; + echo $r; + echo "
"; + } + + // View the charge and show a submit button to save it + if ( isset ($_POST['view_invoice']) ) { + $nb_number=$_POST["nb_item"]; + $submit=''; + $r=FormAch($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,true,$nb_number); + echo '
'; + echo $r; + echo "
"; + } + // Save the charge into database + if ( isset($_POST['save'] )) { + + } + + +} +if ( $action == 'voir_jrn' ) { + // Show list of sell + echo_debug ("user_action_ach.php"); + // Date - date of payment - Customer - amount + $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".GetUserPeriode($cn,$g_user)." and jr_def_id=$g_jrn"; + $list=ListJrn($cn,$g_jrn,$sql); + echo '
'; + echo $list; + echo '
'; +} +if ( $action == 'voir_jrn_non_paye' ) { +// Show list of unpaid sell +// Date - date of payment - Customer - amount + $sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=$g_jrn" ; + $list=ListJrn($cn,$g_jrn,$sql); + $sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=$g_jrn" ; + $list2=ListJrn($cn,$g_jrn,$sql); + echo '
'; + echo '

Echeance dépassée

'; + echo $list; + echo '

Non Payée

'; + echo $list2; + echo '
'; +} + +//Search +if ( $action == 'search' ) { + // PhpSessid + $sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID']; + +// display a search box + $search_box=u_ShowMenuRecherche($cn,$g_jrn,$sessid,$HTTP_POST_VARS); + echo '
'; + echo $search_box; + // if nofirst is set then show result + if ( isset ($_GET['nofirst'] ) ) + ViewJrn($g_dossier,$g_user,$g_jrn,$HTTP_POST_VARS); + echo '
'; +} + +?>