From 77cb4b1fbac1e577f9d1110358482a75594a4b70 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 8 Jan 2011 23:18:13 +0000 Subject: [PATCH] Withdrawals: Visual enhancements --- htdocs/compta/prelevement/ligne.php | 122 +++++++++++----------------- 1 file changed, 48 insertions(+), 74 deletions(-) diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index c5a503c2bc6..6eb5d8c7a83 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,6 @@ if ($_POST["action"] == 'confirm_rejet') { if ( $_POST["confirm"] == 'yes') { - $daterej = mktime(2, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $lipre = new LignePrelevement($db, $user); @@ -93,10 +92,6 @@ if ($_GET["id"]) { $lipre = new LignePrelevement($db, $user); - //$lipre->statuts[0] = $langs->trans("StatusWaiting"); - //$lipre->statuts[2] = $langs->trans("StatusCredited"); - //$lipre->statuts[3] = $langs->trans("StatusRefused"); - if ($lipre->fetch($_GET["id"]) == 0) { $bon = new BonPrelevement($db); @@ -108,21 +103,19 @@ if ($_GET["id"]) print ''.$langs->trans("WithdrawalReceipt").''; print ''.$lipre->bon_ref.''; - print ''.$langs->trans("Amount").''.price($lipre->amount).''; + print ''.$langs->trans("Date").''.dol_print_date($bon->datec,'day').''; + print ''.$langs->trans("Amount").''.price($lipre->amount).''; print ''.$langs->trans("Status").''; print $lipre->LibStatut($lipre->statut,1).''; - /*print ' '; - print $langs->trans($lipre->statuts[$lipre->statut]).'';*/ - if ($lipre->statut == 3) { $rej = new RejetPrelevement($db, $user); $resf = $rej->fetch($lipre->id); if ($resf == 0) { - print 'M'.$langs->trans("RefusedReason").''.$rej->motif.''; + print ''.$langs->trans("RefusedReason").''.$rej->motif.''; print ''.$langs->trans("RefusedData").''; if ($rej->date_rejet == 0) { @@ -134,6 +127,7 @@ if ($_GET["id"]) print dol_print_date($rej->date_rejet,'day'); } print ''; + print ''.$langs->trans("RefusedInvoicing").''.$rej->invoicing.''; } else { @@ -141,16 +135,14 @@ if ($_GET["id"]) } } - - print '
'; + print ''; + dol_fiche_end(); } else { - print "Erreur"; + dol_print_error($db); } - - if ($_GET["action"] == 'rejet') { $html = new Form($db); @@ -160,56 +152,61 @@ if ($_GET["id"]) $rej = new RejetPrelevement($db, $user); - $rej->motifs[0] = $langs->trans("StatusMotif0"); - $rej->motifs[1] = $langs->trans("StatusMotif1"); - $rej->motifs[2] = $langs->trans("StatusMotif2"); - $rej->motifs[3] = $langs->trans("StatusMotif3"); - $rej->motifs[4] = $langs->trans("StatusMotif4"); - $rej->motifs[5] = $langs->trans("StatusMotif5"); - $rej->motifs[6] = $langs->trans("StatusMotif6"); - $rej->motifs[7] = $langs->trans("StatusMotif7"); - $rej->motifs[8] = $langs->trans("StatusMotif8"); - print '
'; print ''; print ''; print ''; - print ''; + + print ''; + print ''; + + //Select yes/no print ''; print ''; - + + //Date print ''; print ''; + + //Reason print ''; print ''; - print ''; - + print $html->selectarray("motif", $rej->motifs); + print ''; + + //Facturer print ''; print ''; - print '
'.$langs->trans("WithdrawalRefused").'
'.$langs->trans("WithdrawalRefused").'
'.$langs->trans("WithdrawalRefusedConfirm").' '.$soc->nom.' ?'; - print ''; + print $html->selectyesno("confirm",1,0); print '
'.$langs->trans("RefusedData").''; print $html->select_date('','','','','',"confirm_rejet"); print '
'.$langs->trans("RefusedReason").''; - print ''; - print ''; - print '
'.$langs->trans("RefusedInvoicing").''; - print ''; - print '
'; + print $html->selectarray("facturer", $rej->facturer); + print ''; + print '
'; + + //Confirm Button + print '
'; + print ''; } + + /* ************************************************************************** */ + /* */ + /* Barre d'action */ + /* */ + /* ************************************************************************** */ + + print "
"; + + if ($_GET["action"] == '') + { + if ($bon->statut == 2 && $lipre->statut == 2) + { + print "id\">".$langs->trans("StandingOrderReject").""; + } + } + + print "
"; $page = $_GET["page"]; $sortorder = $_GET["sortorder"]; @@ -226,8 +223,6 @@ if ($_GET["id"]) /* * Liste des factures - * - * */ $sql = "SELECT pf.rowid"; $sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc"; @@ -281,12 +276,11 @@ if ($_GET["id"]) print ''.$obj->ref."\n"; - print ''; + print ''; print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."\n"; print ''.price($obj->total_ttc)."\n"; - print "\n"; $i++; @@ -302,26 +296,6 @@ if ($_GET["id"]) } $db->close(); - - - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - - print "\n\n
\n"; - - if ($_GET["action"] == '') - { - - if ($bon->statut == 2 && $lipre->statut == 2) - { - print "id\">".$langs->trans("StandingOrderReject").""; - } - } - - print "
"; } llxFooter('$Date$ - $Revision$');