pre-release

This commit is contained in:
Rodolphe Quiedeville 2003-06-20 14:30:08 +00:00
parent 7dec4f4959
commit fb1b43d226
19 changed files with 261 additions and 317 deletions

View File

@ -37,6 +37,11 @@ if (!$user->admin)
// TODO mettre cette section dans la base de données // TODO mettre cette section dans la base de données
// //
$modules["MAIN_MODULE_SOCIETE"][0] = "Module societe";
$modules["MAIN_MODULE_SOCIETE"][1] = "MAIN_MODULE_SOCIETE";
$modules["MAIN_MODULE_SOCIETE"][2] = MAIN_MODULE_SOCIETE;
$modules["MAIN_MODULE_SOCIETE"][3] = "Module société";
$modules["MAIN_MODULE_COMMERCIAL"][0] = "Module commercial"; $modules["MAIN_MODULE_COMMERCIAL"][0] = "Module commercial";
$modules["MAIN_MODULE_COMMERCIAL"][1] = "MAIN_MODULE_COMMERCIAL"; $modules["MAIN_MODULE_COMMERCIAL"][1] = "MAIN_MODULE_COMMERCIAL";
$modules["MAIN_MODULE_COMMERCIAL"][2] = MAIN_MODULE_COMMERCIAL; $modules["MAIN_MODULE_COMMERCIAL"][2] = MAIN_MODULE_COMMERCIAL;

View File

