diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index bb31b119ec8..dc6e029bf37 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -35,6 +35,27 @@ if ($_POST["action"] == 'confirm_credite' && $_POST["confirm"] == yes) Header("Location: fiche.php?id=".$_GET["id"]); } +if ($_POST["action"] == 'infotrans') +{ + $bon = new BonPrelevement($db,""); + $bon->id = $_GET["id"]; + $dt = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); + + $bon->set_infotrans($user, $dt, $_POST["methode"]); + + Header("Location: fiche.php?id=".$_GET["id"]); +} + +if ($_POST["action"] == 'infocredit') +{ + $bon = new BonPrelevement($db,""); + $bon->id = $_GET["id"]; + $dt = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); + + $bon->set_infocredit($user, $dt); + + Header("Location: fiche.php?id=".$_GET["id"]); +} llxHeader('','Bon de prélèvement'); @@ -48,8 +69,14 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Factures"); $h++; +$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"]; +$head[$h][1] = $langs->trans("Statistiques"); +$h++; + $prev_id = $_GET["id"]; +$html = new Form($db); + if ($_GET["id"]) { $bon = new BonPrelevement($db,""); @@ -60,8 +87,6 @@ if ($_GET["id"]) if ($_GET["action"] == 'credite') { - $html = new Form($db); - $html->form_confirm("fiche.php?id=".$bon->id,"Classer comme crédité","Etes-vous sûr de vouloir classer ce bon de prélèvement comme crédité sur votre compte bancaire ?","confirm_credite"); print '
'; } @@ -78,7 +103,59 @@ if ($_GET["id"]) print ''.$bon->ref.''; print ''; + + if($bon->date_trans <> 0) + { + $muser = new User($db, $bon->user_trans); + $muser->fetch(); + + print 'Date Transmission / Par'; + print strftime("%d %b %Y",$bon->date_trans); + print ' par '.$muser->fullname.''; + print 'Méthode Transmission'; + print $bon->methodes_trans[$bon->method_trans]; + print ''; + } + if($bon->date_credit <> 0) + { + print 'Crédité le'; + print strftime("%d %b %Y",$bon->date_credit); + print ''; + } + print '
'; + + if($bon->date_trans == 0) + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
Date Transmission'; + print $html->select_date(); + print '
Méthode Transmission'; + print $html->select_array("methode",$bon->methodes_trans); + print '
'; + print ''; + print '
'; + } + + if($bon->date_trans <> 0 && $bon->date_credit == 0) + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
Crédité le'; + print $html->select_date(); + print '
'; + print ''; + print '
'; + } + } else {