Modif html
This commit is contained in:
parent
dc91f910a2
commit
1d90f34e3a
@ -91,33 +91,35 @@ function pt ($db, $sql, $date)
|
||||
$bc[1]="class=\"impair\"";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0 ;
|
||||
print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="3">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<TD width=\"60%\">$date</TD>";
|
||||
print "<TD align=\"right\">Montant</TD>";
|
||||
print "<td> </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";
|
||||
print "<TD align=\"right\">".price($obj->amount)."</TD><td> </td>\n";
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0 ;
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<TD width=\"60%\">$date</TD>";
|
||||
print "<TD align=\"right\">Montant</TD>";
|
||||
print "<td> </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";
|
||||
print "<TD align=\"right\">".price($obj->amount)."</TD><td> </td>\n";
|
||||
print "</TR>\n";
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="total"><td align="right">Total :</td><td align="right"><b>'.price($total).'</b></td><td>'.MAIN_MONNAIE.' HT</td></tr>';
|
||||
|
||||
$i++;
|
||||
print "</TABLE>";
|
||||
$db->free();
|
||||
}
|
||||
print '<tr class="total"><td align="right">Total :</td><td align="right"><b>'.price($total).'</b></td><td>euros HT</td></tr>';
|
||||
|
||||
print "</TABLE>";
|
||||
$db->free();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ if ($user->societe_id > 0)
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
print_titre("Chiffres d'affaires en euros HT");
|
||||
print_titre("Chiffres d'affaires (".MAIN_MONNAIE." HT)");
|
||||
|
||||
$sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm";
|
||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1";
|
||||
@ -59,7 +59,7 @@ if ($result)
|
||||
}
|
||||
}
|
||||
|
||||
print '<table width="100%" border="1" cellspacing="0" cellpadding="3">';
|
||||
print '<table width="100%" class="border" cellspacing="0" cellpadding="3">';
|
||||
print '<tr class="liste_titre"><td> </td>';
|
||||
|
||||
|
||||
|
||||
@ -33,8 +33,8 @@ if ($user->societe_id > 0)
|
||||
function pt ($db, $sql, $title) {
|
||||
global $bc;
|
||||
|
||||
print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print "<TD>$title</TD>";
|
||||
print "<TD align=\"right\">Montant</TD>";
|
||||
|
||||
@ -58,7 +58,7 @@ function pt ($db, $sql, $title) {
|
||||
$total = $total + $obj->amount;
|
||||
$i++;
|
||||
}
|
||||
print "<tr class=\"total\"><td colspan=\"2\" align=\"right\"><b>Total : ".price($total)."</b> euros HT</td></tr>";
|
||||
print "<tr class=\"total\"><td colspan=\"2\" align=\"right\"><b>Total : ".price($total)."</b> ".MAIN_MONNAIE." HT</td></tr>";
|
||||
|
||||
$db->free();
|
||||
}
|
||||
|
||||
@ -69,37 +69,50 @@ class Product
|
||||
*/
|
||||
Function create($user)
|
||||
{
|
||||
if (strlen($this->price)==0)
|
||||
{
|
||||
$this->price = 0;
|
||||
}
|
||||
$this->price = round($this->price, 2);
|
||||
$sql = "SELECT count(*)";
|
||||
$sql .= " FROM llx_product WHERE ref = '" .trim($this->ref)."'";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
$sql = "INSERT INTO llx_product (datec, fk_user_author, fk_product_type, price)";
|
||||
$sql .= " VALUES (now(),".$user->id.",$this->type, " . ereg_replace(",",".",$this->price) . ")";
|
||||
$result = $this->db->query($sql);
|
||||
if ( $result )
|
||||
{
|
||||
$id = $this->db->last_insert_id();
|
||||
|
||||
if ($id > 0)
|
||||
$row = $this->db->fetch_array();
|
||||
if ($row[0] == 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->_log_price($user);
|
||||
if ( $this->update($id, $user) )
|
||||
|
||||
if (strlen($this->price)==0)
|
||||
{
|
||||
return $id;
|
||||
$this->price = 0;
|
||||
}
|
||||
$this->price = round($this->price, 2);
|
||||
|
||||
$sql = "INSERT INTO llx_product (datec, fk_user_author, fk_product_type, price)";
|
||||
$sql .= " VALUES (now(),".$user->id.",$this->type, " . ereg_replace(",",".",$this->price) . ")";
|
||||
$result = $this->db->query($sql);
|
||||
if ( $result )
|
||||
{
|
||||
$id = $this->db->last_insert_id();
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->_log_price($user);
|
||||
if ( $this->update($id, $user) )
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -197,8 +210,7 @@ class Product
|
||||
*
|
||||
*/
|
||||
Function fetch ($id)
|
||||
{
|
||||
|
||||
{
|
||||
$sql = "SELECT rowid, ref, label, description, price, tva_tx, envente, nbvente, fk_product_type, duration";
|
||||
$sql .= " FROM llx_product WHERE rowid = $id";
|
||||
|
||||
|
||||
@ -40,14 +40,14 @@ if ($action == 'add')
|
||||
{
|
||||
$product = new Product($db);
|
||||
|
||||
$product->ref = $HTTP_POST_VARS["ref"];
|
||||
$product->libelle = $HTTP_POST_VARS["libelle"];
|
||||
$product->price = $HTTP_POST_VARS["price"];
|
||||
$product->tva_tx = $HTTP_POST_VARS["tva_tx"];
|
||||
$product->type = $HTTP_POST_VARS["type"];
|
||||
$product->description = $HTTP_POST_VARS["desc"];
|
||||
$product->ref = $HTTP_POST_VARS["ref"];
|
||||
$product->libelle = $HTTP_POST_VARS["libelle"];
|
||||
$product->price = $HTTP_POST_VARS["price"];
|
||||
$product->tva_tx = $HTTP_POST_VARS["tva_tx"];
|
||||
$product->type = $HTTP_POST_VARS["type"];
|
||||
$product->description = $HTTP_POST_VARS["desc"];
|
||||
$product->duration_value = $HTTP_POST_VARS["duration_value"];
|
||||
$product->duration_unit = $HTTP_POST_VARS["duration_unit"];
|
||||
$product->duration_unit = $HTTP_POST_VARS["duration_unit"];
|
||||
|
||||
$id = $product->create($user);
|
||||
$action = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user