diff --git a/htdocs/comm/askpricesupplier/document.php b/htdocs/comm/askpricesupplier/document.php
index f89e38838c3..f2558e826dc 100644
--- a/htdocs/comm/askpricesupplier/document.php
+++ b/htdocs/comm/askpricesupplier/document.php
@@ -69,17 +69,12 @@ if ($object->id > 0)
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
}
-/*
- * Actions
- */
-
-
/*
* View
*/
-llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
+llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur');
$form = new Form($db);
@@ -98,7 +93,6 @@ if ($object->id > 0)
$totalsize+=$file['size'];
}
-
print '
';
$linkback=''.$langs->trans("BackToList").'';
@@ -107,21 +101,8 @@ if ($object->id > 0)
print '| '.$langs->trans('Ref').' | ';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print ' |
';
-
- // Ref client
- /* PHFAVRE retrait en temporaire
- print '';
- print '| ';
- print $langs->trans('RefCustomer').' | ';
- print ' | ';
- print ' ';
- print ' | ';
- print $object->ref_client;
- print ' | ';
- print '
';
- */
- // Customer
+ // Supplier
print "| ".$langs->trans("Supplier")." | ";
print ''.$object->thirdparty->getNomUrl(1).' |
';
diff --git a/htdocs/comm/askpricesupplier/index.php b/htdocs/comm/askpricesupplier/index.php
index 7684664c56b..2f943cef083 100644
--- a/htdocs/comm/askpricesupplier/index.php
+++ b/htdocs/comm/askpricesupplier/index.php
@@ -48,14 +48,12 @@ $askpricesupplierstatic=new AskPriceSupplier($db);
$companystatic=new Societe($db);
$form = new Form($db);
$formfile = new FormFile($db);
-$help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo_Presupuestos";
+$help_url="EN:Module_Ask_Price_Supplier|FR:Module_Demande_de_prix_fournisseur";
llxHeader("",$langs->trans("AskPriceSupplierArea"),$help_url);
print_fiche_titre($langs->trans("AskPriceSupplierArea"));
-//print '';
-//print '';
print '';
@@ -138,8 +136,7 @@ if ($resql)
dol_print_graph('stats',300,180,$data,1,'pie',1);
print ' |
';
}
- //if ($totalinprocess != $total)
- //print '| '.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").') | '.$totalinprocess.' |
';
+
print '| '.$langs->trans("Total").' | '.$total.' |
';
print "
";
}
@@ -150,7 +147,7 @@ else
/*
- * Draft proposals
+ * Draft askprice
*/
if (! empty($conf->askpricesupplier->enabled))
{
@@ -200,15 +197,13 @@ if (! empty($conf->askpricesupplier->enabled))
}
}
-
-//print '';
print '';
$max=5;
/*
- * Last modified proposals
+ * Last modified askprice
*/
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, s.canvas, s.client,";
@@ -283,7 +278,7 @@ else dol_print_error($db);
/*
- * Opened proposals
+ * Opened askprice
*/
if (! empty($conf->askpricesupplier->enabled) && $user->rights->askpricesupplier->lire)
{
@@ -291,7 +286,7 @@ if (! empty($conf->askpricesupplier->enabled) && $user->rights->askpricesupplier
$now=dol_now();
- $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as askpricesupplierid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
+ $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as askpricesupplierid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datec as dp";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."askpricesupplier as p";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -375,154 +370,8 @@ if (! empty($conf->askpricesupplier->enabled) && $user->rights->askpricesupplier
}
}
-/*
- * Proposals to process
- */
-/*
-if (! empty($conf->propal->enabled))
-{
- $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
- $sql.=" FROM ".MAIN_DB_PREFIX."propal as c";
- $sql.= ", ".MAIN_DB_PREFIX."societe as s";
- if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= " WHERE c.fk_soc = s.rowid";
- $sql.= " AND c.entity = ".$conf->entity;
- $sql.= " AND c.fk_statut = 1";
- if ($socid) $sql.= " AND c.fk_soc = ".$socid;
- if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- $sql.= " ORDER BY c.rowid DESC";
-
- $resql=$db->query($sql);
- if ($resql)
- {
- $num = $db->num_rows($resql);
-
- print ' ';
- print '';
- print '| '.$langs->trans("ProposalsToProcess").' '.$num.' | ';
-
- if ($num)
- {
- $i = 0;
- $var = True;
- while ($i < $num)
- {
- $var=!$var;
- $obj = $db->fetch_object($resql);
- print "";
- print '';
-
- $askpricesupplierstatic->id=$obj->rowid;
- $askpricesupplierstatic->ref=$obj->ref;
-
- print '';
- print '| ';
- print $askpricesupplierstatic->getNomUrl(1);
- print ' | ';
-
- print '';
- print ' ';
- print ' | ';
-
- print '';
- $filename=dol_sanitizeFileName($obj->ref);
- $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
- $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- print $formfile->getDocumentsLink($askpricesupplierstatic->element, $filename, $filedir);
- print ' | ';
-
- print ' | ';
-
- print ''.img_object($langs->trans("ShowAskPriceSupplier"),"askpricesupplier").' '.dol_trunc($obj->name,24).' | ';
-
- print ''.$askpricesupplierstatic->LibStatut($obj->fk_statut,$obj->facture,5).' | ';
-
- print ' ';
- $i++;
- }
- }
-
- print " ";
- }
- else dol_print_error($db);
-}
-*/
-
-/*
- * Proposal that are in a shipping process
- */
-/*if (! empty($conf->propal->enabled))
-{
- $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
- $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
- $sql.= ", ".MAIN_DB_PREFIX."societe as s";
- if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= " WHERE c.fk_soc = s.rowid";
- $sql.= " AND c.entity = ".$conf->entity;
- $sql.= " AND c.fk_statut = 2 ";
- if ($socid) $sql.= " AND c.fk_soc = ".$socid;
- if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- $sql.= " ORDER BY c.rowid DESC";
-
- $resql=$db->query($sql);
- if ($resql)
- {
- $num = $db->num_rows($resql);
-
- print ' ';
- print '';
- print '| '.$langs->trans("OnProcessOrders").' '.$num.' | ';
-
- if ($num)
- {
- $i = 0;
- $var = True;
- while ($i < $num)
- {
- $var=!$var;
- $obj = $db->fetch_object($resql);
- print "";
- print '';
-
- $askpricesupplierstatic->id=$obj->rowid;
- $askpricesupplierstatic->ref=$obj->ref;
-
- print '';
- print '| ';
- print $askpricesupplierstatic->getNomUrl(1);
- print ' | ';
-
- print '';
- print ' ';
- print ' | ';
-
- print '';
- $filename=dol_sanitizeFileName($obj->ref);
- $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
- $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- print $formfile->getDocumentsLink($askpricesupplierstatic->element, $filename, $filedir);
- print ' | ';
-
- print ' | ';
-
- print ''.img_object($langs->trans("ShowAskPriceSupplier"),"askpricesupplier").' '.$obj->name.' | ';
-
- print ''.$askpricesupplierstatic->LibStatut($obj->fk_statut,$obj->facture,5).' | ';
-
- print ' ';
- $i++;
- }
- }
- print " ";
- }
- else dol_print_error($db);
-}
-*/
-
-//print ' |
';
print '';
-
llxFooter();
$db->close();
diff --git a/htdocs/comm/askpricesupplier/info.php b/htdocs/comm/askpricesupplier/info.php
index a288a3490b3..3b8f95d45fa 100644
--- a/htdocs/comm/askpricesupplier/info.php
+++ b/htdocs/comm/askpricesupplier/info.php
@@ -43,7 +43,7 @@ $result = restrictedArea($user, 'askpricesupplier', $id);
* View
*/
-llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
+llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur');
$object = new AskPriceSupplier($db);
$object->fetch($id);
diff --git a/htdocs/comm/askpricesupplier/list.php b/htdocs/comm/askpricesupplier/list.php
index 7beebf643ff..fe9ca6812e3 100644
--- a/htdocs/comm/askpricesupplier/list.php
+++ b/htdocs/comm/askpricesupplier/list.php
@@ -51,11 +51,9 @@ $socid=GETPOST('socid','int');
$search_user=GETPOST('search_user','int');
$search_sale=GETPOST('search_sale','int');
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
-$search_refcustomer=GETPOST('search_refcustomer','alpha');
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_author=GETPOST('search_author','alpha');
-$search_town=GETPOST('search_town','alpha');
$viewstatut=$db->escape(GETPOST('viewstatut'));
$object_statut=$db->escape(GETPOST('askpricesupplier_statut'));
@@ -86,11 +84,9 @@ if (GETPOST("button_removefilter") || GETPOST("button_removefilter_x")) // Both
$search_user='';
$search_sale='';
$search_ref='';
- $search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$search_author='';
- $search_town='';
$year='';
$month='';
$viewstatut='';
@@ -121,7 +117,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
* View
*/
-llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
+llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur');
$form = new Form($db);
$formother = new FormOther($db);
@@ -139,13 +135,13 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if (! $sortfield) $sortfield='p.datep';
+if (! $sortfield) $sortfield='p.date_livraison';
if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,';
-$sql.= ' p.rowid as askpricesupplierid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
+$sql.= ' p.rowid as askpricesupplierid, p.note_private, p.total_ht, p.ref, p.fk_statut, p.fk_user_author, p.date_livraison as dp,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'askpricesupplier as p';
@@ -164,15 +160,9 @@ if (! $user->rights->societe->client->voir && ! $socid) //restriction
{
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
}
-if ($search_town) {//restriction
- $sql .= natural_search('s.town', $search_town);
-}
if ($search_ref) {
$sql .= natural_search('p.ref', $search_ref);
}
-if ($search_refcustomer) {
- $sql .= natural_search('p.ref_client', $search_refcustomer);
-}
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
}
@@ -195,15 +185,15 @@ if ($viewstatut <> '')
if ($month > 0)
{
if ($year > 0 && empty($day))
- $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
+ $sql.= " AND p.date_livraison BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
else if ($year > 0 && ! empty($day))
- $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
+ $sql.= " AND p.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
else
- $sql.= " AND date_format(p.datep, '%m') = '".$month."'";
+ $sql.= " AND date_format(p.date_livraison, '%m') = '".$month."'";
}
else if ($year > 0)
{
- $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
+ $sql.= " AND p.date_livraison BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0)
@@ -241,13 +231,11 @@ if ($result)
if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref;
- if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer;
if ($search_societe) $param.='&search_societe=' .$search_societe;
if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
if ($search_author) $param.='&search_author='.$search_author;
- if ($search_town) $param.='&search_town='.$search_town;
print_barre_liste($langs->trans('ListOfAskPriceSupplier').' '.($socid?'- '.$soc->name:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
// Lignes des champs de filtre
@@ -282,19 +270,8 @@ if ($result)
print '';
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
-
- /* PHFAVRE
- print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
- */
-
- print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
-
- /* PHFAVRE
- print_liste_field_titre($langs->trans('Town'),$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
- */
-
- print_liste_field_titre($langs->trans('AskPriceSupplierDate'),$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('AskPriceSupplierDate'),$_SERVER["PHP_SELF"],'p.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
@@ -304,22 +281,11 @@ if ($result)
print '
';
print '| ';
print '';
- print ' | ';
-
- /* PHFAVRE
- print '';
- print '';
- print ' | ';
- */
-
+ print '';
print '';
print '';
print ' | ';
- /* PHFAVRE
- print ' | ';
- */
-
// Date
print '';
//print $langs->trans('Month').': ';
@@ -328,11 +294,7 @@ if ($result)
$syear = $year;
$formother->select_year($syear,'year',1, 20, 5);
print ' | ';
-
- /* PHFAVRE
- print ' | ';
- */
-
+
// Amount
print '';
print '';
@@ -391,14 +353,7 @@ if ($result)
print ' |
';
print "\n";
-
- // Customer ref
- /* PHFAVRE
- print '';
- print $objp->ref_client;
- print ' | ';
- */
-
+
$url = DOL_URL_ROOT.'/comm/card.php?socid='.$objp->rowid;
// Company
@@ -409,31 +364,11 @@ if ($result)
print '';
print $companystatic->getNomUrl(1,'customer');
print ' | ';
-
- // Town
- /* PHFAVRE
- print '';
- print $objp->town;
- print ' | ';
- */
- // Date proposal
+ // Date askprice
print '';
print dol_print_date($db->jdate($objp->dp), 'day');
print " | \n";
-
- // Date end validity
- /* PHFAVRE
- if ($objp->dfv)
- {
- print ''.dol_print_date($db->jdate($objp->dfv),'day');
- print ' | ';
- }
- else
- {
- print ' | ';
- }
- */
print ''.price($objp->total_ht)." | \n";
diff --git a/htdocs/comm/askpricesupplier/note.php b/htdocs/comm/askpricesupplier/note.php
index 1a596309a8f..0ce89fe5e8b 100644
--- a/htdocs/comm/askpricesupplier/note.php
+++ b/htdocs/comm/askpricesupplier/note.php
@@ -59,7 +59,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
/* Affichage fiche */
/******************************************************************************/
-llxHeader('',$langs->trans('CommRequest'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
+llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur');
$form = new Form($db);
@@ -85,68 +85,17 @@ if ($id > 0 || ! empty($ref))
print '| '.$langs->trans('Ref').' | ';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print ' |
';
-
- // Ref client
- /* PHFAVRE retrait en temporaire
- print '';
- print '| ';
- print $langs->trans('RefCustomer').' | ';
- print ' | ';
- print ' ';
- print ' | ';
- print $object->ref_client;
- print ' | ';
- print '
';
- */
// Customer
if ( is_null($object->client) )
$object->fetch_thirdparty();
print "| ".$langs->trans("Supplier")." | ";
print ''.$object->client->getNomUrl(1).' |
';
-
- // Ligne info remises tiers
- /* PHFAVRE retrait en temporaire
- print '| '.$langs->trans('Discounts').' | ';
- if ($societe->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_percent);
- else print $langs->trans("CompanyHasNoRelativeDiscount");
- $absolute_discount=$societe->getAvailableDiscounts();
- print '. ';
- if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
- else print $langs->trans("CompanyHasNoAbsoluteDiscount");
- print '.';
- print ' |
';
- */
-
- // Date
- /* PHFAVRE retrait en temporaire
- print '| '.$langs->trans('AskPriceSupplierDate').' | ';
- print dol_print_date($object->date,'daytext');
- print ' | ';
- print '
';
- */
print '| '.$langs->trans('AskPriceSupplierDate').' | ';
print dol_print_date($object->date_livraison,'daytext');
print ' | ';
print '
';
-
- // Date fin propal
- /* PHFAVRE retrait en temporaire
- print '';
- print '| '.$langs->trans('DateEndAsk').' | ';
- if ($object->fin_validite)
- {
- print dol_print_date($object->fin_validite,'daytext');
- if ($object->statut == 1 && $object->fin_validite < ($now - $conf->askpricesupplier->cloture->warning_delay)) print img_warning($langs->trans("Late"));
- }
- else
- {
- print $langs->trans("Unknown");
- }
- print ' | ';
- print '
';
- */
print "";
diff --git a/htdocs/theme/eldy/img/object_askpricesupplier.png b/htdocs/theme/eldy/img/object_askpricesupplier.png
index 9ab48924ccb..2dc60e66b3e 100644
Binary files a/htdocs/theme/eldy/img/object_askpricesupplier.png and b/htdocs/theme/eldy/img/object_askpricesupplier.png differ