Qual: Rename label to avoid confusion.
Qual: Fix code to reflect documentation.
This commit is contained in:
parent
edbfd7d4f8
commit
803f840761
@ -98,7 +98,8 @@ $formother = new FormOther($db);
|
|||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
|
|
||||||
llxHeader();
|
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||||
|
llxHeader('',$langs->trans("Orders"),$help_url);
|
||||||
|
|
||||||
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
|
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
|
||||||
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
|
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
|
||||||
|
|||||||
@ -29,10 +29,12 @@
|
|||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
|
||||||
|
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
|
||||||
|
|
||||||
$langs->load('orders');
|
$langs->load('orders');
|
||||||
$langs->load('deliveries');
|
$langs->load('deliveries');
|
||||||
@ -73,10 +75,9 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
$html = new Form($db);
|
|
||||||
$formfile = new FormFile($db);
|
$viewstatut=GETPOST('viewstatut');
|
||||||
$companystatic = new Societe($db);
|
|
||||||
$htmlother = new FormOther($db);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -342,14 +343,17 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
|
|||||||
$mesgs[]='<div class="error">'.$object->error.'</div>';
|
$mesgs[]='<div class="error">'.$object->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$htmlother = new FormOther($db);
|
$htmlother = new FormOther($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
$now=dol_now();
|
$companystatic = new Societe($db);
|
||||||
|
|
||||||
// Mode creation
|
// Mode creation
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
@ -461,7 +465,6 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
while ($i < $n)
|
while ($i < $n)
|
||||||
{
|
{
|
||||||
@ -476,12 +479,13 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
|
|||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Mode liste
|
//Mode liste
|
||||||
else
|
if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
||||||
{
|
{
|
||||||
llxHeader();
|
llxHeader();
|
||||||
?>
|
?>
|
||||||
<script language="javascript" type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery("#checkall").click(function() {
|
jQuery("#checkall").click(function() {
|
||||||
jQuery(".checkformerge").attr('checked', true);
|
jQuery(".checkformerge").attr('checked', true);
|
||||||
@ -499,7 +503,27 @@ else
|
|||||||
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= ' WHERE c.fk_soc = s.rowid';
|
$sql.= ' WHERE c.fk_soc = s.rowid';
|
||||||
$sql.= ' AND c.fk_statut in (1, 2) AND c.facture = 0';
|
// Which invoice to show
|
||||||
|
if ($viewstatut <> '')
|
||||||
|
{
|
||||||
|
if ($viewstatut < 4 && $viewstatut > -2)
|
||||||
|
{
|
||||||
|
$sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee
|
||||||
|
if ($viewstatut == 3)
|
||||||
|
{
|
||||||
|
$sql.= ' AND c.facture = 0'; // need to create invoice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($viewstatut == 4)
|
||||||
|
{
|
||||||
|
$sql.= ' AND c.facture = 1'; // invoice created
|
||||||
|
}
|
||||||
|
if ($viewstatut == -2) // To process
|
||||||
|
{
|
||||||
|
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
|
||||||
|
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
|
||||||
|
}
|
||||||
|
}
|
||||||
$sql.= ' AND s.entity = '.$conf->entity;
|
$sql.= ' AND s.entity = '.$conf->entity;
|
||||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
|||||||
@ -858,8 +858,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||||||
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
|
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
|
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
|
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire);
|
if ($leftmenu=="orders" && $conf->expedition->enabled) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire);
|
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-2"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
|
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
|
||||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
|
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
|
||||||
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
|
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
|
||||||
|
|||||||
@ -21,7 +21,7 @@ CustomersOrders=Customer's orders
|
|||||||
CustomersOrdersRunning=Current customer's orders
|
CustomersOrdersRunning=Current customer's orders
|
||||||
CustomersOrdersAndOrdersLines=Customer orders and order's lines
|
CustomersOrdersAndOrdersLines=Customer orders and order's lines
|
||||||
OrdersToValid=Customer's orders to validate
|
OrdersToValid=Customer's orders to validate
|
||||||
OrdersToBill=Customer's orders to bill
|
OrdersToBill=Customer's orders delivered
|
||||||
OrdersInProcess=Customer's orders in process
|
OrdersInProcess=Customer's orders in process
|
||||||
OrdersToProcess=Customer's orders to process
|
OrdersToProcess=Customer's orders to process
|
||||||
SuppliersOrdersToProcess=Supplier's orders to process
|
SuppliersOrdersToProcess=Supplier's orders to process
|
||||||
@ -32,7 +32,7 @@ StatusOrderSentShort=In process
|
|||||||
StatusOrderSent=Shipment in process
|
StatusOrderSent=Shipment in process
|
||||||
StatusOrderOnProcessShort=Reception
|
StatusOrderOnProcessShort=Reception
|
||||||
StatusOrderProcessedShort=Processed
|
StatusOrderProcessedShort=Processed
|
||||||
StatusOrderToBillShort=To bill
|
StatusOrderToBillShort=Delivered
|
||||||
StatusOrderApprovedShort=Approved
|
StatusOrderApprovedShort=Approved
|
||||||
StatusOrderRefusedShort=Refused
|
StatusOrderRefusedShort=Refused
|
||||||
StatusOrderToProcessShort=To process
|
StatusOrderToProcessShort=To process
|
||||||
@ -43,7 +43,7 @@ StatusOrderDraft=Draft (needs to be validated)
|
|||||||
StatusOrderValidated=Validated
|
StatusOrderValidated=Validated
|
||||||
StatusOrderOnProcess=Waiting to receive
|
StatusOrderOnProcess=Waiting to receive
|
||||||
StatusOrderProcessed=Processed
|
StatusOrderProcessed=Processed
|
||||||
StatusOrderToBill=To bill
|
StatusOrderToBill=Delivered
|
||||||
StatusOrderApproved=Approved
|
StatusOrderApproved=Approved
|
||||||
StatusOrderRefused=Refused
|
StatusOrderRefused=Refused
|
||||||
StatusOrderReceivedPartially=Partially received
|
StatusOrderReceivedPartially=Partially received
|
||||||
@ -51,7 +51,7 @@ StatusOrderReceivedAll=Everything received
|
|||||||
ShippingExist=A shipment exists
|
ShippingExist=A shipment exists
|
||||||
DraftOrWaitingApproved=Draft or approved not yet ordered
|
DraftOrWaitingApproved=Draft or approved not yet ordered
|
||||||
DraftOrWaitingShipped=Draft or validated not yet shipped
|
DraftOrWaitingShipped=Draft or validated not yet shipped
|
||||||
MenuOrdersToBill=Orders to bill
|
MenuOrdersToBill=Orders delivered
|
||||||
SearchOrder=Search order
|
SearchOrder=Search order
|
||||||
Sending=Sending
|
Sending=Sending
|
||||||
Sendings=Sendings
|
Sendings=Sendings
|
||||||
|
|||||||
@ -21,7 +21,7 @@ CustomersOrders=Commandes clients
|
|||||||
CustomersOrdersRunning=Commandes clients en cours
|
CustomersOrdersRunning=Commandes clients en cours
|
||||||
CustomersOrdersAndOrdersLines=Commandes clients et lignes de commandes
|
CustomersOrdersAndOrdersLines=Commandes clients et lignes de commandes
|
||||||
OrdersToValid=Commandes clients à valider
|
OrdersToValid=Commandes clients à valider
|
||||||
OrdersToBill=Commandes clients à facturer
|
OrdersToBill=Commandes clients délivrées
|
||||||
OrdersInProcess=Commandes clients en traitement
|
OrdersInProcess=Commandes clients en traitement
|
||||||
OrdersToProcess=Commandes clients à traiter
|
OrdersToProcess=Commandes clients à traiter
|
||||||
SuppliersOrdersToProcess=Commandes fournisseurs à traiter
|
SuppliersOrdersToProcess=Commandes fournisseurs à traiter
|
||||||
@ -32,7 +32,7 @@ StatusOrderOnProcessShort=Traitement en cours
|
|||||||
StatusOrderSentShort=Envoi en cours
|
StatusOrderSentShort=Envoi en cours
|
||||||
StatusOrderSent=Envoi en cours
|
StatusOrderSent=Envoi en cours
|
||||||
StatusOrderProcessedShort=Traitée
|
StatusOrderProcessedShort=Traitée
|
||||||
StatusOrderToBillShort=À facturer
|
StatusOrderToBillShort=Délivrée
|
||||||
StatusOrderApprovedShort=Approuvée
|
StatusOrderApprovedShort=Approuvée
|
||||||
StatusOrderRefusedShort=Refusée
|
StatusOrderRefusedShort=Refusée
|
||||||
StatusOrderToProcessShort=A traiter
|
StatusOrderToProcessShort=A traiter
|
||||||
@ -43,7 +43,7 @@ StatusOrderDraft=Brouillon (à valider)
|
|||||||
StatusOrderValidated=Validée
|
StatusOrderValidated=Validée
|
||||||
StatusOrderOnProcess=Attente réception
|
StatusOrderOnProcess=Attente réception
|
||||||
StatusOrderProcessed=Traitée
|
StatusOrderProcessed=Traitée
|
||||||
StatusOrderToBill=À facturer
|
StatusOrderToBill=Délivrée
|
||||||
StatusOrderApproved=Approuvée
|
StatusOrderApproved=Approuvée
|
||||||
StatusOrderRefused=Refusée
|
StatusOrderRefused=Refusée
|
||||||
StatusOrderReceivedPartially=Reçu partiellement
|
StatusOrderReceivedPartially=Reçu partiellement
|
||||||
@ -52,7 +52,7 @@ ShippingExist=Une expédition existe
|
|||||||
DraftOrWaitingApproved=Brouillon ou approuvée pas encore commandée
|
DraftOrWaitingApproved=Brouillon ou approuvée pas encore commandée
|
||||||
DraftOrWaitingShipped=Brouillon ou validée pas encore expédiée
|
DraftOrWaitingShipped=Brouillon ou validée pas encore expédiée
|
||||||
SearchOrder=Rechercher une commande
|
SearchOrder=Rechercher une commande
|
||||||
MenuOrdersToBill=Commandes à facturer
|
MenuOrdersToBill=Commandes délivrées
|
||||||
Sending=Expédition
|
Sending=Expédition
|
||||||
Sendings=Expéditions
|
Sendings=Expéditions
|
||||||
ShipProduct=Expédier produit
|
ShipProduct=Expédier produit
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user