Correcstions prsentation html
This commit is contained in:
parent
71252712c5
commit
04508868b0
@ -77,153 +77,154 @@ if ($action == 'create')
|
||||
$sql .= " AND f.rowid = $facid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
if ($num) {
|
||||
$obj = $db->fetch_object( 0);
|
||||
|
||||
$total = $obj->total;
|
||||
|
||||
print_titre("Emettre un paiement");
|
||||
print '<form action="facture.php3?id='.$facid.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="add_paiement">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">Facture</td>\n";
|
||||
|
||||
print "<tr><td>Numéro :</td><td colspan=\"2\">$obj->facnumber</td></tr>\n";
|
||||
print "<tr><td>Société :</td><td colspan=\"2\">$obj->nom</td></tr>\n";
|
||||
|
||||
print "<tr><td>Montant :</td><td colspan=\"2\">".price($obj->total)." euros TTC</td></tr>";
|
||||
|
||||
$sql = "SELECT sum(p.amount) FROM llx_paiement as p WHERE p.fk_facture = $facid;";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
if ($num)
|
||||
{
|
||||
$sumpayed = $db->result(0,0);
|
||||
$db->free();
|
||||
}
|
||||
print '<tr><td>Déjà payé</td><td colspan=\"2\"><b>'.price($sumpayed).'</b> euros TTC</td></tr>';
|
||||
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">Paiement</td>";
|
||||
$obj = $db->fetch_object( 0);
|
||||
|
||||
print "<input type=\"hidden\" name=\"facid\" value=\"$facid\">";
|
||||
print "<input type=\"hidden\" name=\"facnumber\" value=\"$obj->facnumber\">";
|
||||
print "<input type=\"hidden\" name=\"socid\" value=\"$obj->idp\">";
|
||||
print "<input type=\"hidden\" name=\"societe\" value=\"$obj->nom\">";
|
||||
$total = $obj->total;
|
||||
|
||||
|
||||
print "<tr><td>Date :</td><td>";
|
||||
print_date_select();
|
||||
print "</td>";
|
||||
print "<td>Commentaires</td></tr>";
|
||||
|
||||
print "<tr><td>Type :</td><td><select name=\"paiementid\">\n";
|
||||
|
||||
$sql = "SELECT id, libelle FROM c_paiement ORDER BY id";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$objopt = $db->fetch_object( $i);
|
||||
print "<option value=\"$objopt->id\">$objopt->libelle</option>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td>\n";
|
||||
print "<td rowspan=\"5\">";
|
||||
print '<textarea name="comment" wrap="soft" cols="40" rows="10"></textarea></td></tr>';
|
||||
|
||||
print "<tr><td>Compte à créditer :</td><td><select name=\"accountid\">\n";
|
||||
|
||||
$sql = "SELECT rowid, label FROM llx_bank_account ORDER BY rowid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
print_titre("Emettre un paiement");
|
||||
print '<form action="facture.php3?id='.$facid.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="add_paiement">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">Facture</td>\n";
|
||||
|
||||
print "<tr><td>Numéro :</td><td colspan=\"2\">$obj->facnumber</td></tr>\n";
|
||||
print "<tr><td>Société :</td><td colspan=\"2\">$obj->nom</td></tr>\n";
|
||||
|
||||
print '<tr><td>Montant :</td><td colspan="2">'.price($obj->total).' euros TTC</td></tr>';
|
||||
|
||||
$sql = "SELECT sum(p.amount) FROM llx_paiement as p WHERE p.fk_facture = $facid;";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
print "<option value=\"$objopt->rowid\">$objopt->label</option>\n";
|
||||
$i++;
|
||||
$sumpayed = $db->result(0,0);
|
||||
$db->free();
|
||||
}
|
||||
print '<tr><td>Déjà payé</td><td colspan="2"><b>'.price($sumpayed).'</b> euros TTC</td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="3">Paiement</td>';
|
||||
print "<input type=\"hidden\" name=\"facid\" value=\"$facid\">";
|
||||
print "<input type=\"hidden\" name=\"facnumber\" value=\"$obj->facnumber\">";
|
||||
print "<input type=\"hidden\" name=\"socid\" value=\"$obj->idp\">";
|
||||
print "<input type=\"hidden\" name=\"societe\" value=\"$obj->nom\">";
|
||||
|
||||
print "<tr><td>Date :</td><td>";
|
||||
print_date_select();
|
||||
print "</td>";
|
||||
print "<td>Commentaires</td></tr>";
|
||||
|
||||
print "<tr><td>Type :</td><td><select name=\"paiementid\">\n";
|
||||
|
||||
$sql = "SELECT id, libelle FROM c_paiement ORDER BY id";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
print "<option value=\"$objopt->id\">$objopt->libelle</option>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td>\n";
|
||||
print "<td rowspan=\"5\">";
|
||||
print '<textarea name="comment" wrap="soft" cols="40" rows="10"></textarea></td></tr>';
|
||||
|
||||
print "<tr><td>Compte à créditer :</td><td><select name=\"accountid\">\n";
|
||||
|
||||
$sql = "SELECT rowid, label FROM llx_bank_account ORDER BY rowid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objopt = $db->fetch_object( $i);
|
||||
print "<option value=\"$objopt->rowid\">$objopt->label</option>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr><td>Numéro :</td><td><input name=\"num_paiement\" type=\"text\"><br><em>Num du cheque ou virement</em></td></tr>\n";
|
||||
print "<tr><td valign=\"top\"> </td><td>Reste à payer : <b>".price($total - $sumpayed)."</b> euros TTC</td></tr>\n";
|
||||
print "<tr><td valign=\"top\">Montant :</td><td><input name=\"amount\" type=\"text\"></td></tr>\n";
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" value="Enregistrer"></td></tr>';
|
||||
print "</form>\n";
|
||||
print "</table>\n";
|
||||
|
||||
}
|
||||
print "</select>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr><td>Numéro :</td><td><input name=\"num_paiement\" type=\"text\"><br><em>Num du cheque ou virement</em></td></tr>\n";
|
||||
print "<tr><td valign=\"top\"> </td><td>Reste à payer : <b>".price($total - $sumpayed)."</b> euros TTC</td></tr>\n";
|
||||
print "<tr><td valign=\"top\">Montant :</td><td><input name=\"amount\" type=\"text\"></td></tr>\n";
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" value="Enregistrer"></td></tr>';
|
||||
print "</form>\n";
|
||||
print "</table>\n";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
|
||||
if ($page == -1)
|
||||
{
|
||||
$page = 0 ;
|
||||
}
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
|
||||
$sql = "SELECT ".$db->pdate("p.datep")." as dp, p.amount, f.amount as fa_amount, f.facnumber";
|
||||
$sql .=", f.rowid as facid, c.libelle as paiement_type, p.num_paiement";
|
||||
$sql .= " FROM llx_paiement as p, llx_facture as f, c_paiement as c";
|
||||
$sql .= " WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id";
|
||||
|
||||
|
||||
if ($socidp)
|
||||
{
|
||||
$sql .= " AND f.fk_soc = $socidp";
|
||||
}
|
||||
|
||||
|
||||
$sql .= " ORDER BY datep DESC";
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
$result = $db->query($sql);
|
||||
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
$var=True;
|
||||
|
||||
print_barre_liste("Paiements", $page, $PHP_SELF);
|
||||
|
||||
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Facture</td>";
|
||||
print "<td>Date</td>";
|
||||
print "<td>Type</TD>";
|
||||
print '<td align="right">Montant</TD>';
|
||||
print "<td> </td>";
|
||||
print "</TR>\n";
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD><a href=\"facture.php3?facid=$objp->facid\">$objp->facnumber</a></TD>\n";
|
||||
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
||||
print "<TD>$objp->paiement_type $objp->num_paiement</TD>\n";
|
||||
print '<TD align="right">'.price($objp->amount).'</TD><td> </td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
$var=True;
|
||||
|
||||
print_barre_liste("Paiements", $page, $PHP_SELF);
|
||||
|
||||
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Facture</td>";
|
||||
print "<td>Date</td>";
|
||||
print "<td>Type</TD>";
|
||||
print '<td align="right">Montant</TD>';
|
||||
print "<td> </td>";
|
||||
print "</TR>\n";
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD><a href=\"facture.php3?facid=$objp->facid\">$objp->facnumber</a></TD>\n";
|
||||
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
||||
print "<TD>$objp->paiement_type $objp->num_paiement</TD>\n";
|
||||
print '<TD align="right">'.price($objp->amount).'</TD><td> </td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
print '<a href="paiement/index.php">Rapports</a>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user