Ajout page des propales fermes
This commit is contained in:
parent
48acd8d39c
commit
6a16273e2b
@ -543,7 +543,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
|
||||
print "<td align=\"right\">";
|
||||
print dolibarr_print_date($objp->dp)."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->price)."</td>\n";
|
||||
print "<td align=\"center\">".$propalstatic->LibStatut($objp->fk_statut)."</td>\n";
|
||||
print "<td align=\"center\">".$propalstatic->LibStatut($objp->fk_statut,0)."</td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
$var=!$var;
|
||||
|
||||
@ -413,9 +413,10 @@ if ($_GET['propalid'])
|
||||
* 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 .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c, '.MAIN_DB_PREFIX.'socpeople as x';
|
||||
$sql .= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = '.$propal->id;
|
||||
$sql = 'SELECT s.nom, s.idp, p.price, p.fk_projet, p.remise, p.tva, p.total, p.ref, p.fk_statut, '.$db->pdate('p.datep').' as dp, p.note,';
|
||||
$sql.= ' 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.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'socpeople as x';
|
||||
$sql.= ' WHERE p.fk_soc = s.idp AND p.fk_soc_contact = x.idp AND p.rowid = '.$propal->id;
|
||||
if ($socidp) $sql .= ' AND s.idp = '.$socidp;
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -1012,9 +1013,9 @@ else
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$sql = 'SELECT s.nom, s.idp, s.client, p.rowid as propalid, p.price, p.ref,'.$db->pdate('p.datep').' as dp,'.$db->pdate('p.fin_validite').' as dfv, c.id as statutid';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c';
|
||||
$sql .= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id';
|
||||
$sql = 'SELECT s.nom, s.idp, s.client, p.rowid as propalid, p.price, p.ref, p.fk_statut, '.$db->pdate('p.datep').' as dp,'.$db->pdate('p.fin_validite').' as dfv';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p';
|
||||
$sql.= ' WHERE p.fk_soc = s.idp';
|
||||
|
||||
if (!empty($_GET['search_ref']))
|
||||
{
|
||||
@ -1032,12 +1033,10 @@ else
|
||||
{
|
||||
$sql .= ' AND s.idp = '.$_GET['socidp'];
|
||||
}
|
||||
|
||||
if ($_GET['viewstatut'] <> '')
|
||||
{
|
||||
$sql .= ' AND c.id = '.$_GET['viewstatut'];
|
||||
$sql .= ' AND p.fk_statut in ('.$_GET['viewstatut'].')';
|
||||
}
|
||||
|
||||
if ($month > 0)
|
||||
{
|
||||
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
||||
@ -1046,12 +1045,10 @@ else
|
||||
{
|
||||
$sql .= " AND date_format(p.datep, '%Y') = $year";
|
||||
}
|
||||
|
||||
if (strlen($_POST['sf_ref']) > 0)
|
||||
{
|
||||
$sql .= " AND p.ref like '%".$_POST["sf_ref"] . "%'";
|
||||
}
|
||||
|
||||
$sql .= ' ORDER BY '.$sortfield.' '.$sortorder.', p.ref DESC';
|
||||
$sql .= $db->plimit($limit + 1,$offset);
|
||||
$result=$db->query($sql);
|
||||
@ -1131,7 +1128,7 @@ else
|
||||
|
||||
print '<td align="right">'.price($objp->price)."</td>\n";
|
||||
$propal=New Propal($db);
|
||||
print '<td align="center">'.$propal->LibStatut($objp->statutid,0)."</td>\n";
|
||||
print '<td align="center">'.$propal->LibStatut($objp->fk_statut,0)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$total = $total + $objp->price;
|
||||
|
||||
@ -67,7 +67,7 @@ if ( $action == 'delete' )
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = $propalid ;";
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
print "<b><font color=\"red\">Propal supprimée</font></b>";
|
||||
print '<div class="ok">'.$langs->trans("Deleted").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -124,7 +124,8 @@ if ($_GET["propalid"])
|
||||
* 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,";
|
||||
$sql.= ' 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.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c, '.MAIN_DB_PREFIX.'socpeople as x';
|
||||
$sql.= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = '.$propal->id;
|
||||
if ($socidp) $sql .= ' AND s.idp = '.$socidp;
|
||||
@ -603,30 +604,13 @@ if ($_GET["propalid"])
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c ";
|
||||
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
|
||||
|
||||
if ($socidp)
|
||||
{
|
||||
$sql .= " AND s.idp = $socidp";
|
||||
}
|
||||
|
||||
if ($viewstatut <> '')
|
||||
{
|
||||
$sql .= " AND c.id = $viewstatut";
|
||||
}
|
||||
|
||||
if ($month > 0)
|
||||
{
|
||||
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
||||
}
|
||||
|
||||
if ($year > 0)
|
||||
{
|
||||
$sql .= " AND date_format(p.datep, '%Y') = $year";
|
||||
}
|
||||
|
||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p ";
|
||||
$sql.= " WHERE p.fk_soc = s.idp";
|
||||
if ($socidp) $sql .= " AND s.idp = $socidp";
|
||||
if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons séparé par virgules
|
||||
if ($month > 0) $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
||||
if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = $year";
|
||||
$sql .= " ORDER BY $sortfield $sortorder, p.rowid DESC ";
|
||||
$sql .= $db->plimit($limit + 1,$offset);
|
||||
|
||||
@ -634,7 +618,9 @@ if ($_GET["propalid"])
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
|
||||
print_barre_liste("Propositions commerciales", $page, "propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num);
|
||||
$propalstatic=new Propal($db);
|
||||
|
||||
print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num);
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
@ -681,7 +667,7 @@ if ($_GET["propalid"])
|
||||
print strftime("%Y",$objp->dp)."</a></td>\n";
|
||||
|
||||
print "<td align=\"right\">".price($objp->price)."</td>\n";
|
||||
print "<td align=\"center\">$objp->statut</td>\n";
|
||||
print "<td align=\"center\">".$propalstatic->LibStatut($objp->fk_statut,0)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
|
||||
@ -24,6 +24,7 @@ NbOfProposals=Number of commercial proposals
|
||||
ShowPropal=Show proposal
|
||||
PropalsDraft=Drafts
|
||||
PropalsOpened=Opened
|
||||
PropalsNotBilled=Closed not billed
|
||||
PropalStatusDraft=Draft (need to be validated)
|
||||
PropalStatusValidated=Validated (proposal is opened)
|
||||
PropalStatusClosed=Closed
|
||||
@ -34,7 +35,7 @@ PropalStatusDraftShort=Draft
|
||||
PropalStatusValidatedShort=Validated
|
||||
PropalStatusClosedShort=Closed
|
||||
PropalStatusSignedShort=Signed
|
||||
PropalStatusClosedShort=Not signed
|
||||
PropalStatusNotSignedShort=Not signed
|
||||
PropalStatusBilledShort=Billed
|
||||
ListOfProposals=List of commercial proposals
|
||||
ActionsOnPropal=Tasks on proposal
|
||||
|
||||
@ -24,6 +24,7 @@ NbOfProposals=Nombre de propositions commerciales
|
||||
ShowPropal=Afficher proposition
|
||||
PropalsDraft=Brouillons
|
||||
PropalsOpened=Ouvertes
|
||||
PropalsNotBilled=Non facturées
|
||||
PropalStatusDraft=Brouillon (à valider)
|
||||
PropalStatusValidated=Validée (propale ouverte)
|
||||
PropalStatusClosed=Fermée
|
||||
@ -34,7 +35,7 @@ PropalStatusDraftShort=Brouillon
|
||||
PropalStatusValidatedShort=Validée
|
||||
PropalStatusClosedShort=Fermée
|
||||
PropalStatusSignedShort=Signée
|
||||
PropalStatusClosedShort=Non signée
|
||||
PropalStatusNotSignedShort=Non signée
|
||||
PropalStatusBilledShort=Facturée
|
||||
ListOfProposals=Liste des devis/propositions commerciales
|
||||
ActionsOnPropal=Actions sur la proposition
|
||||
|
||||
Loading…
Reference in New Issue
Block a user