@ -86,7 +86,6 @@ if ( $db->query($sql) )
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green.png" border="0"></a></td>'; print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green.png" border="0"></a></td>';
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red_light.png" border="0"></a></td>'; print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red_light.png" border="0"></a></td>';
print '<TD align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>'; print '<TD align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
} }
else else
{ {

View File

@ -19,7 +19,8 @@
* $Source$ * $Source$
*/ */
class Account { class Account
{
var $rowid; var $rowid;
var $bank; var $bank;
@ -33,9 +34,10 @@ class Account {
var $bic; var $bic;
var $iban_prefix; var $iban_prefix;
Function Account($DB, $rowid=0) { Function Account($DB, $rowid=0)
{
global $config; global $config;
$this->clos = 0; $this->clos = 0;
$this->db = $DB; $this->db = $DB;
$this->rowid = $rowid; $this->rowid = $rowid;
@ -46,11 +48,18 @@ class Account {
* *
* *
*/ */
/*
* Function addline($date, $oper, $label, $amount, $num_chq="")
* {
* $sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author, num_chq,fk_account, fk_type)";
*/ $sql .= " VALUES (now(), $date, '$label', $amount,'$author',$num_chq,$this->rowid,'$operation')";
if ($this->db->query($sql))
{
return 1;
}
}
Function create() Function create()
{ {
$sql = "INSERT INTO llx_bank_account (datec, label) values (now(),'$this->label');"; $sql = "INSERT INTO llx_bank_account (datec, label) values (now(),'$this->label');";
@ -139,6 +148,10 @@ class Account {
} }
$this->db->free(); $this->db->free();
} }
else
{
print $this->db->error();
}
} }
/* /*
* *

View File

@ -54,30 +54,31 @@ if ($result) {
} }
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">"; print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
print "<TR class=\"liste_titre\">"; print '<TR class="liste_titre">';
print "<td>Label</td><td>Banque</TD>"; print "<td>Compte</td><td>Banque</TD>";
print "<td align=\"left\">Numéro</a></TD><td align=\"right\">Solde</td><td>&nbsp;</td>"; print "<td align=\"left\">Numéro</a></TD><td align=\"right\">Solde</td><td>&nbsp;</td>";
print "</TR>\n"; print "</TR>\n";
$total = 0; $total = 0;
for ($i = 0 ; $i < sizeof($accounts) ; $i++) { for ($i = 0 ; $i < sizeof($accounts) ; $i++)
{
$acc = new Account($db); $acc = new Account($db);
$acc->fetch($accounts[$i]); $acc->fetch($accounts[$i]);
if ($acc->courant) { if ($acc->courant)
$solde = $acc->solde(); {
$solde = $acc->solde();
print "<tr><td>"; print "<tr><td>";
print '<a href="account.php3?account='.$acc->id.'">'.$acc->label.'</a>'; print '<a href="account.php3?account='.$acc->id.'">'.$acc->label.'</a>';
print "</td><td>$acc->bank</td><td>$acc->number</td>"; print "</td><td>$acc->bank</td><td>$acc->number</td>";
print '</td><td align="right">'.price($solde).'</td><td>&nbsp;</td></tr>'; print '</td><td align="right">'.price($solde).'</td><td>&nbsp;</td></tr>';
$total += $solde; $total += $solde;
} }
} }
print '<tr><td colspan="3" align="right"><b>Total</b></td><td align="right"><b>'.price($total).'</b></td><td>euros HT</td></tr>'; print '<tr><td colspan="3" align="right"><b>Total</b></td><td align="right"><b>'.price($total).'</b></td><td>euros</td></tr>';
print '<tr class="liste_titre"><td colspan="5">Dettes</td></tr>'; print '<tr class="liste_titre"><td colspan="5">Dettes</td></tr>';
/* /*
* TVA * TVA
@ -106,7 +107,7 @@ print '<tr><td colspan="3">URSSAF</td><td align="right">'.price($chs_a_payer).'<
* *
*/ */
print '<tr><td colspan="3" align="right"><b>Total</b></td><td align="right"><b>'.price($total).'</b></td><td>euros HT</td></tr>'; print '<tr><td colspan="3" align="right"><b>Total</b></td><td align="right"><b>'.price($total).'</b></td><td>euros</td></tr>';
/* /*
* *

View File

@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
@ -25,14 +25,17 @@ llxHeader();
$db = new Db(); $db = new Db();
function valeur($sql) { function valeur($sql)
{
global $db; global $db;
if ( $db->query($sql) ) { if ( $db->query($sql) )
if ( $db->num_rows() ) { {
$valeur = $db->result(0,0); if ( $db->num_rows() )
{
$valeur = $db->result(0,0);
}
$db->free();
} }
$db->free();
}
return $valeur; return $valeur;
} }
/* /*
@ -40,23 +43,9 @@ function valeur($sql) {
*/ */
$db = new Db(); $db = new Db();
if ($action == 'add_bookmark') {
$sql = "INSERT INTO llx_bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");";
if (! $db->query($sql) ) {
print $db->error();
}
}
if ($action == 'del_bookmark') {
$sql = "DELETE FROM llx_bookmark WHERE rowid=$bid";
$result = $db->query($sql);
}
print_titre("Charges"); print_titre("Charges");
print '<TABLE border="0" cellspacing="0" cellpadding="4" width="100%">';
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Factures</td>"; print "<td colspan=\"2\">Factures</td>";
print "</TR>\n"; print "</TR>\n";
@ -66,7 +55,8 @@ $sql .= " FROM c_chargesociales as c, llx_chargesociales as s";
$sql .= " WHERE s.fk_type = c.id AND s.paye = 1"; $sql .= " WHERE s.fk_type = c.id AND s.paye = 1";
$sql .= " GROUP BY lower(c.libelle) ASC"; $sql .= " GROUP BY lower(c.libelle) ASC";
if ( $db->query($sql) ) { if ( $db->query($sql) )
{
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;

View File

@ -96,7 +96,7 @@ function pt ($db, $sql, $date)
if ($result) { if ($result) {
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $total = 0 ; $i = 0; $total = 0 ;
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">"; print '<p><TABLE border="1" width="100%" cellspacing="0" cellpadding="3">';
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<TD width=\"60%\">$date</TD>"; print "<TD width=\"60%\">$date</TD>";
print "<TD align=\"right\">Montant</TD>"; print "<TD align=\"right\">Montant</TD>";

View File

@ -86,7 +86,7 @@ print '<tr class="liste_titre"><td></td>';
$year_current = strftime("%Y",time()); $year_current = strftime("%Y",time());
if ($year_current > (MAIN_START_YEAR + 2)) if ($year_current < (MAIN_START_YEAR + 2))
{ {
$year_start = MAIN_START_YEAR; $year_start = MAIN_START_YEAR;
$year_end = (MAIN_START_YEAR + 2); $year_end = (MAIN_START_YEAR + 2);

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* $Id$ * $Id$
* $Source$ * $Source$
@ -25,14 +25,17 @@ llxHeader();
$db = new Db(); $db = new Db();
function valeur($sql) { function valeur($sql)
{
global $db; global $db;
if ( $db->query($sql) ) { if ( $db->query($sql) )
if ( $db->num_rows() ) { {
$valeur = $db->result(0,0); if ( $db->num_rows() )
{
$valeur = $db->result(0,0);
}
$db->free();
} }
$db->free();
}
return $valeur; return $valeur;
} }
/* /*
@ -41,18 +44,15 @@ function valeur($sql) {
$db = new Db(); $db = new Db();
if ($action == 'add') { if ($action == 'add')
{
$sql = "INSERT INTO llx_chargesociales (fk_type, libelle, date_ech,amount) "; $sql = "INSERT INTO llx_chargesociales (fk_type, libelle, date_ech,amount) ";
$sql .= " VALUES ($type,'$libelle','$date',$amount);"; $sql .= " VALUES ($type,'$libelle','$date',$amount);";
if (! $db->query($sql) ) { if (! $db->query($sql) )
print $db->error(); {
} print $db->error();
} }
if ($action == 'del_bookmark') {
$sql = "DELETE FROM llx_bookmark WHERE rowid=$bid";
$result = $db->query($sql);
} }
print_titre("Charges sociales $year"); print_titre("Charges sociales $year");
@ -73,34 +73,40 @@ 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 periode,".$db->pdate("s.date_pai")." 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 .= " FROM c_chargesociales as c, llx_chargesociales as s";
$sql .= " WHERE s.fk_type = c.id"; $sql .= " WHERE s.fk_type = c.id";
if ($year > 0) { if ($year > 0)
{
$sql .= " AND date_format(s.periode, '%Y') = $year"; $sql .= " AND date_format(s.periode, '%Y') = $year";
} }
$sql .= " ORDER BY lower(s.date_ech) DESC"; $sql .= " ORDER BY lower(s.date_ech) DESC";
if ( $db->query($sql) ) { if ( $db->query($sql) )
{
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
while ($i < $num) { while ($i < $num)
$obj = $db->fetch_object( $i); {
$var = !$var; $obj = $db->fetch_object( $i);
print "<tr $bc[$var]>"; $var = !$var;
print '<td>'.strftime("%d %b %y",$obj->de).'</td>'; print "<tr $bc[$var]>";
print '<td><a href="index.php3?year='.strftime("%Y",$obj->periode).'">'.strftime("%Y",$obj->periode).'</a></td>'; print '<td>'.strftime("%d %b %y",$obj->de).'</td>';
print '<td>'.$obj->nom.'</td><td>'.$obj->libelle.'</td>'; print '<td><a href="index.php3?year='.strftime("%Y",$obj->periode).'">'.strftime("%Y",$obj->periode).'</a></td>';
print '<td align="right">'.price($obj->amount).'</td>'; print '<td>'.$obj->nom.'</td><td>'.$obj->libelle.'</td>';
print '<td align="right">'.price($obj->amount).'</td>';
if ($obj->paye) {
print '<td colspan="2">'.strftime("%d/%m/%y",$obj->dp).'</td>'; if ($obj->paye)
} else { {
print '<td><img src="/theme/'.$conf->theme.'/img/editdelete.png" border="0"></a></td>'; print '<td colspan="2">'.strftime("%d/%m/%y",$obj->dp).'</td>';
print '<td><img src="/theme/'.$conf->theme.'/img/editdelete.png" border="0"></a></td>'; } else {
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 '</tr>';
$i++;
} }
print '</tr>'; }
$i++; else
} {
} else {
print $db->error(); print $db->error();
} }
/* /*
@ -118,22 +124,23 @@ print '<td colspan="2"><select name="type">';
$sql = "SELECT c.id, c.libelle as nom FROM c_chargesociales as c"; $sql = "SELECT c.id, c.libelle as nom FROM c_chargesociales as c";
$sql .= " ORDER BY lower(c.libelle) ASC"; $sql .= " ORDER BY lower(c.libelle) ASC";
if ( $db->query($sql) ) { if ( $db->query($sql) )
{
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
while ($i < $num) { while ($i < $num)
$obj = $db->fetch_object( $i); {
print '<option value="'.$obj->id.'">'.$obj->nom; $obj = $db->fetch_object( $i);
$i++; print '<option value="'.$obj->id.'">'.$obj->nom;
} $i++;
}
} }
print '</select>'; print '</select>';
print '<input type="text" size="20" name="libelle"></td>'; print '<input type="text" size="20" name="libelle"></td>';
print '<td align="right"><input type="text" size="6" name="amount"></td>'; print '<td align="right"><input type="text" size="6" name="amount"></td>';
print '<tr><td><input type="submit"></form></td>'; print '<tr><td><input type="submit"></form></td>';
print '</table>'; print '</table>';

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -42,17 +42,19 @@ function tva_coll($db, $y,$m) {
* *
* *
*/ */
function tva_paye($db, $y,$m) { function tva_paye($db, $y,$m)
$sql = "SELECT sum(f.tva) as amount"; {
$sql = "SELECT sum(f.total_tva) as amount";
$sql .= " FROM llx_facture_fourn as f WHERE f.paye = 1"; $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,'%Y') = $y";
$sql .= " AND date_format(f.datef,'%m') = $m"; $sql .= " AND date_format(f.datef,'%m') = $m";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result)
$obj = $db->fetch_object ( 0 ); {
return $obj->amount; $obj = $db->fetch_object ( 0 );
} return $obj->amount;
}
} }
function pt ($db, $sql, $date) { function pt ($db, $sql, $date) {
@ -101,7 +103,7 @@ $db = new Db();
$tva = new Tva($db); $tva = new Tva($db);
print "Solde :" . price($tva->solde($year)); print_titre( "TVA Solde : " . price($tva->solde($year)) . " euros");
if ($year == 0 ) { if ($year == 0 ) {
$year_current = strftime("%Y",time()); $year_current = strftime("%Y",time());
@ -112,7 +114,7 @@ if ($year == 0 ) {
$year_start = $year; $year_start = $year;
} }
echo '<table width="100%">'; echo '<table width="100%">';
echo '<tr><td width="50%" valign="top"><b>TVA collectée</b></td>'; echo '<tr><td width="50%" valign="top">TVA collectée</td>';
echo '<td>Tva Réglée</td></tr>'; echo '<td>Tva Réglée</td></tr>';
for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) { for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) {

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -27,41 +27,11 @@ require("../../tva.class.php3");
* *
*/ */
function pt ($db, $sql, $date) { function pt ($db, $sql, $date)
{
global $bc; global $bc;
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
$i = 0;
$total = 0 ;
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\">";
print "<TD width=\"60%\">$date</TD>";
print "<TD align=\"right\">Montant</TD>";
print "<td>&nbsp;</td>\n";
print "</TR>\n";
$var=True;
while ($i < $num) {
$obj = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD>$obj->dm</TD>\n";
$total = $total + $obj->amount;
print "<TD align=\"right\">".price($obj->amount)."</TD>";
print "<td align=\"right\">".$total."</td>\n";
print "</TR>\n";
$i++;
}
print "<tr><td align=\"right\">Total :</td><td align=\"right\"><b>".price($total)."</b></td><td>euros&nbsp;HT</td></tr>";
print "</TABLE>";
$db->free();
} else {
print $db->error();
}
} }
/* /*
@ -74,32 +44,50 @@ $db = new Db();
$tva = new Tva($db); $tva = new Tva($db);
print_titre("Tva Réglée"); print_titre("Réglements TVA");
echo '<table width="100%">'; $sql = "SELECT amount, date_format(f.datev,'%d-%M-%Y') as dm";
$sql .= " FROM llx_tva as f ";
$sql .= " Order BY dm DESC";
for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) { $result = $db->query($sql);
if ($result)
echo '<tr>'; {
echo '<td valign="top" width="50%">'; $num = $db->num_rows();
$i = 0;
print "<table width=\"100%\">"; $total = 0 ;
print "<tr><td valign=\"top\">"; print '<p><TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">';
$sql = "SELECT amount, date_format(f.datev,'%d-%M-%Y') as dm"; print "<TD width=\"60%\">Date</TD>";
$sql .= " FROM llx_tva as f "; print "<TD align=\"right\">Montant</TD>";
$sql .= " Order BY dm DESC"; print "<td>&nbsp;</td>\n";
print "</TR>\n";
$var=True;
while ($i < $num)
{
$obj = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD>$obj->dm</TD>\n";
$total = $total + $obj->amount;
print "<TD align=\"right\">".price($obj->amount)."</TD>";
print "<td align=\"right\">".$total."</td>\n";
print "</TR>\n";
$i++;
}
print "<tr><td align=\"right\">Total :</td>";
print "<td align=\"right\"><b>".price($total)."</b></td><td>euros&nbsp;HT</td></tr>";
pt($db, $sql,"Date"); print "</TABLE>";
$db->free();
print "</td></tr></table>";
echo '</td></tr>';
} }
else
echo '</table>'; {
print $db->error();
}
$db->close(); $db->close();

View File

@ -24,37 +24,40 @@ class Conf {
var $readonly; var $readonly;
var $dbi; var $dbi;
Function Conf() { Function Conf()
{
/* A conserver */
$this->db = new DbConf();
/* A verifier */
$this->theme = "dolibarr";
$this->css = "theme/".$this->theme."/".$this->theme.".css";
$this->liste_limit = 10;
$this->societe = 1;
$this->voyage = 0;
$this->compta = new ComptaConf();
$this->propal = new PropalConf();
$this->facture = new FactureConf();
$this->fichinter = new FicheInterConf();
$this->webcal = new WebcalConf();
$this->produit = new ProduitConf();
$this->service = new ServiceConf();
$this->adherent = new AdherentConf();
$this->domaine = new DomaineConf();
$this->readonly = 0;
$this->theme = "dolibarr"; $this->years = 2001;
$this->css = "theme/".$this->theme."/".$this->theme.".css"; $this->password_encrypted = 1;
$this->liste_limit = 10; }
$this->db = new DbConf();
$this->societe = 1;
$this->voyage = 0;
$this->compta = new ComptaConf();
$this->propal = new PropalConf();
$this->facture = new FactureConf();
$this->fichinter = new FicheInterConf();
$this->webcal = new WebcalConf();
$this->produit = new ProduitConf();
$this->service = new ServiceConf();
$this->adherent = new AdherentConf();
$this->domaine = new DomaineConf();
$this->readonly = 0;
$this->years = 2001;
$this->password_encrypted = 1;
}
} }
class ComptaConf class ComptaConf
@ -74,8 +77,6 @@ class PropalConf {
$this->replytoname = "Service Commercial"; $this->replytoname = "Service Commercial";
$this->replytomail = "commercial@propal.com"; $this->replytomail = "commercial@propal.com";
$this->templatesdir = "/home/www/dolibarr/dolibarr/templates/propal/default";
$this->outputdir = "/home/www/dolibarr/dolibarr/htdocs/document/propal";
/* /*
* Without ended slash * Without ended slash
*/ */
@ -84,15 +85,16 @@ class PropalConf {
} }
/* /*
* Base de données * Base de données
* * Ne pas modifier ces valeurs
*/ */
class DbConf { class DbConf {
Function DbConf() { Function DbConf() {
$this->type = "mysql"; $this->type = "mysql";
$this->host = "localhost"; $this->host = "";
$this->user = ""; $this->user = "";
$this->pass = ""; $this->pass = "";
$this->name = "dolibarr"; $this->name = "";
/* /*
* If you want to activate virtualhosting you need tou use these lines and add * If you want to activate virtualhosting you need tou use these lines and add
* this to your pache virtualhost file * this to your pache virtualhost file
@ -111,6 +113,7 @@ class DbConf {
*/ */
} }
} }
/* /*
* Calendrier * Calendrier

View File

@ -119,11 +119,11 @@ if ($result)
print "<TR $bc[$var]>"; print "<TR $bc[$var]>";
print "<TD>$obj->name</TD>"; print '<TD><a href="/comm/people.php3?contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->name.'</a></TD>';
print "<TD>$obj->firstname</TD>"; print "<TD>$obj->firstname</TD>";
print '<TD><a href="contact.php?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;'; print '<TD><a href="contact.php?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;';
print "<a href=\"fiche.php3?socid=$obj->idp\">$obj->nom</A></td>\n"; print "<a href=\"/comm/fiche.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
print '<td><a href="action/fiche.php3?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php3?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a>&nbsp;</td>';

View File

@ -36,7 +36,7 @@ if ($user->societe_id > 0)
if ($socidp) if ($socidp)
{ {
$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM societe as s WHERE s.idp = $socidp;"; $sql = "SELECT s.nom, s.idp, s.prefix_comm FROM llx_societe as s WHERE s.idp = $socidp;";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
@ -95,14 +95,18 @@ if ($action == 'update')
} }
/* /*
* *
* Generation * Generation du pdf
* *
*/ */
if ($action == 'generate') if ($action == 'generate')
{ {
if ($id) if ($id)
{ {
print fichinter_pdf_create($db, $id);
//$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo"; //$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo";
/*
$command = 'export LC_TIME=fr_FR ; export DBI_DSN="dbi:'.$conf->db->type.':dbname='.$conf->db->name.':host='.$conf->db->host.'"'; $command = 'export LC_TIME=fr_FR ; export DBI_DSN="dbi:'.$conf->db->type.':dbname='.$conf->db->name.':host='.$conf->db->host.'"';
$command .= " ; ./tex-fichinter.pl --fichinter=".$id ; $command .= " ; ./tex-fichinter.pl --fichinter=".$id ;
@ -113,7 +117,7 @@ if ($action == 'generate')
$output = system($command); $output = system($command);
print $output; print $output;
print "<p>command : <b>$command<br>"; print "<p>command : <b>$command<br>";
*/
} }
else else
{ {
@ -140,9 +144,10 @@ if ($action == 'create')
{ {
$num = $db->result(0, 0); $num = $db->result(0, 0);
$db->free(); $db->free();
if ($num > 0) { if ($num > 0)
$numpr .= "." . ($num + 1); {
} $numpr .= "." . ($num + 1);
}
} }
$fix = new Fichinter($db); $fix = new Fichinter($db);
@ -251,7 +256,6 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '</form>'; print '</form>';
print "<hr noshade>";
} }
else else
{ {

View File

@ -121,8 +121,7 @@ class Fichinter {
*$num = 'FI-' . $prefix_comm . '-' . substr($num, strlen($num) - 4, 4); *$num = 'FI-' . $prefix_comm . '-' . substr($num, strlen($num) - 4, 4);
*/ */
$num = substr($num, 3); $num = substr($num, 3);
$num = substr(strstr($num, "-"),1); $num = substr(strstr($num, "-"),1);
print $num."</br>";
$num = $num + 1; $num = $num + 1;
//$num = '0000' . $num; //$num = '0000' . $num;

View File

@ -39,7 +39,7 @@ Class pdf_soleil {
if (defined("FICHEINTER_OUTPUTDIR")) if (defined("FICHEINTER_OUTPUTDIR"))
{ {
$dir = FAC_OUTPUTDIR . "/" . $fich->ref . "/" ; $dir = FICHEINTER_OUTPUTDIR . "/" . $fich->ref . "/" ;
$file = $dir . $fich->ref . ".pdf"; $file = $dir . $fich->ref . ".pdf";
if (! file_exists($dir)) if (! file_exists($dir))
@ -91,7 +91,7 @@ Class pdf_soleil {
*/ */
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','B',12); $pdf->SetFont('Arial','B',12);
$fac->fetch_client(); //$fac->fetch_client();
$pdf->SetXY(102,42); $pdf->SetXY(102,42);
$pdf->MultiCell(66,5, $fac->client->nom); $pdf->MultiCell(66,5, $fac->client->nom);
$pdf->SetFont('Arial','B',11); $pdf->SetFont('Arial','B',11);
@ -166,103 +166,13 @@ Class pdf_soleil {
/* /*
* *
*/ */
$tab2_top = 212;
$tab2_height = 24;
$pdf->SetFont('Arial','', 12);
$pdf->Rect(132, $tab2_top, 68, $tab2_height);
$pdf->line(132, $tab2_top + $tab2_height - 24, 200, $tab2_top + $tab2_height - 24 );
$pdf->line(132, $tab2_top + $tab2_height - 16, 200, $tab2_top + $tab2_height - 16 );
$pdf->line(132, $tab2_top + $tab2_height - 8, 200, $tab2_top + $tab2_height - 8 );
$pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height);
$pdf->SetXY (132, $tab2_top + 0);
$pdf->MultiCell(42, 8, "Total HT", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + 8);
$pdf->MultiCell(42, 8, "Total TVA", 0, 'R', 0);
$pdf->SetXY (132, $tab2_top + 16);
$pdf->MultiCell(42, 8, "Total TTC", 1, 'R', 1);
$pdf->SetXY (174, $tab2_top + 0);
$pdf->MultiCell(26, 8, price($fac->total_ht), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + 8);
$pdf->MultiCell(26, 8, price($fac->total_tva), 0, 'R', 0);
$pdf->SetXY (174, $tab2_top + 16);
$pdf->MultiCell(26, 8, price($fac->total_ttc), 1, 'R', 1);
/*
*
*/
$tab3_top = 240;
$tab3_height = 18;
$tab3_width = 60;
$pdf->Rect(10, $tab3_top, $tab3_width, $tab3_height); $pdf->Output($file);
$pdf->line(10, $tab3_top + 6, $tab3_width+10, $tab3_top + 6 );
$pdf->line(10, $tab3_top + 12, $tab3_width+10, $tab3_top + 12 );
$pdf->line(30, $tab3_top, 30, $tab3_top + $tab3_height );
$pdf->SetFont('Arial','',8);
$pdf->SetXY (10, $tab3_top - 6);
$pdf->MultiCell(60, 6, "Informations complémentaires", 0, 'L', 0);
$pdf->SetXY (10, $tab3_top );
$pdf->MultiCell(20, 6, "Réglé le", 0, 'L', 0);
$pdf->SetXY (10, $tab3_top + 6);
$pdf->MultiCell(20, 6, "Chèque N°", 0, 'L', 0);
$pdf->SetXY (10, $tab3_top + 12);
$pdf->MultiCell(20, 6, "Banque", 0, 'L', 0);
/*
*
*/
if (defined("FACTURE_RIB_NUMBER"))
{
if (FACTURE_RIB_NUMBER > 0)
{
$account = new Account($this->db);
$account->fetch(FACTURE_RIB_NUMBER);
$pdf->SetXY (10, 40);
$pdf->SetFont('Arial','U',8);
$pdf->MultiCell(40, 4, "Coordonnées bancaire", 0, 'L', 0);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(40, 4, "Code banque : " . $account->code_banque, 0, 'L', 0);
$pdf->MultiCell(40, 4, "Code guichet : " . $account->code_guichet, 0, 'L', 0);
$pdf->MultiCell(50, 4, "Numéro compte : " . $account->number, 0, 'L', 0);
$pdf->MultiCell(40, 4, "Clé RIB : " . $account->cle_rib, 0, 'L', 0);
$pdf->MultiCell(40, 4, "Domiciliation : " . $account->domiciliation, 0, 'L', 0);
$pdf->MultiCell(40, 4, "Prefix IBAN : " . $account->iban_prefix, 0, 'L', 0);
$pdf->MultiCell(40, 4, "BIC : " . $account->bic, 0, 'L', 0);
}
} }
/*
*
*
*/
$pdf->SetFont('Arial','U',12);
$pdf->SetXY(10, 220);
$pdf->MultiCell(190, 5, "Conditions de réglement : à réception de facture.", 0, 'J');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(10, 265);
$pdf->MultiCell(190, 5, "Accepte le réglement des sommes dues par chèques libellés à mon nom en ma qualité de Membre d'une Association de Gestion agréée par l'Administration Fiscale.", 0, 'J');
$pdf->Output($file);
} }
} }
}
} }
?> ?>

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -43,6 +43,15 @@ td.menu
border-bottom: 1px solid #000000; border-bottom: 1px solid #000000;
} }
td.border
{
border-top: 1px solid #000000;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
border-left: 1px solid #000000;
}
.menu .menu
{ {
background: #ccccb3; background: #ccccb3;
@ -94,7 +103,7 @@ div.titre
*/ */
tr.liste_titre tr.liste_titre
{ {
background: #999966; background: #BBBB88;
font-family: Helvetica, Verdana; font-size: 14px; font-weight: bold; font-family: Helvetica, Verdana; font-size: 14px; font-weight: bold;
} }

View File

@ -202,11 +202,11 @@ class User {
* *
* *
*/ */
Function password($password='',$password_encrypted=0) Function password($password='', $password_encrypted = 0)
{ {
if (! $password) if (! $password)
{ {
$password = substr(crypt(uniqid("")),0,8); $password = strtolower(substr(md5(uniqid(rand())),0,6));
} }
if ($password_encrypted) if ($password_encrypted)

View File

@ -69,25 +69,34 @@ if ($_POST["action"] == 'update' && $user->admin)
$edituser->email = $_POST["email"]; $edituser->email = $_POST["email"];
$edituser->admin = $_POST["admin"]; $edituser->admin = $_POST["admin"];
$edituser->webcal_login = $_POST["webcal_login"]; $edituser->webcal_login = $_POST["webcal_login"];
if (isset($_POST["module_compta"]) && $_POST["module_compta"] ==1){
$edituser->compta = 1; if (isset($_POST["module_compta"]) && $_POST["module_compta"] ==1)
}else{ {
$edituser->compta = 0; $edituser->compta = 1;
} }
if (isset($_POST["module_comm"]) && $_POST["module_comm"] ==1){ else
$edituser->comm = 1; {
}else{ $edituser->compta = 0;
$edituser->comm = 0; }
}
if (isset($_POST["module_comm"]) && $_POST["module_comm"] ==1)
{
$edituser->comm = 1;
}
else
{
$edituser->comm = 0;
}
// if (! $edituser->update($id, $user)) // if (! $edituser->update($id, $user))
if (! $edituser->update()) if (! $edituser->update())
{ {
print $edituser->error(); print $edituser->error();
} }
if (isset($password) && $password !='' ){ if (isset($password) && $password !='' )
$edituser->password($password,$conf->password_encrypted); {
} $edituser->password($password,$conf->password_encrypted);
}
} }
if ($action == 'password' && $user->admin) if ($action == 'password' && $user->admin)
@ -97,7 +106,7 @@ if ($action == 'password' && $user->admin)
if ($edituser->password('',$conf->password_encrypted)) if ($edituser->password('',$conf->password_encrypted))
{ {
print "Mot de passe changé et envoyé à $edituser->email<p>"; $message = "Mot de passe changé et envoyé à $edituser->email";
} }
} }
@ -171,7 +180,7 @@ else
$fuser = new User($db, $id); $fuser = new User($db, $id);
$fuser->fetch(); $fuser->fetch();
print '<div class="titre">Fiche utilisateur</div><br>'; print '<div class="titre">Fiche utilisateur</div><b>'.$message.'</b><br>';
print '<table width="100%" border="1" cellpadding="3" cellspacing="0">'; print '<table width="100%" border="1" cellpadding="3" cellspacing="0">';
@ -195,6 +204,11 @@ else
print '<td width="25%" valign="top">Module Commercial</td>'; print '<td width="25%" valign="top">Module Commercial</td>';
print '<td width="25%" class="valeur">'.$yn[$fuser->comm].'</td></tr>'; print '<td width="25%" class="valeur">'.$yn[$fuser->comm].'</td></tr>';
print '<tr><td width="25%" valign="top">Id Société</td>';
print '<td width="25%" class="valeur">'.$fuser->societe_id.'&nbsp;</td>';
print '<td width="25%" valign="top">&nbsp;</td>';
print '<td width="25%" class="valeur">&nbsp;</td></tr>';
print '<tr><td width="25%" valign="top">Note</td>'; print '<tr><td width="25%" valign="top">Note</td>';
print '<td colspan="3" class="valeur">'.nl2br($fuser->note).'&nbsp;</td></tr>'; print '<td colspan="3" class="valeur">'.nl2br($fuser->note).'&nbsp;</td></tr>';
@ -213,7 +227,7 @@ else
print '<td width="25%" align="center">-</td>'; print '<td width="25%" align="center">-</td>';
if ($user->id == $id) if ($user->id == $id or $user->admin)
{ {
print '<td width="25%" align="center">[<a href="fiche.php3?action=password&id='.$id.'">Nouveau mot de passe</a>]</td>'; print '<td width="25%" align="center">[<a href="fiche.php3?action=password&id='.$id.'">Nouveau mot de passe</a>]</td>';
} }