.
This commit is contained in:
parent
9997a1e9b1
commit
87141bbdd9
@ -16,25 +16,28 @@ $db = new Db();
|
||||
|
||||
if ($action == 'add') {
|
||||
$author = $GLOBALS["REMOTE_USER"];
|
||||
if ($credit > 0) {
|
||||
$amount = $credit ;
|
||||
} else {
|
||||
$amount = - $debit ;
|
||||
}
|
||||
|
||||
if ($num_chq) {
|
||||
$sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author, num_chq,fk_account)";
|
||||
$sql .= " VALUES (now(), $dateo, '$label', $amount,'$author',$num_chq,$account)";
|
||||
} else {
|
||||
$sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author,fk_account)";
|
||||
$sql .= " VALUES (now(), $dateo, '$label', $amount,'$author',$account)";
|
||||
}
|
||||
$sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author,fk_account)";
|
||||
$sql .= " VALUES (now(), $dateo, '$label', (0 - $amount),'$author',$account_from)";
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
print $db->error();
|
||||
print "<p>$sql";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author,fk_account)";
|
||||
$sql .= " VALUES (now(), $dateo, '$label', $amount,'$author',$account_to)";
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
print $db->error();
|
||||
print "<p>$sql";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if ($action == 'del') {
|
||||
bank_delete_line($db, $rowid);
|
||||
@ -56,7 +59,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
|
||||
print "<tr><td>De</td><td>Vers</td><td>Date</td><td>Libelle</td><td>Montant</td></tr>";
|
||||
print "<tr><td>";
|
||||
print "<select name=\"from\">";
|
||||
print "<select name=\"account_from\">";
|
||||
$sql = "SELECT rowid, label FROM llx_bank_account";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@ -72,7 +75,7 @@ if ($result) {
|
||||
}
|
||||
print "</select></td><td>";
|
||||
|
||||
print "<select name=\"from\">";
|
||||
print "<select name=\"account_to\">";
|
||||
$sql = "SELECT rowid, label FROM llx_bank_account";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@ -90,7 +93,7 @@ print "</select></td>";
|
||||
|
||||
print "<td><input name=\"dateo\" type=\"text\" size=8 maxlength=8></td>";
|
||||
print "<td><input name=\"label\" type=\"text\" size=40></td>";
|
||||
print "<td><input name=\"debit\" type=\"text\" size=8></td>";
|
||||
print "<td><input name=\"amount\" type=\"text\" size=8></td>";
|
||||
print "<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"ajouter\"</td>";
|
||||
print "</tr><tr><td colspan=\"2\">Format : YYYYMMDD - 20010826</td><td colspan=\"2\">0000.00</td></tr>";
|
||||
|
||||
|
||||
@ -55,10 +55,6 @@ if ($action == 'del_bookmark') {
|
||||
|
||||
print_titre("Charges");
|
||||
|
||||
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
print '<tr><td valign="top" width="30%">';
|
||||
|
||||
|
||||
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
@ -78,7 +74,28 @@ if ( $db->query($sql) ) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->nom.'</td><td>'.price($obj->total).'</td>';
|
||||
print '<td>'.$obj->nom.'</td><td align="right">'.price($obj->total).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print "<tr><td>".$db->error()."</td></tr>";
|
||||
}
|
||||
/*
|
||||
* Factures fournisseurs
|
||||
*/
|
||||
$sql = "SELECT sum(f.amount) as total";
|
||||
$sql .= " FROM llx_facture_fourn as f";
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>Factures founisseurs</td><td align="right">'.price($obj->total).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -86,21 +103,9 @@ if ( $db->query($sql) ) {
|
||||
print "<tr><td>".$db->error()."</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
|
||||
@ -37,7 +37,7 @@ function llxHeader($head = "") {
|
||||
|
||||
$menu->add("index.php3","Charges");
|
||||
|
||||
$menu->add_submenu("/compta/sociales/index.php3","Prestations sociales");
|
||||
$menu->add_submenu("/compta/sociales/index.php3","Prest. Sociales");
|
||||
|
||||
$menu->add("/compta/ca.php3","Chiffres d'affaires");
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -18,6 +15,9 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php3");
|
||||
|
||||
@ -58,8 +58,40 @@ print_titre("Espace compta");
|
||||
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
print '<tr><td valign="top" width="30%">';
|
||||
/*
|
||||
* Charges a payer
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT c.amount, cc.libelle";
|
||||
$sql .= " FROM llx_chargesociales as c, c_chargesociales as cc";
|
||||
$sql .= " WHERE c.fk_type = cc.id AND c.paye=0";
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
if ($num) {
|
||||
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<TD colspan=\"2\">Charges à payer</td>";
|
||||
print "</TR>\n";
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->libelle.'</td>';
|
||||
print '<td align="right">'.price($obj->amount).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
print '</table><br>';
|
||||
}
|
||||
} else {
|
||||
print $db->error();
|
||||
}
|
||||
/*
|
||||
* Propales
|
||||
*/
|
||||
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<td colspan=\"2\">Propositions commerciales</td>";
|
||||
@ -72,8 +104,9 @@ if (valeur($sql)) {
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
/*
|
||||
* Factures
|
||||
*/
|
||||
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<td colspan=\"2\">Factures</td>";
|
||||
@ -86,13 +119,10 @@ if (valeur($sql)) {
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Bookmark
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT s.idp, s.nom,b.rowid as bid";
|
||||
$sql .= " FROM societe as s, llx_bookmark as b";
|
||||
$sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id;
|
||||
@ -120,7 +150,7 @@ if ( $db->query($sql) ) {
|
||||
print '</table>';
|
||||
}
|
||||
/*
|
||||
*
|
||||
* Actions a faire
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@ -38,7 +38,7 @@ function llxHeader($head = "") {
|
||||
// $menu->add_submenu("fac.php3","admin fac");
|
||||
|
||||
$menu->add("charges/index.php3","Charges");
|
||||
$menu->add_submenu("sociales/","Prestations sociales");
|
||||
$menu->add_submenu("sociales/","Prest. Sociales");
|
||||
|
||||
$menu->add("ca.php3","Chiffres d'affaires");
|
||||
|
||||
|
||||
@ -44,14 +44,12 @@ print "<TD align=\"center\">Montant</TD><td align=\"right\">Solde</td>";
|
||||
print "</TR>\n";
|
||||
|
||||
$sql = "SELECT s.nom,sum(f.amount) as amount";
|
||||
$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";
|
||||
if ($year > 0) {
|
||||
$sql .= " AND date_format(f.datef, '%Y') = $year";
|
||||
}
|
||||
|
||||
}
|
||||
$sql .= " GROUP BY s.nom ASC";
|
||||
|
||||
|
||||
print '<tr><td colspan="4">Factures</td></tr>';
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -83,6 +81,48 @@ if ($result) {
|
||||
print $db->error();
|
||||
}
|
||||
print '<tr><td colspan="3" align="right">'.price($total).'</td></tr>';
|
||||
/*
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT s.nom,sum(f.amount) as amount";
|
||||
$sql .= " FROM societe as s,llx_facture_fourn as f WHERE f.fk_soc = s.idp";
|
||||
if ($year > 0) {
|
||||
$sql .= " AND date_format(f.datef, '%Y') = $year";
|
||||
}
|
||||
$sql .= " GROUP BY s.nom ASC";
|
||||
|
||||
print '<tr><td colspan="4">Frais</td></tr>';
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
|
||||
$i = 0;
|
||||
|
||||
if ($num > 0) {
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]><td> </td>";
|
||||
print "<td>Facture <a href=\"/compta/facture.php3?facid=$objp->facid\">$objp->facnumber</a> $objp->nom</TD>\n";
|
||||
|
||||
print "<TD align=\"right\">".price($objp->amount)."</TD>\n";
|
||||
|
||||
$total = $total - $objp->amount;
|
||||
print "<TD align=\"right\">".price($total)."</TD>\n";
|
||||
|
||||
print "</TR>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->free();
|
||||
} else {
|
||||
print $db->error();
|
||||
}
|
||||
print '<tr><td colspan="3" align="right">'.price($total).'</td></tr>';
|
||||
|
||||
/*
|
||||
* Charges sociales
|
||||
*
|
||||
|
||||
@ -66,11 +66,11 @@ print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print '<td>Echeance</td><td>Période</td><td colspan="2">';
|
||||
print_liste_field_titre("Charges",$PHP_SELF,"c.libelle");
|
||||
print '</td><td align="right">Montant</td><td> </td>';
|
||||
print '</td><td align="right">Montant</td><td colspan="2"> </td>';
|
||||
print "</TR>\n";
|
||||
|
||||
|
||||
$sql = "SELECT c.libelle as nom, s.amount,".$db->pdate("s.date_ech")." as de, s.date_pai, s.libelle, s.paye,".$db->pdate("s.periode")." as dp";
|
||||
$sql = "SELECT c.libelle as nom, s.amount,".$db->pdate("s.date_ech")." as de, s.date_pai, s.libelle, s.paye,".$db->pdate("s.periode")." as periode,".$db->pdate("s.date_pai")." as dp";
|
||||
$sql .= " FROM c_chargesociales as c, llx_chargesociales as s";
|
||||
$sql .= " WHERE s.fk_type = c.id";
|
||||
if ($year > 0) {
|
||||
@ -86,17 +86,17 @@ if ( $db->query($sql) ) {
|
||||
$obj = $db->fetch_object( $i);
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.strftime("%d/%m/%y",$obj->de).'</td>';
|
||||
print '<td><a href="index.php3?year='.strftime("%Y",$obj->dp).'">'.strftime("%Y",$obj->dp).'</a></td>';
|
||||
print '<td>'.strftime("%d %b %y",$obj->de).'</td>';
|
||||
print '<td><a href="index.php3?year='.strftime("%Y",$obj->periode).'">'.strftime("%Y",$obj->periode).'</a></td>';
|
||||
print '<td>'.$obj->nom.'</td><td>'.$obj->libelle.'</td>';
|
||||
print '<td align="right">'.price($obj->amount).'</td>';
|
||||
print '<td>';
|
||||
|
||||
if ($obj->paye) {
|
||||
print " ";
|
||||
print '<td colspan="2">'.strftime("%d/%m/%y",$obj->dp).'</td>';
|
||||
} else {
|
||||
print '<img src="/theme/'.$conf->theme.'/img/editdelete.png" border="0"></a>';
|
||||
print '<td><img src="/theme/'.$conf->theme.'/img/editdelete.png" border="0"></a></td>';
|
||||
print '<td><img src="/theme/'.$conf->theme.'/img/editdelete.png" border="0"></a></td>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -35,12 +35,12 @@ function llxHeader($head = "") {
|
||||
|
||||
$menu->add("/compta/facture.php3","Factures");
|
||||
|
||||
$menu->add("../charges.php3","Charges");
|
||||
$menu->add_submenu("index.php3","Prestations sociales");
|
||||
$menu->add("../charges/","Charges");
|
||||
$menu->add_submenu("index.php3","Prest. Sociales");
|
||||
|
||||
$menu->add("../ca.php3","Chiffres d'affaires");
|
||||
|
||||
$menu->add("resultat/","Résultats");
|
||||
$menu->add("/compta/resultat/","Résultats");
|
||||
|
||||
$menu->add("/compta/bank/index.php3","Bank");
|
||||
|
||||
|
||||
@ -26,6 +26,34 @@ require("../../tva.class.php3");
|
||||
*
|
||||
*
|
||||
*/
|
||||
function tva_coll($db, $y,$m) {
|
||||
$sql = "SELECT sum(f.tva) as amount";
|
||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1";
|
||||
$sql .= " AND date_format(f.datef,'%Y') = $y";
|
||||
$sql .= " AND date_format(f.datef,'%m') = $m";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object ( 0 );
|
||||
return $obj->amount;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function tva_paye($db, $y,$m) {
|
||||
$sql = "SELECT sum(f.tva) as amount";
|
||||
$sql .= " FROM llx_facture_fourn as f WHERE f.paye = 1";
|
||||
$sql .= " AND date_format(f.datef,'%Y') = $y";
|
||||
$sql .= " AND date_format(f.datef,'%m') = $m";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object ( 0 );
|
||||
return $obj->amount;
|
||||
}
|
||||
}
|
||||
|
||||
function pt ($db, $sql, $date) {
|
||||
global $bc;
|
||||
@ -75,29 +103,52 @@ $tva = new Tva($db);
|
||||
|
||||
print "Solde :" . price($tva->solde());
|
||||
|
||||
$yearc = strftime("%Y",time());
|
||||
|
||||
|
||||
if ($year == 0 ) {
|
||||
$year_current = strftime("%Y",time());
|
||||
//$year_start = $conf->years;
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$year_start = $year;
|
||||
}
|
||||
echo '<table width="100%">';
|
||||
echo '<tr><td width="50%" valign="top"><b>TVA collectée</b></td>';
|
||||
echo '<td>Tva Payée</td></tr>';
|
||||
echo '<td>Tva Réglée</td></tr>';
|
||||
|
||||
for ($y = $yearc ; $y >= $conf->years ; $y=$y-1 ) {
|
||||
for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) {
|
||||
|
||||
echo '<tr><td width="50%" valign="top">';
|
||||
/*
|
||||
* Collectée
|
||||
*/
|
||||
print "<table width=\"100%\">";
|
||||
print "<tr><td valign=\"top\">";
|
||||
|
||||
$sql = "SELECT sum(f.tva) as amount , date_format(f.datef,'%Y-%m') as dm";
|
||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1 AND f.datef >= '$y-01-01' AND f.datef <= '$y-12-31' ";
|
||||
$sql .= " GROUP BY dm ASC";
|
||||
|
||||
pt($db, $sql,"Année $y");
|
||||
|
||||
print "</td></tr></table>";
|
||||
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<TD width=\"30%\">Année $y</TD>";
|
||||
print "<TD align=\"right\">Collectée</TD>";
|
||||
print "<TD align=\"right\">Payée</TD>";
|
||||
print "<td> </td>\n";
|
||||
print "</TR>\n";
|
||||
$var=True;
|
||||
$total = 0;
|
||||
for ($m = 1 ; $m < 13 ; $m++ ) {
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print '<TD>'.strftime("%b %Y",mktime(0,0,0,$m,1,$y)).'</TD>';
|
||||
|
||||
$x_coll = tva_coll($db, $y, $m);
|
||||
print "<TD align=\"right\">".price($x_coll)."</TD>";
|
||||
|
||||
$x_paye = tva_paye($db, $y, $m);
|
||||
print "<TD align=\"right\">".price($x_paye)."</TD>";
|
||||
|
||||
$diff = $x_coll - $x_paye;
|
||||
$total = $total + $diff;
|
||||
|
||||
print "<td align=\"right\">".price($diff)."</td>\n";
|
||||
print "</TR>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '<tr><td align="right" colspan="3">Total :</td><td align="right"><b>'.price($total).'</b></td>';
|
||||
print "</TABLE>";
|
||||
|
||||
echo '</td><td valign="top" width="50%">';
|
||||
/*
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -18,6 +15,9 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
require("../../main.inc.php3");
|
||||
|
||||
@ -35,11 +35,15 @@ function llxHeader($head = "") {
|
||||
|
||||
$menu->add("/compta/facture.php3","Factures");
|
||||
|
||||
|
||||
$menu->add("../ca.php3","Chiffres d'affaires");
|
||||
|
||||
$menu->add("index.php3","TVA");
|
||||
|
||||
/*
|
||||
* A automatiser
|
||||
*
|
||||
*/
|
||||
$menu->add_submenu("index.php3?year=2002","2002");
|
||||
$menu->add_submenu("index.php3?year=2001","2001");
|
||||
|
||||
$menu->add("/compta/bank/index.php3","Bank");
|
||||
|
||||
|
||||
@ -127,25 +127,21 @@ if ($socid > 0) {
|
||||
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
|
||||
|
||||
print "<tr><td><div class=\"titre\">Fiche fournisseur : $objsoc->nom</div></td>";
|
||||
print "<td bgcolor=\"#e0E0E0\" align=\"center\"><a href=\"bookmark.php3?socidp=$objsoc->idp&action=add\">[Bookmark]</a></td>";
|
||||
print "<td bgcolor=\"#e0E0E0\" align=\"center\"><a href=\"projet/fiche.php3?socidp=$objsoc->idp&action=create\">[Projet]</a></td>";
|
||||
print "<td bgcolor=\"#e0E0E0\" align=\"center\"><a href=\"addpropal.php3?socidp=$objsoc->idp&action=create\">[Propal]</a></td>";
|
||||
print "<td><a href=\"socnote.php3?socid=$objsoc->idp\">Notes</a></td>";
|
||||
print "<td><a href=\"people.php3?socid=$objsoc->idp\">Contacts</a></td>";
|
||||
print "<td bgcolor=\"#e0E0E0\" align=\"center\">[<a href=\"../soc.php3?socid=$objsoc->idp&action=edit\">Editer</a>]</td>";
|
||||
print "</tr></table>";
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
print "<hr>";
|
||||
print "<table width=\"100%\" border=0><tr>\n";
|
||||
print "<td valign=\"top\">";
|
||||
print "<table cellspacing=\"0\" border=\"1\" width=\"100%\">";
|
||||
|
||||
print "<tr><td>Type</td><td> $objsoc->typent</td><td>Effectif</td><td>$objsoc->effectif</td></tr>";
|
||||
print "<tr><td>Tel</td><td> $objsoc->tel </td><td>fax</td><td>$objsoc->fax </td></tr>";
|
||||
?>
|
||||
<style type="text/css">
|
||||
td.border { border: 1px dashed #c0c0c0; }
|
||||
</style>
|
||||
<?PHP
|
||||
print '<table class="border" width="100%" border=0><tr>';
|
||||
print '<td valign="top">';
|
||||
print '<table cellspacing="0" border="0" width="100%">';
|
||||
print '<tr><td class="border">Tel</td><td>'.$objsoc->tel.' </td><td>fax</td><td>'.$objsoc->fax.' </td></tr>';
|
||||
print "<tr><td>Ville</td><td colspan=\"3\">".nl2br($objsoc->address)."<br>$objsoc->cp $objsoc->ville</td></tr>";
|
||||
|
||||
print "<tr><td>siren</td><td><a href=\"http://www.societe.com/cgi-bin/recherche?rncs=$objsoc->siren\">$objsoc->siren</a> </td>";
|
||||
@ -179,71 +175,6 @@ if ($socid > 0) {
|
||||
*/
|
||||
print "<tr><td valign=\"top\">";
|
||||
|
||||
/*
|
||||
* Propales
|
||||
*/
|
||||
$var=!$var;
|
||||
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"1\">";
|
||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.remise, ".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
||||
$sql .= " AND s.idp = $objsoc->idp ORDER BY p.datep DESC";
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
if ($num >0 ) {
|
||||
print "<tr $bc[$var]><td colspan=\"4\"><a href=\"propal.php3?socidp=$objsoc->idp\">liste des propales ($num)</td></tr>";
|
||||
}
|
||||
$i = 0; $now = time(); $lim = 3600 * 24 * 15 ;
|
||||
while ($i < $num && $i < 2) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD><a href=\"propal.php3?propalid=$objp->propalid\">$objp->ref</a>\n";
|
||||
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) {
|
||||
print " <b>> 15 jours</b>";
|
||||
}
|
||||
print "</td><TD align=\"right\">".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
||||
print "<TD align=\"right\">".price($objp->price - $objp->remise)."</TD>\n";
|
||||
print "<TD align=\"center\">$objp->statut</TD></tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
/*
|
||||
* Factures
|
||||
*/
|
||||
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
|
||||
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND s.idp = $objsoc->idp ORDER BY f.datef DESC";
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows(); $i = 0;
|
||||
if ($num > 0) {
|
||||
print "<tr $bc2[$var]>";
|
||||
print "<td colspan=\"3\"><a href=\"../compta/index.php3?socidp=$objsoc->idp\">liste des factures ($num)</td></tr>";
|
||||
}
|
||||
|
||||
while ($i < $num && $i < 2) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<TR $bc2[$var]>";
|
||||
print "<TD><a href=\"../compta/facture.php3?facid=$objp->facid\">$objp->facnumber</a></TD>\n";
|
||||
if ($objp->df > 0 ) {
|
||||
print "<TD align=\"right\">".strftime("%d %B %Y",$objp->df)."</TD>\n";
|
||||
} else {
|
||||
print "<TD align=\"right\"><b>!!!</b></TD>\n";
|
||||
}
|
||||
print "<TD align=\"right\">".number_format($objp->amount, 2, ',', ' ')."</TD>\n";
|
||||
$paye[1] = "payée";
|
||||
$paye[0] = "<b>non payée</b>";
|
||||
print "<TD align=\"center\">".$paye[$objp->paye]."</TD>\n";
|
||||
print "</TR>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
} else {
|
||||
print $db->error();
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
print "</td><td valign=\"top\">";
|
||||
/*
|
||||
*
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -18,6 +15,9 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
class Service {
|
||||
|
||||
@ -22,6 +22,12 @@
|
||||
-- Valeurs pour les bases de langues francaises
|
||||
--
|
||||
|
||||
delete from c_chargesociales;
|
||||
insert into c_chargesociales (id,libelle,deductible) values ( 1, 'Allocations familiales',1);
|
||||
insert into c_chargesociales (id,libelle,deductible) values ( 2, 'GSG Deductible',1);
|
||||
insert into c_chargesociales (id,libelle,deductible) values ( 3, 'GSG/CRDS NON Deductible',0);
|
||||
|
||||
|
||||
delete from c_actioncomm;
|
||||
insert into c_actioncomm (id,libelle) values ( 0, '-');
|
||||
insert into c_actioncomm (id,libelle) values ( 1, 'Appel Téléphonique');
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
-- ===========================================================================
|
||||
--
|
||||
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
@ -19,10 +15,24 @@
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- Valeurs de test pour les devellopements
|
||||
--
|
||||
-- Valeurs de test pour les developpements
|
||||
-- Ne pas hésiter a compléter ce fichier avec de nouvelles valeurs, plus on a
|
||||
-- de données, mieux on peut tester l'appli.
|
||||
-- ===========================================================================
|
||||
delete from llx_tva;
|
||||
insert into llx_tva (datep, datev, amount) values ('2001-11-11','2001-10-1',1960);
|
||||
|
||||
delete from llx_facture_fourn;
|
||||
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
|
||||
values ('LOL-509',1,'2001-05-09','2001-05-09',1,1000,0,196,1196,1,NULL,NULL,'');
|
||||
|
||||
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
|
||||
values ('02-1-YHGT',2,now(),'2002-01-01',1,100,0,19.6,119.6,1,NULL,NULL,'');
|
||||
insert into llx_facture_fourn (facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, fk_user_author, fk_user_valid, note)
|
||||
values ('02-5-YHGT',2,now(),'2002-05-01',1,1000,0,196,1196,1,NULL,NULL,'');
|
||||
|
||||
delete from llx_user;
|
||||
insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,admin,webcal_login)
|
||||
@ -77,8 +87,6 @@ values ('Nimbus','29490','Guipavas','01 55 55 03 18','01 55 55 55 55',1);
|
||||
|
||||
insert into societe (nom,cp,ville,tel,fax,client)
|
||||
values ('Iono','22110','Rostrenen','01 55 55 03 18','01 55 55 55 55',1);
|
||||
|
||||
|
||||
--
|
||||
-- Contact
|
||||
--
|
||||
@ -228,4 +236,35 @@ delete from llx_paiement;
|
||||
|
||||
delete from llx_compta_account;
|
||||
insert into llx_compta_account (datec, number, label, fk_user_author) values (now(),'431000','URSSAF',1);
|
||||
insert into llx_compta_account (datec, number, label, fk_user_author) values (now(),'654000','Clients',1);
|
||||
insert into llx_compta_account (datec, number, label, fk_user_author) values (now(),'654000','Clients',1);
|
||||
--
|
||||
-- Charges sociales (mais non on n'en paye pas trop ;-)
|
||||
--
|
||||
delete from llx_chargesociales;
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2002-05-15',NULL,'Acompte 1er Trimestre 2002',1,120,0,'2002-1-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2002-05-15',NULL,'Acompte 1er Trimestre 2002',2,200,0,'2002-1-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2002-05-15',NULL,'Acompte 1er Trimestre 2002',3,170,0,'2002-1-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2002-02-15','2002-02-10','Acompte 4ème Trimestre 2001',1,120,1,'2001-10-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2002-02-15','2002-02-10','Acompte 4ème Trimestre 2001',2,200,1,'2001-10-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2002-02-15','2002-02-10','Acompte 4ème Trimestre 2001',3,170,1,'2001-10-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2001-11-15','2001-10-10','Acompte 3ème Trimestre 2001',1,70,1,'2001-7-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2001-11-15','2001-10-10','Acompte 3ème Trimestre 2001',2,180,1,'2001-7-1');
|
||||
|
||||
insert into llx_chargesociales (date_ech,date_pai,libelle,fk_type,amount,paye,periode) values
|
||||
('2001-11-15','2001-10-10','Acompte 3ème Trimestre 2001',3,150,1,'2001-7-1');
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
--
|
||||
|
||||
|
||||
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (1,1,'2002-05-09 03:05:03','2002-05-09 12:00:00',11960,'rodo',0,'321654654','');
|
||||
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (1,1,'2002-05-09 03:05:03','2001-05-19 12:00:00',11960,'rodo',0,'321654654','');
|
||||
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (2,2,'2002-05-09 03:18:10','2002-04-12 12:00:00',500,'rodo',0,'255555','');
|
||||
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (3,2,'2002-05-09 03:18:32','2002-05-02 12:00:00',588.36,'rodo',0,'25555','');
|
||||
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (4,3,'2002-05-09 03:21:43','2002-03-30 12:00:00',11.96,'rodo',0,'','');
|
||||
@ -32,7 +32,7 @@ INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_pa
|
||||
--
|
||||
|
||||
|
||||
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (1,'F-BO-020509',1,'2002-05-09 03:04:48','2002-05-09',1,10000,0,1960,11960,1,'rodo',NULL,NULL,NULL,'');
|
||||
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (1,'F-BO-010509',1,'2001-05-09 03:04:48','2001-05-09',1,10000,0,1960,11960,1,'rodo',NULL,NULL,NULL,'');
|
||||
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (2,'F-DO-020410',3,'2002-05-09 03:17:44','2002-04-10',1,910,100,178.36,1088.36,1,'rodo',NULL,NULL,NULL,'');
|
||||
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (3,'F-BO-020314',1,'2002-05-09 03:21:25','2002-03-14',1,10,0,1.96,11.96,1,'rodo',NULL,NULL,NULL,'');
|
||||
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (4,'F-CU-020215',2,'2002-05-09 03:23:31','2002-02-15',1,10000,0,1960,11960,1,'rodo',NULL,NULL,NULL,'');
|
||||
|
||||
@ -26,6 +26,7 @@ all: show
|
||||
create:
|
||||
$(MYSQL) $(BASE) < actioncomm.sql
|
||||
$(MYSQL) $(BASE) < c_actioncomm.sql
|
||||
$(MYSQL) $(BASE) < c_chargesociales.sql
|
||||
$(MYSQL) $(BASE) < c_effectif.sql
|
||||
$(MYSQL) $(BASE) < c_paiement.sql
|
||||
$(MYSQL) $(BASE) < c_pays.sql
|
||||
@ -37,6 +38,7 @@ create:
|
||||
$(MYSQL) $(BASE) < llx_bank_categ.sql
|
||||
$(MYSQL) $(BASE) < llx_bank_class.sql
|
||||
$(MYSQL) $(BASE) < llx_bookmark.sql
|
||||
$(MYSQL) $(BASE) < llx_chargesociales.sql
|
||||
$(MYSQL) $(BASE) < llx_compta.sql
|
||||
$(MYSQL) $(BASE) < llx_compta_account.sql
|
||||
$(MYSQL) $(BASE) < llx_fa_pr.sql
|
||||
@ -51,6 +53,7 @@ create:
|
||||
$(MYSQL) $(BASE) < llx_propaldet.sql
|
||||
$(MYSQL) $(BASE) < llx_service.sql
|
||||
$(MYSQL) $(BASE) < llx_soc_recontact.sql
|
||||
$(MYSQL) $(BASE) < llx_tva.sql
|
||||
$(MYSQL) $(BASE) < llx_user.sql
|
||||
$(MYSQL) $(BASE) < llx_ventes.sql
|
||||
$(MYSQL) $(BASE) < llx_voyage.sql
|
||||
|
||||
@ -27,38 +27,14 @@ drop table if exists c_anexpe;
|
||||
|
||||
drop table if exists c_actioncomm;
|
||||
|
||||
drop table if exists c_categtools;
|
||||
|
||||
drop table if exists c_contrat ;
|
||||
|
||||
drop table if exists c_contrib;
|
||||
|
||||
drop table if exists c_diplome ;
|
||||
|
||||
drop table if exists c_duree;
|
||||
drop table if exists c_chargesociales;
|
||||
|
||||
drop table if exists c_effectif;
|
||||
|
||||
drop table if exists c_formatdoc;
|
||||
|
||||
drop table if exists c_lang ;
|
||||
|
||||
drop table if exists c_niveau ;
|
||||
|
||||
drop table if exists c_nivlang ;
|
||||
|
||||
drop table if exists c_outil ;
|
||||
|
||||
drop table if exists c_modecontact;
|
||||
|
||||
drop table if exists c_moderech ;
|
||||
|
||||
drop table if exists c_paiement ;
|
||||
|
||||
drop table if exists c_pays ;
|
||||
|
||||
drop table if exists c_poste ;
|
||||
|
||||
drop table if exists c_prestatype ;
|
||||
|
||||
drop table if exists c_propalst ;
|
||||
@ -77,6 +53,8 @@ drop table if exists llx_bank_class;
|
||||
|
||||
drop table if exists llx_bookmark;
|
||||
|
||||
drop table if exists llx_chargesociales;
|
||||
|
||||
drop table if exists llx_compta;
|
||||
|
||||
drop table if exists llx_compta_account;
|
||||
@ -105,6 +83,8 @@ drop table if exists llx_service;
|
||||
|
||||
drop table if exists llx_soc_recontact;
|
||||
|
||||
drop table if exists llx_tva;
|
||||
|
||||
drop table if exists llx_user;
|
||||
|
||||
drop table if exists llx_ventes;
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
-- ===========================================================================
|
||||
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
@ -18,6 +15,9 @@
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- ===========================================================================
|
||||
|
||||
create table llx_facture_fourn
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2000-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
-- Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
@ -18,9 +15,11 @@
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
--
|
||||
-- $Id$
|
||||
-- $Source$
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
create table llx_tva
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user