Trad: Traduction de chaines sur les status de propales et factures.
This commit is contained in:
parent
ab775739c0
commit
09c8021488
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -38,10 +38,9 @@ $user->getrights('propale');
|
|||||||
if (!$user->rights->propale->lire)
|
if (!$user->rights->propale->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
/*
|
if ($conf->projet->enabled) {
|
||||||
* Modules optionnels
|
require_once "../project.class.php";
|
||||||
*/
|
}
|
||||||
require("../project.class.php");
|
|
||||||
require("./propal_model_pdf.class.php");
|
require("./propal_model_pdf.class.php");
|
||||||
require("../propal.class.php");
|
require("../propal.class.php");
|
||||||
require("../actioncomm.class.php");
|
require("../actioncomm.class.php");
|
||||||
@ -56,6 +55,10 @@ if ($user->societe_id > 0)
|
|||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nombre de ligne pour choix de produit/service prédéfinis
|
||||||
|
$NBLINES=4;
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* Actions */
|
/* Actions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -255,7 +258,7 @@ if ($_GET["propalid"])
|
|||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Prop").": $propal->ref");
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Proposal").": $propal->ref");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de la propale
|
* Confirmation de la suppression de la propale
|
||||||
@ -266,7 +269,10 @@ if ($_GET["propalid"])
|
|||||||
$html->form_confirm("propal.php?propalid=$propal->id",$langs->trans("DeleteProp"),$langs->trans("ConfirmDeleteProp"),"confirm_delete");
|
$html->form_confirm("propal.php?propalid=$propal->id",$langs->trans("DeleteProp"),$langs->trans("ConfirmDeleteProp"),"confirm_delete");
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Fiche propal
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT s.nom, s.idp, p.price, p.fk_projet,p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.note, x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture";
|
$sql = "SELECT s.nom, s.idp, p.price, p.fk_projet,p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.note, x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture";
|
||||||
@ -279,17 +285,15 @@ if ($_GET["propalid"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
|
if ($db->num_rows($result))
|
||||||
if ($db->num_rows())
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
$color1 = "#e0e0e0";
|
$color1 = "#e0e0e0";
|
||||||
|
|
||||||
|
|
||||||
if ($propal->brouillon == 1 && $user->rights->propale->creer)
|
if ($propal->brouillon == 1 && $user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
/* la form est ouverte avant la table pour respect des normes */
|
/* la form est ouverte avant la table pour respect des normes */
|
||||||
@ -298,7 +302,7 @@ if ($_GET["propalid"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "<table class=\"border\" width=\"100%\">";
|
print "<table class=\"border\" width=\"100%\">";
|
||||||
$rowspan=4;
|
$rowspan=7;
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||||
if ($societe->client == 1)
|
if ($societe->client == 1)
|
||||||
@ -310,7 +314,7 @@ if ($_GET["propalid"])
|
|||||||
$url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id;
|
$url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id;
|
||||||
}
|
}
|
||||||
print '<a href="'.$url.'">'.$societe->nom.'</a></td>';
|
print '<a href="'.$url.'">'.$societe->nom.'</a></td>';
|
||||||
print '<td align="left">'.$langs->trans("Status").'</td><td align="left">'.$obj->lst.'</td></tr>';
|
print '<td align="left" colspan="2">Conditions de réglement : </td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="3">'.strftime("%A %d %B %Y",$propal->date);
|
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="3">'.strftime("%A %d %B %Y",$propal->date);
|
||||||
if ($propal->fin_validite)
|
if ($propal->fin_validite)
|
||||||
@ -319,10 +323,7 @@ if ($_GET["propalid"])
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>'.$langs->trans("Author").'</td><td>';
|
print '<td colspan="2"> </td></tr>';
|
||||||
$author = new User($db, $obj->fk_user_author);
|
|
||||||
$author->fetch('');
|
|
||||||
print $author->fullname.'</td></tr>';
|
|
||||||
|
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
print "<tr><td>".$langs->trans("MailTo")."</td><td colspan=\"3\">$obj->firstname $obj->name".($obj->email?" <$obj->email>":"")."</td>";
|
print "<tr><td>".$langs->trans("MailTo")."</td><td colspan=\"3\">$obj->firstname $obj->name".($obj->email?" <$obj->email>":"")."</td>";
|
||||||
@ -342,37 +343,36 @@ if ($_GET["propalid"])
|
|||||||
print $projet->title.'</a></td></tr>';
|
print $projet->title.'</a></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
$author = new User($db, $obj->fk_user_author);
|
||||||
*
|
$author->fetch('');
|
||||||
*/
|
print "<tr><td height=\"10\">".$langs->trans("Author")."</td><td colspan=\"3\">$author->fullname</td></tr>";
|
||||||
|
|
||||||
|
print '<tr><td height=\"10\">'.$langs->trans("GlobalDiscount").'</td>';
|
||||||
if ($propal->brouillon == 1 && $user->rights->propale->creer)
|
if ($propal->brouillon == 1 && $user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Discount").' <a href="propal/aideremise.php?propalid='.$propal->id.'">?</a></td>';
|
print '<form action="propal.php?propid='.$fac->id.'" method="post">';
|
||||||
print '<td align="right"><input type="text" name="remise" size="3" value="'.$propal->remise_percent.'">%</td>';
|
print '<td colspan="3"><input type="text" name="remise" size="3" value="'.$propal->remise_percent.'">% ';
|
||||||
print '<td><input type="submit" value="'.$langs->trans("Save").'"></td>';
|
print '<input type="submit" value="'.$langs->trans("Modify").'">';
|
||||||
|
print ' <a href="propal/aideremise.php?propalid='.$propal->id.'">?</a>';
|
||||||
|
print '</td>';
|
||||||
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Discount").'</td>';
|
print '<td colspan="3">'.$propal->remise_percent.' %</td>';
|
||||||
print '<td align="right">'.$propal->remise_percent.' %</td><td> </td>';
|
|
||||||
}
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '<td align="right">'.price($propal->remise).' euros</td></tr>';
|
print '<tr><td height=\"10\">'.$langs->trans("AmountHT").'</td>';
|
||||||
/*
|
print '<td align="right" colspan="2"><b>'.price($obj->price).'</b></td>';
|
||||||
*
|
print '<td>'.$conf->monnaie.'</td></tr>';
|
||||||
*/
|
|
||||||
print '<tr><td>'.$langs->trans("AmountHT").'</td><td align="right">'.price($obj->price + $obj->remise).' euros</td>';
|
print '<tr><td height=\"10\">'.$langs->trans("VAT").'</td><td align="right" colspan="2">'.price($propal->total_tva).'</td>';
|
||||||
print '<td align="right">'.$langs->trans("VAT").'</td><td align="right">'.price($propal->total_tva).' euros</td></tr>';
|
print '<td>'.$conf->monnaie.'</td></tr>';
|
||||||
|
print '<tr><td height=\"10\">'.$langs->trans("AmountTTC").'</td><td align="right" colspan="2">'.price($propal->total_ttc).'</td>';
|
||||||
/*
|
print '<td>'.$conf->monnaie.'</td></tr>';
|
||||||
*
|
|
||||||
*/
|
print '<tr><td height=\"10\">'.$langs->trans("Status").'</td><td align="left" colspan="3">'.$propal->get_libstatut().'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("TotalHT").'</td><td align="right"><b>'.price($obj->price).'</b> euros</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("TotalTTC").'</td><td align="right"><b>'.price($propal->total_ttc).'</b> euros</td></tr>';
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
|
|
||||||
@ -397,93 +397,137 @@ if ($_GET["propalid"])
|
|||||||
print "</tr></table></form>";
|
print "</tr></table></form>";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Produits
|
* Lignes de propale
|
||||||
*/
|
*
|
||||||
print_titre($langs->trans("ProductsAndServices"));
|
*/
|
||||||
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
$sql = "SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, p.label as product, p.ref, p.fk_product_type, p.rowid as prodid";
|
||||||
print '<table class="noborder" width="100%">';
|
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt LEFT JOIN ".MAIN_DB_PREFIX."product as p ON pt.fk_product=p.rowid";
|
||||||
print "<tr class=\"liste_titre\">";
|
$sql .= " WHERE pt.fk_propal = ".$propal->id;
|
||||||
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("ProductOrService").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("VAT").'</td><td align="center">'.$langs->trans("Qty").'</td><td align="center">'.$langs->trans("Discount").'</td><td align="right">'.$langs->trans("PriceU").'</td>';
|
|
||||||
print "<td> </td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, p.fk_product_type, pt.qty, p.rowid as prodid, pt.tva_tx, pt.remise_percent, pt.subprice";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propal->id";
|
|
||||||
$sql .= " ORDER BY pt.rowid ASC";
|
$sql .= " ORDER BY pt.rowid ASC";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num_lignes = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0; $total = 0;
|
||||||
|
|
||||||
$var=True;
|
|
||||||
|
|
||||||
while ($i < $num)
|
print '<table class="noborder" width="100%">';
|
||||||
|
if ($num_lignes)
|
||||||
|
{
|
||||||
|
print "<tr class=\"liste_titre\">";
|
||||||
|
print '<td width="54%">'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td width="8%" align="right">'.$langs->trans("VAT").'</td>';
|
||||||
|
print '<td width="12%" align="right">'.$langs->trans("PriceUHT").'</td>';
|
||||||
|
print '<td width="8%" align="right">'.$langs->trans("Qty").'</td>';
|
||||||
|
print '<td width="8%" align="right">'.$langs->trans("Discount").'</td>';
|
||||||
|
print '<td width="10%" align="right">'.$langs->trans("AmountHT").'</td>';
|
||||||
|
print '<td> </td><td> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
$var=True;
|
||||||
|
while ($i < $num_lignes)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td>".$objp->ref."</td>\n";
|
if ($objp->fk_product > 0)
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->prodid.'">';
|
|
||||||
if ($objp->fk_product_type==0) print img_object($langs->trans("ShowProduct"),"product");
|
|
||||||
if ($objp->fk_product_type==1) print img_object($langs->trans("ShowService"),"service");
|
|
||||||
print ' '.$objp->product.'</a></td>';
|
|
||||||
print '<td align="center">'.$objp->tva_tx.' %</td>';
|
|
||||||
print "<td align=\"center\">".$objp->qty."</td>\n";
|
|
||||||
print '<td align="center">'.$objp->remise_percent.' %</td>';
|
|
||||||
print '<td align="right">'.price($objp->subprice).'</td>';
|
|
||||||
if ($propal->statut == 0 && $user->rights->propale->creer)
|
|
||||||
{
|
{
|
||||||
print '<td align="center"><a href="propal.php?propalid='.$propal->id.'&ligne='.$objp->rowid.'&action=del_ligne">';
|
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||||
print img_delete();
|
if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service");
|
||||||
print '</a></td>';
|
else print img_object($langs->trans("ShowProduct"),"product");
|
||||||
|
print ' '.stripslashes(nl2br($objp->description?$objp->description:$objp->product)).'</a>';
|
||||||
|
if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; }
|
||||||
|
if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; }
|
||||||
|
if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; }
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT pt.rowid, pt.description, pt.price, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt WHERE pt.fk_propal = $propal->id AND pt.fk_product = 0";
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows();
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
print "<td>".stripslashes(nl2br($objp->description));
|
||||||
$var=!$var;
|
if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; }
|
||||||
print "<tr $bc[$var]><td> </td>\n";
|
if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; }
|
||||||
print '<td>'.$objp->description.'</td>';
|
if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; }
|
||||||
print '<td align="center">'.$objp->tva_tx.' %</td>';
|
print "</td>\n";
|
||||||
print "<td align=\"center\">".$objp->qty."</td>\n";
|
}
|
||||||
print '<td align="center">'.$objp->remise_percent.' %</td>';
|
|
||||||
print "<td align=\"right\">".price($objp->subprice)."</td>";
|
print '<td align="right">'.$objp->tva_tx.' %</td>';
|
||||||
if ($propal->statut == 0 && $user->rights->propale->creer)
|
print '<td align="right">'.price($objp->subprice)."</td>\n";
|
||||||
|
print '<td align="right">'.$objp->qty.'</td>';
|
||||||
|
if ($objp->remise_percent > 0)
|
||||||
{
|
{
|
||||||
print '<td align="center"><a href="propal.php?propalid='.$propal->id.'&ligne='.$objp->rowid.'&action=del_ligne">';
|
print '<td align="right">'.$objp->remise_percent." %</td>\n";
|
||||||
print img_delete();
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
print "</tr>";
|
print '<td align="right">'.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."</td>\n";
|
||||||
$i++;
|
|
||||||
|
// Icone d'edition et suppression
|
||||||
|
if ($propal->statut == 0 && $user->rights->propale->creer)
|
||||||
|
{
|
||||||
|
print '<td align="right"><a href="propal.php?facid='.$fac->id.'&action=editline&ligne='.$objp->rowid.'">';
|
||||||
|
//print img_edit();
|
||||||
|
print '</a></td>';
|
||||||
|
print '<td align="right"><a href="propal.php?facid='.$fac->id.'&action=del_ligneeteline&ligne='.$objp->rowid.'">';
|
||||||
|
print img_delete();
|
||||||
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td> </td><td> </td>';
|
||||||
|
}
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
// Update ligne de facture
|
||||||
|
// \todo
|
||||||
|
|
||||||
|
|
||||||
|
$total = $total + ($objp->qty * $objp->price);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ajouter une ligne
|
||||||
|
*
|
||||||
|
*/
|
||||||
if ($propal->statut == 0 && $user->rights->propale->creer)
|
if ($propal->statut == 0 && $user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
|
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
||||||
|
print "<tr class=\"liste_titre\">";
|
||||||
|
print '<td width="54%">'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td width="8%" align="right">'.$langs->trans("VAT").'</td>';
|
||||||
|
print '<td width="12%" align="right">'.$langs->trans("PriceUHT").'</td>';
|
||||||
|
print '<td width="8%" align="right">'.$langs->trans("Qty").'</td>';
|
||||||
|
print '<td width="8%" align="right">'.$langs->trans("Discount").'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
print '<input type="hidden" name="propid" value="'.$propal->id.'">';
|
||||||
|
print '<input type="hidden" name="action" value="addligne">';
|
||||||
|
|
||||||
|
// Ajout produit produits/services personalisé
|
||||||
|
$var=!$var;
|
||||||
|
|
||||||
|
print "<tr ".$bc[$var].">\n";
|
||||||
|
print " <td><textarea cols=\"50\" name=\"np_desc\"></textarea></td>\n";
|
||||||
|
print " <td align=\"center\">";
|
||||||
|
print $html->select_tva("np_tva_tx",$conf->defaulttx) . "</td>\n";
|
||||||
|
print " <td align=\"right\"><input type=\"text\" size=\"6\" name=\"np_price\"></td>\n";
|
||||||
|
print " <td align=\"right\"><input type=\"text\" size=\"3\" value=\"1\" name=\"np_qty\"></td>\n";
|
||||||
|
print " <td align=\"right\"><input type=\"text\" size=\"3\" value=\"".$societe->remise_client."\" name=\"np_remise\"> %</td>\n";
|
||||||
|
print " <td align=\"center\" colspan=\"3\"><input type=\"submit\" value=\"".$langs->trans("Add")."\" name=\"addproduct\"></td>\n";
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
// Ajout de produits/services prédéfinis
|
||||||
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p WHERE p.envente=1 ORDER BY p.nbvente DESC LIMIT 20";
|
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p WHERE p.envente=1 ORDER BY p.nbvente DESC LIMIT 20";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -503,39 +547,25 @@ if ($_GET["propalid"])
|
|||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Ligne d'ajout de produits/services personalisé
|
|
||||||
*/
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
print "<tr ".$bc[$var].">\n";
|
print "<td colspan=\"2\"><select name=\"idprod\">".$opt."</select></td>";
|
||||||
print " <td> </td>\n";
|
|
||||||
print " <td><textarea cols=\"50\" name=\"np_desc\"></textarea></td>\n";
|
|
||||||
print " <td align=\"center\">";
|
|
||||||
print $html->select_tva("np_tva_tx",$conf->defaulttx) . "</td>\n";
|
|
||||||
print " <td align=\"center\"><input type=\"text\" size=\"3\" value=\"1\" name=\"np_qty\"></td>\n";
|
|
||||||
print " <td align=\"center\"><input type=\"text\" size=\"3\" value=\"".$societe->remise_client."\" name=\"np_remise\"> %</td>\n";
|
|
||||||
print " <td align=\"right\"><input type=\"text\" size=\"6\" name=\"np_price\"></td>\n";
|
|
||||||
print " <td align=\"center\"><input type=\"submit\" value=\"".$langs->trans("Add")."\" name=\"addproduct\"></td>\n";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Ligne d'ajout de produits/services prédéfinis
|
|
||||||
*/
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]><td> </td><td colspan=\"2\"><select name=\"idprod\">".$opt."</select></td>";
|
|
||||||
print '<td align="center"><input type="text" size="3" name="qty" value="1"></td>';
|
|
||||||
print '<td align="center"><input type="text" size="3" name="remise" value="'.$societe->remise_client.'"> %</td>';
|
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '<td align="center"><input type="submit" value="'.$langs->trans("Add").'" name="addligne"></td>';
|
print '<td align="right"><input type="text" size="3" name="qty" value="1"></td>';
|
||||||
|
print '<td align="right"><input type="text" size="3" name="remise" value="'.$societe->remise_client.'"> %</td>';
|
||||||
|
print '<td align="center" colspan="3"><input type="submit" value="'.$langs->trans("Add").'" name="addligne"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
print "</form>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table><br>\n";
|
||||||
print '</form><br>';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fin Ajout ligne
|
||||||
|
*
|
||||||
|
*/
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
@ -719,54 +749,54 @@ if ($_GET["propalid"])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print "</td><td valign=\"top\" width=\"50%\">";
|
print "</td><td valign=\"top\" width=\"50%\">";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
* Liste des actions propres à la propal
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT ".$db->pdate("a.datea"). " as da, note, fk_user_author" ;
|
$sql = "SELECT id, ".$db->pdate("a.datea"). " as da, note, fk_user_author" ;
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = $obj->idp AND a.propalrowid = $propal->id ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||||
|
$sql .= " WHERE a.fk_soc = $obj->idp AND a.propalrowid = $propal->id ";
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
$result = $db->query($sql);
|
||||||
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0;
|
if ($num)
|
||||||
|
|
||||||
if ($num > 0)
|
|
||||||
{
|
{
|
||||||
print_titre("Propale envoyée");
|
print_titre($langs->trans("ActionsOnPropal"));
|
||||||
|
|
||||||
|
$i = 0; $total = 0;
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print "<tr><td>".$langs->trans("Date")."</td><td>".$langs->trans("Author")."</td></tr>\n";
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Action").'</td><td>'.$langs->trans("By").'</td></tr>';
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object();
|
$objp = $db->fetch_object($result);
|
||||||
print "<tr><td>".strftime("%d %B %Y %H:%M:%S",$objp->da)."</td>\n";
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans("ShowTask"),"task").' '.$objp->id.'</a></td>';
|
||||||
|
print '<td>'.dolibarr_print_date($objp->da)."</td>\n";
|
||||||
|
print '<td>'.stripslashes($objp->note).'</td>';
|
||||||
$authoract = new User($db);
|
$authoract = new User($db);
|
||||||
$authoract->id = $objp->fk_user_author;
|
$authoract->id = $objp->fk_user_author;
|
||||||
$authoract->fetch('');
|
$authoract->fetch('');
|
||||||
print "<td>$authoract->code</td></tr>\n";
|
print '<td>'.$authoract->code.'</td>';
|
||||||
print "<tr><td colspan=\"2\">$objp->note</td></tr>";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
$db->free();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print "</td></tr></table>";
|
print "</td></tr></table>";
|
||||||
|
|
||||||
if ($propal->brouillon == 1)
|
if ($propal->brouillon == 1)
|
||||||
{
|
{
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -15,6 +15,7 @@ ActionOnCompany=Task about company
|
|||||||
ActionOnContact=Task about contact
|
ActionOnContact=Task about contact
|
||||||
TaskRDV=Rendez-vous
|
TaskRDV=Rendez-vous
|
||||||
TaskRDVWith=Rendez-vous with %s
|
TaskRDVWith=Rendez-vous with %s
|
||||||
|
ShowTask=Show task
|
||||||
SalesRepresentative=Sales representative
|
SalesRepresentative=Sales representative
|
||||||
ErrorWrongCode=Wrong code
|
ErrorWrongCode=Wrong code
|
||||||
NoSalesRepresentativeAffected=No particular sales representative affected
|
NoSalesRepresentativeAffected=No particular sales representative affected
|
||||||
|
|||||||
@ -21,4 +21,7 @@ NbOfProposals=Number of commercial proposals
|
|||||||
ShowPropal=Show proposal
|
ShowPropal=Show proposal
|
||||||
PropalsDraft=Drafts
|
PropalsDraft=Drafts
|
||||||
PropalsOpened=Opened
|
PropalsOpened=Opened
|
||||||
ListOfProposals=List of commercial proposals
|
PropalStatusDraft=Draft (need to be validated)
|
||||||
|
PropalStatusValidated=Validated (proposal is opened)
|
||||||
|
ListOfProposals=List of commercial proposals
|
||||||
|
ActionsOnPropal=Tasks on proposal
|
||||||
@ -9,10 +9,20 @@ SendNewPassword=Send new password
|
|||||||
SubjectNewPassword=Your new password for Dolibarr
|
SubjectNewPassword=Your new password for Dolibarr
|
||||||
AvailableRights=Available permissions
|
AvailableRights=Available permissions
|
||||||
OwnedRights=Owned permissions
|
OwnedRights=Owned permissions
|
||||||
|
GroupRights=Group permissions
|
||||||
|
UserRights=User permissions
|
||||||
DisableUser=Disable user
|
DisableUser=Disable user
|
||||||
DisableAUser=Disable a user
|
DisableAUser=Disable a user
|
||||||
|
DeleteUser=Delete user
|
||||||
|
DeleteAUser=Delete a user
|
||||||
|
DisableGroup=Disable group
|
||||||
|
DisableAGroup=Disable a group
|
||||||
|
DeleteGroup=Delete group
|
||||||
|
DeleteAGroup=Delete a group
|
||||||
ConfirmDisableUser=Are you sure you want to disable user %s ?
|
ConfirmDisableUser=Are you sure you want to disable user %s ?
|
||||||
ConfirmDisableUser=Are you sure you want to delete group %s ?
|
ConfirmDisableGroup=Are you sure you want to disable group %s ?
|
||||||
|
ConfirmDeleteUser=Are you sure you want to delete user %s ?
|
||||||
|
ConfirmDeleteGroup=Are you sure you want to delete group %s ?
|
||||||
NewUser=New user
|
NewUser=New user
|
||||||
CreateUser=Create user
|
CreateUser=Create user
|
||||||
SearchAGroup=Search a group
|
SearchAGroup=Search a group
|
||||||
@ -28,7 +38,7 @@ DefaultRightsDesc=Define here default permissions that are automatically granted
|
|||||||
DolibarrUsers=Dolibarr users
|
DolibarrUsers=Dolibarr users
|
||||||
LastName=Name
|
LastName=Name
|
||||||
FirstName=Firstname
|
FirstName=Firstname
|
||||||
ListOfGroups=List of Groups
|
ListOfGroups=List of groups
|
||||||
NewGroup=New group
|
NewGroup=New group
|
||||||
CreateGroup=Create group
|
CreateGroup=Create group
|
||||||
RemoveFromGroup=Remove from group
|
RemoveFromGroup=Remove from group
|
||||||
@ -41,4 +51,5 @@ ShowUser=Show user
|
|||||||
NonAffectedUsers=Non affected users
|
NonAffectedUsers=Non affected users
|
||||||
UserModified=User modified successfully
|
UserModified=User modified successfully
|
||||||
PhotoFile=Fichier photo
|
PhotoFile=Fichier photo
|
||||||
UserWithDolibarrAccess=User with Dolibarr access
|
UserWithDolibarrAccess=User with Dolibarr access
|
||||||
|
ListOfUsersInGroup=List of users in group
|
||||||
@ -15,6 +15,7 @@ ActionOnCompany=Action concernant la soci
|
|||||||
ActionOnContact=Action concernant le contact
|
ActionOnContact=Action concernant le contact
|
||||||
TaskRDV=Rendez-vous
|
TaskRDV=Rendez-vous
|
||||||
TaskRDVWith=Rendez-vous avec %s
|
TaskRDVWith=Rendez-vous avec %s
|
||||||
|
ShowTask=Afficher action
|
||||||
SalesRepresentative=Commercial
|
SalesRepresentative=Commercial
|
||||||
ErrorWrongCode=Code incorrect
|
ErrorWrongCode=Code incorrect
|
||||||
NoSalesRepresentativeAffected=Aucun commercial particulier affecté
|
NoSalesRepresentativeAffected=Aucun commercial particulier affecté
|
||||||
|
|||||||
@ -21,4 +21,7 @@ NbOfProposals=Nombre de propositions commerciales
|
|||||||
ShowPropal=Afficher proposition
|
ShowPropal=Afficher proposition
|
||||||
PropalsDraft=Brouillons
|
PropalsDraft=Brouillons
|
||||||
PropalsOpened=Ouvertes
|
PropalsOpened=Ouvertes
|
||||||
ListOfProposals=Liste des devis/propositions commerciales
|
PropalStatusDraft=Brouillon (à valider)
|
||||||
|
PropalStatusValidated=Validée (propale ouverte)
|
||||||
|
ListOfProposals=Liste des devis/propositions commerciales
|
||||||
|
ActionsOnPropal=Actions sur la proposition
|
||||||
|
|||||||
@ -9,10 +9,20 @@ SendNewPassword=Envoyer nouveau mot de passe
|
|||||||
SubjectNewPassword=Votre mot de passe pour Dolibarr
|
SubjectNewPassword=Votre mot de passe pour Dolibarr
|
||||||
AvailableRights=Permissions disponibles
|
AvailableRights=Permissions disponibles
|
||||||
OwnedRights=Permissions détenues
|
OwnedRights=Permissions détenues
|
||||||
|
GroupRights=Permissions groupe
|
||||||
|
UserRights=Permissions utilisateur
|
||||||
DisableUser=Désactiver utilisateur
|
DisableUser=Désactiver utilisateur
|
||||||
DisableAUser=Désactiver un utilisateur
|
DisableAUser=Désactiver un utilisateur
|
||||||
|
DeleteUser=Supprimer utilisateur
|
||||||
|
DeleteAUser=Supprimer un utilisateur
|
||||||
|
DisableGroup=Désactiver groupe
|
||||||
|
DisableAGroup=Désactiver un groupe
|
||||||
|
DeleteGroup=Supprimer groupe
|
||||||
|
DeleteAGroup=Supprimer un groupe
|
||||||
ConfirmDisableUser=Etes-vous sûr de vouloir désactiver l'utilisateur %s ?
|
ConfirmDisableUser=Etes-vous sûr de vouloir désactiver l'utilisateur %s ?
|
||||||
ConfirmDisableGroup=Etes-vous sûr de vouloir supprimer le groupe %s ?
|
ConfirmDisableGroup=Etes-vous sûr de vouloir désactiver le groupe %s ?
|
||||||
|
ConfirmDeleteUser=Etes-vous sûr de vouloir supprimer l'utilisateur %s ?
|
||||||
|
ConfirmDeleteGroup=Etes-vous sûr de vouloir supprimer le groupe %s ?
|
||||||
NewUser=Nouvel utilisateur
|
NewUser=Nouvel utilisateur
|
||||||
CreateUser=Créer l'utilisateur
|
CreateUser=Créer l'utilisateur
|
||||||
SearchAGroup=Rechercher un groupe
|
SearchAGroup=Rechercher un groupe
|
||||||
@ -41,4 +51,5 @@ ShowUser=Afficher utilisateur
|
|||||||
NonAffectedUsers=Utilisateurs non affectés au groupe
|
NonAffectedUsers=Utilisateurs non affectés au groupe
|
||||||
UserModified=Utilisateur modifié avec succès
|
UserModified=Utilisateur modifié avec succès
|
||||||
PhotoFile=Fichier photo
|
PhotoFile=Fichier photo
|
||||||
UserWithDolibarrAccess=Utilisateur avec accès Dolibarr
|
UserWithDolibarrAccess=Utilisateur avec accès Dolibarr
|
||||||
|
ListOfUsersInGroup=Liste des utilisateurs dans le groupe
|
||||||
@ -23,18 +23,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \file htdocs/propal.class.php
|
/**
|
||||||
\brief Fichier de la classe des propales
|
\file htdocs/propal.class.php
|
||||||
\author Rodolphe Qiedeville
|
\brief Fichier de la classe des propales
|
||||||
\author Eric Seigne
|
\author Rodolphe Qiedeville
|
||||||
\author Laurent Destailleur
|
\author Eric Seigne
|
||||||
\version $Revision$
|
\author Laurent Destailleur
|
||||||
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! \class Propal
|
/**
|
||||||
\brief Classe permettant la gestion des propales
|
\class Propal
|
||||||
|
\brief Classe permettant la gestion des propales
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Propal
|
class Propal
|
||||||
@ -346,11 +348,11 @@ class Propal
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lit les informations
|
* \brief Recupère de la base les caractéristiques d'une propale
|
||||||
*
|
* \param rowid id de la propal à récupérer
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function fetch($rowid)
|
function fetch($rowid)
|
||||||
@ -835,6 +837,28 @@ class Propal
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retourne le libellé du statut d'une propale (brouillon, validée, ...)
|
||||||
|
* \return string Libellé
|
||||||
|
*/
|
||||||
|
function get_libstatut()
|
||||||
|
{
|
||||||
|
return $this->LibStatut($this->statut);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoi le libellé d'un statut donné
|
||||||
|
* \param statut id statut
|
||||||
|
* \return string Libellé
|
||||||
|
*/
|
||||||
|
function LibStatut($statut)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$langs->load("propals");
|
||||||
|
if ($statut == 0) return $langs->trans("PropalStatusDraft");
|
||||||
|
return $langs->trans("PropalStatusValidated");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class PropaleLigne
|
class PropaleLigne
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user