Updated list of payment types to use Form::select_types_paiements()

Using payment-type label instead of code in results list
This commit is contained in:
ywarnier 2007-07-29 16:35:45 +00:00
parent fa3c1933e3
commit 6b2b5f4956

View File

@ -75,13 +75,9 @@ print "</tr>\n";
<input type="text" class="flat" name="credit" size="6" value=<?php echo $credit ?>> <input type="text" class="flat" name="credit" size="6" value=<?php echo $credit ?>>
</td> </td>
<td class="liste_titre" align="center"> <td class="liste_titre" align="center">
<select class="flat" name="type"> <?php
<option value="%">Toutes</option> $html->select_types_paiements(empty($_POST['type'])?'':$_POST['type'],'type');
<option value="CHQ">CHQ</option> ?>
<option value="CB">CB</option>
<option value="VIR">VIR</option>
<option value="PRE">PRE</option>
</select>
</td> </td>
<?php <?php
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
@ -125,10 +121,13 @@ else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_account, b.fk_type, ba.label as labelaccount"; $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_account, b.fk_type, ba.label as labelaccount, p.libelle as payment_type ";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba, ".MAIN_DB_PREFIX."c_paiement as p ";
$sql .= " WHERE b.fk_account=ba.rowid"; $sql .= " WHERE b.fk_account=ba.rowid AND p.code = b.fk_type ";
$sql .= " AND fk_type like '" . $type . "'"; if(!empty($type))
{
$sql .= " AND p.id = " . $type ." ";
}
$si=0; $si=0;
@ -184,7 +183,7 @@ if ($result)
print "<td>&nbsp;</td><td align=\"right\">".price($objp->amount)."</td>\n"; print "<td>&nbsp;</td><td align=\"right\">".price($objp->amount)."</td>\n";
} }
print "<td align=\"center\">".$objp->fk_type."</td>\n"; print "<td align=\"center\">".$objp->payment_type."</td>\n";
print "<td align=\"left\"><small>".$objp->labelaccount."</small></td>\n"; print "<td align=\"left\"><small>".$objp->labelaccount."</small></td>\n";