Ajout mise à jour du compte bancaire
This commit is contained in:
parent
72a4728912
commit
9bdbe27037
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
require("./pre.inc.php3");
|
require("./pre.inc.php3");
|
||||||
require("../paiement.class.php");
|
require("../paiement.class.php");
|
||||||
llxHeader();
|
require("./bank/account.class.php");
|
||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
|
||||||
@ -34,10 +34,14 @@ if ($user->societe_id > 0)
|
|||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if ($action == 'add') {
|
* Traitement des action
|
||||||
$datepaye = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear));
|
*/
|
||||||
|
/*
|
||||||
|
if ($action == 'add')
|
||||||
|
{
|
||||||
|
$datepaye = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear));
|
||||||
|
print $reday;
|
||||||
$paiement = new Paiement($db);
|
$paiement = new Paiement($db);
|
||||||
|
|
||||||
$paiement->facid = $facid;
|
$paiement->facid = $facid;
|
||||||
@ -50,9 +54,23 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
$paiement->create();
|
$paiement->create();
|
||||||
|
|
||||||
$action = '';
|
$label = "Réglement facture N°";
|
||||||
|
|
||||||
} elseif ($action == 'create') {
|
$acc = new Account($db, $HTTP_POST_VARS["accountid"]);
|
||||||
|
$acc->addline($datepaye, $paiementid, $label, $amount, $num_paiement);
|
||||||
|
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Affichage
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'create')
|
||||||
|
{
|
||||||
|
|
||||||
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
||||||
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
|
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
|
||||||
@ -71,16 +89,17 @@ if ($action == 'add') {
|
|||||||
print '<input type="hidden" name="action" value="add_paiement">';
|
print '<input type="hidden" name="action" value="add_paiement">';
|
||||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||||
|
|
||||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">Facture</td>";
|
print "<tr class=\"liste_titre\"><td colspan=\"3\">Facture</td>\n";
|
||||||
|
|
||||||
print "<tr><td>Numéro :</td><td colspan=\"2\">$obj->facnumber</td></tr>";
|
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>";
|
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>";
|
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;";
|
$sql = "SELECT sum(p.amount) FROM llx_paiement as p WHERE p.fk_facture = $facid;";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result)
|
||||||
|
{
|
||||||
$sumpayed = $db->result(0,0);
|
$sumpayed = $db->result(0,0);
|
||||||
$db->free();
|
$db->free();
|
||||||
}
|
}
|
||||||
@ -88,63 +107,16 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">Paiement</td>";
|
print "<tr class=\"liste_titre\"><td colspan=\"3\">Paiement</td>";
|
||||||
|
|
||||||
|
|
||||||
print "<input type=\"hidden\" name=\"facid\" value=\"$facid\">";
|
print "<input type=\"hidden\" name=\"facid\" value=\"$facid\">";
|
||||||
print "<input type=\"hidden\" name=\"facnumber\" value=\"$obj->facnumber\">";
|
print "<input type=\"hidden\" name=\"facnumber\" value=\"$obj->facnumber\">";
|
||||||
print "<input type=\"hidden\" name=\"socid\" value=\"$obj->idp\">";
|
print "<input type=\"hidden\" name=\"socid\" value=\"$obj->idp\">";
|
||||||
print "<input type=\"hidden\" name=\"societe\" value=\"$obj->nom\">";
|
print "<input type=\"hidden\" name=\"societe\" value=\"$obj->nom\">";
|
||||||
|
|
||||||
$strmonth[1] = "Janvier";
|
|
||||||
$strmonth[2] = "Février";
|
|
||||||
$strmonth[3] = "Mars";
|
|
||||||
$strmonth[4] = "Avril";
|
|
||||||
$strmonth[5] = "Mai";
|
|
||||||
$strmonth[6] = "Juin";
|
|
||||||
$strmonth[7] = "Juillet";
|
|
||||||
$strmonth[8] = "Août";
|
|
||||||
$strmonth[9] = "Septembre";
|
|
||||||
$strmonth[10] = "Octobre";
|
|
||||||
$strmonth[11] = "Novembre";
|
|
||||||
$strmonth[12] = "Décembre";
|
|
||||||
|
|
||||||
|
|
||||||
print "<tr><td>Date :</td><td>";
|
print "<tr><td>Date :</td><td>";
|
||||||
$cday = date("d", time());
|
print_date_select();
|
||||||
print "<select name=\"pday\">";
|
print "</td>";
|
||||||
for ($day = 1 ; $day < $sday + 32 ; $day++) {
|
print "<td>Commentaires</td></tr>";
|
||||||
if ($day == $cday) {
|
|
||||||
print "<option value=\"$day\" SELECTED>$day";
|
|
||||||
} else {
|
|
||||||
print "<option value=\"$day\">$day";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</select>";
|
|
||||||
$cmonth = date("n", time());
|
|
||||||
print "<select name=\"pmonth\">";
|
|
||||||
for ($month = 1 ; $month <= 12 ; $month++) {
|
|
||||||
if ($month == $cmonth) {
|
|
||||||
print "<option value=\"$month\" SELECTED>" . $strmonth[$month];
|
|
||||||
} else {
|
|
||||||
print "<option value=\"$month\">" . $strmonth[$month];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</select>";
|
|
||||||
|
|
||||||
print "<select name=\"pyear\">";
|
|
||||||
$syear = date("Y", time() ) ;
|
|
||||||
print "<option value=\"".($syear-1)."\">".($syear-1);
|
|
||||||
print "<option value=\"$syear\" SELECTED>$syear";
|
|
||||||
|
|
||||||
for ($year = $syear +1 ; $year < $syear + 5 ; $year++) {
|
|
||||||
print "<option value=\"$year\">$year";
|
|
||||||
}
|
|
||||||
print "</select></td>";
|
|
||||||
|
|
||||||
print "<td rowspan=\"5\">Commentaires :<br>";
|
|
||||||
print '<textarea name="comment" wrap="soft" cols="40" rows="10"></textarea></td></tr>';
|
|
||||||
|
|
||||||
$author = $GLOBALS["REMOTE_USER"];
|
|
||||||
print "<input type=\"hidden\" name=\"author\" value=\"$author\">\n";
|
|
||||||
|
|
||||||
print "<tr><td>Type :</td><td><select name=\"paiementid\">\n";
|
print "<tr><td>Type :</td><td><select name=\"paiementid\">\n";
|
||||||
|
|
||||||
@ -160,8 +132,31 @@ if ($action == 'add') {
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</select><br>";
|
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 "</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>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\"> </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 valign=\"top\">Montant :</td><td><input name=\"amount\" type=\"text\"></td></tr>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user