'; echo $form; echo ''; } // We want to see the encoded invoice if ( isset ($_POST["view_invoice"])) { $nb_number=$_POST["nb_item"]; $form=FormVenteView($cn,$g_jrn,$g_user,$HTTP_POST_VARS,$nb_number); // Check failed : invalid date or quantity if ( $form== null) { echo_error("Cannot validate "); $form=FormVente($cn,$g_jrn,$g_user,$HTTP_POST_VARS,false,$nb_number); } echo '
'; echo $form; echo '
'; } // We want a blank form if ( isset($_GET["blank"])) { echo_debug("Blank form"); // Show an empty form of invoice $form=FormVente($cn,$g_jrn,$g_user,null,false); echo '
'; echo $form; echo '
'; } } // Save the invoice if ( isset($_POST["record_invoice"])) { // echo "RECORD INVOICE"; RecordInvoice($cn,$HTTP_POST_VARS,$g_user,$g_jrn); } if (isset ($_POST['correct_new_invoice'])) { $nb=$_POST['nb_item']; $form=FormVente($cn,$g_jrn,$g_user,$HTTP_POST_VARS,false,$nb); echo '
'; echo $form; echo '
'; } // Save and print the invoice if ( isset($_POST["record_and_print_invoice"])) { // echo "RECORD AND PRINT INVOICE"; $comment=RecordInvoice($cn,$HTTP_POST_VARS,$g_user,$g_jrn); $nb_number=$_POST["nb_item"]; $form=FormVenteView($cn,$g_jrn,$g_user,$HTTP_POST_VARS,$nb_number,'pdf',$comment); echo '
'; echo $form; echo "
"; } if ( $action == 'voir_jrn' ) { // Show list of sell // 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 '
'; } // if ( $action == 'impress' ) { // // Print list of sell or print the current invoice // } //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'] ) ) { $a=ListJrn($cn,$g_jrn,"",$HTTP_POST_VARS); echo $a; } echo '
'; } include("user_update.php"); ?>