/[dolibarr]/dolibarr/htdocs/compta/prelevement/fiche-rejet.php
ViewVC logotype

Diff of /dolibarr/htdocs/compta/prelevement/fiche-rejet.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by eldy, Sat Sep 10 14:24:10 2005 UTC revision 1.5 by rodolphe, Thu Nov 3 10:30:35 2005 UTC
# Line 66  if ($_GET["id"]) Line 66  if ($_GET["id"])
66    
67    if ($bon->fetch($_GET["id"]) == 0)    if ($bon->fetch($_GET["id"]) == 0)
68      {      {
   
69        dolibarr_fiche_head($head, $hselected, 'Prélèvement : '. $bon->ref);        dolibarr_fiche_head($head, $hselected, 'Prélèvement : '. $bon->ref);
70    
   
71        print '<table class="border" width="100%">';        print '<table class="border" width="100%">';
   
72        print '<tr><td width="20%">Référence</td><td>'.$bon->ref.'</td></tr>';        print '<tr><td width="20%">Référence</td><td>'.$bon->ref.'</td></tr>';
   
73        print '</table><br />';        print '</table><br />';
74      }      }
75    else    else
# Line 83  if ($_GET["id"]) Line 79  if ($_GET["id"])
79  }  }
80    
81  $page = $_GET["page"];  $page = $_GET["page"];
82    $rej = new RejetPrelevement($db, $user);
83  /*  /*
84   * Liste des factures   * Liste des factures
85   *   *
# Line 91  $page = $_GET["page"]; Line 87  $page = $_GET["page"];
87   */   */
88  $sql = "SELECT pl.rowid, pl.amount, pl.statut";  $sql = "SELECT pl.rowid, pl.amount, pl.statut";
89  $sql .= " , s.idp, s.nom";  $sql .= " , s.idp, s.nom";
90    $sql .= " , pr.motif, pr.afacturer, pr.fk_facture";
91  $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";  $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
92  $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";  $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
93  $sql .= " , ".MAIN_DB_PREFIX."societe as s";  $sql .= " , ".MAIN_DB_PREFIX."societe as s";
94    $sql .= " , ".MAIN_DB_PREFIX."prelevement_rejet as pr";
95  $sql .= " WHERE p.rowid=".$prev_id;  $sql .= " WHERE p.rowid=".$prev_id;
96  $sql .= " AND pl.fk_prelevement_bons = p.rowid";  $sql .= " AND pl.fk_prelevement_bons = p.rowid";
97  $sql .= " AND pl.fk_soc = s.idp";  $sql .= " AND pl.fk_soc = s.idp";
98  $sql .= " AND pl.statut = 3 ";  $sql .= " AND pl.statut = 3 ";
99    $sql .= " AND pr.fk_prelevement_lignes = pl.rowid";
100    
101  if ($_GET["socid"])  if ($_GET["socid"])
102  {  {
# Line 106  if ($_GET["socid"]) Line 105  if ($_GET["socid"])
105    
106  $sql .= " ORDER BY pl.amount DESC";  $sql .= " ORDER BY pl.amount DESC";
107    
108  $result = $db->query($sql);  $resql = $db->query($sql);
109  if ($result)  if ($resql)
110  {  {
111    $num = $db->num_rows($result);    $num = $db->num_rows($resql);
112    $i = 0;    $i = 0;
113        
114    print_barre_liste("Lignes de prélèvement rejetées", $page, "fiche-rejet.php", $urladd, $sortfield, $sortorder, '', $num);    print_barre_liste("Lignes de prélèvement rejetées", $page, "fiche-rejet.php", $urladd, $sortfield, $sortorder, '', $num);
115    print"\n<!-- debut table -->\n";    print"\n<!-- debut table -->\n";
116    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
117    print '<tr class="liste_titre">';    print '<tr class="liste_titre">';
118    print '<td>Ligne</td><td>Société</td><td align="right">Montant</td></tr>';    print '<td>Ligne</td><td>Société</td><td align="right">Montant</td><td>Motif</td><td align="center">A Facturer</td><td align="center">Facture</td></tr>';
119    
120    $var=True;    $var=True;
   
121    $total = 0;    $total = 0;
122    
123    while ($i < $num)    while ($i < $num)
124      {      {
125        $obj = $db->fetch_object($result);                $obj = $db->fetch_object($resql);
126    
127        print "<tr $bc[$var]><td>";        print "<tr $bc[$var]><td>";
128        print '<img border="0" src="./statut'.$obj->statut.'.png"></a>&nbsp;';        print '<img border="0" src="./statut'.$obj->statut.'.png"></a>&nbsp;';
# Line 135  if ($result) Line 133  if ($result)
133        print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom)."</a></td>\n";        print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom)."</a></td>\n";
134    
135        print '<td align="right">'.price($obj->amount)."</td>\n";        print '<td align="right">'.price($obj->amount)."</td>\n";
136          print '<td>'.$rej->motifs[$obj->motif].'</td>';
137    
138          print '<td align="center">'.$langs->trans($yesno[$obj->afacturer]).'</td>';
139          print '<td align="center">'.$obj->fk_facture.'</td>';
140        print "</tr>\n";        print "</tr>\n";
141    
142        $total += $obj->total_ttc;        $total += $obj->amount;
143        $var=!$var;        $var=!$var;
144        $i++;        $i++;
145      }      }
146    
147    print "</table>";    print "<tr $bc[$var]><td>&nbsp;</td>";
148    $db->free($result);    print "<td>Total</td>\n";
149      print '<td align="right">'.price($total)."</td>\n";
150      print '<td>&nbsp;</td>';
151      print "</tr>\n</table>\n";
152      $db->free($resql);
153  }  }
154  else  else
155  {  {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26