New: Can edit sending methods

This commit is contained in:
Laurent Destailleur 2009-01-22 22:55:51 +00:00
parent 341c03d4ee
commit feef7bc05a
11 changed files with 70 additions and 45 deletions

View File

@ -48,7 +48,7 @@ $active = 1;
// Mettre ici tous les caract<63>ristiques des dictionnaires
// Ordres d'affichage des dictionnaires (0 pour espace)
$taborder=array(9,0,4,3,2,0,1,8,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,15);
$taborder=array(9,0,4,3,2,0,1,8,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,18,0,15);
// Nom des tables des dictionnaires
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
@ -68,8 +68,9 @@ $tabname[14]= MAIN_DB_PREFIX."c_ecotaxe";
$tabname[15]= MAIN_DB_PREFIX."c_paper_format";
$tabname[16]= MAIN_DB_PREFIX."c_prospectlevel";
$tabname[17]= MAIN_DB_PREFIX."c_type_fees";
$tabname[18]= MAIN_DB_PREFIX."expedition_methode";
// Libell<EFBFBD> des dictionnaires
// Dictionary labels
$tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType");
$tablib[2] = $langs->trans("DictionnaryCanton");
$tablib[3] = $langs->trans("DictionnaryRegion");
@ -87,8 +88,9 @@ $tablib[14]= $langs->trans("DictionnaryEcotaxe");
$tablib[15]= $langs->trans("DictionnaryPaperFormat");
$tablib[16]= $langs->trans("DictionnaryProspectLevel");
$tablib[17]= $langs->trans("DictionnaryFees");
$tablib[18]= $langs->trans("DictionnarySendingMethods");
// Requete pour extraction des donn<EFBFBD>es des dictionnaires
// Requete pour extraction des donnees des dictionnaires
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code , d.nom as libelle, d.fk_region as region_id, r.nom as region, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
$tabsql[3] = "SELECT r.rowid as rowid, code_region as code , nom as libelle, r.fk_pays as pays_id, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
@ -106,6 +108,7 @@ $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.org
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."expedition_methode";
// Critere de tri du dictionnaire
$tabsqlsort[1] ="pays, code ASC";
@ -125,6 +128,7 @@ $tabsqlsort[14]="pays, e.organization ASC, code ASC";
$tabsqlsort[15]="rowid ASC";
$tabsqlsort[16]="sortorder ASC";
$tabsqlsort[17]="code ASC";
$tabsqlsort[18]="code ASC, libelle ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield[1] = "code,libelle,pays";
@ -144,6 +148,7 @@ $tabfield[14]= "code,libelle,price,organization,pays_id,pays";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle";
$tabfield[17]= "code,libelle";
$tabfield[18]= "code,libelle";
// Nom des champs d'edition pour modification du dictionnaire
$tabfieldvalue[1] = "code,libelle,pays";
@ -163,6 +168,7 @@ $tabfieldvalue[14]= "code,libelle,price,organization,pays";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle";
$tabfieldvalue[17]= "code,libelle";
$tabfieldvalue[18]= "code,libelle";
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert[1] = "code,libelle,fk_pays";
@ -182,8 +188,9 @@ $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label";
$tabfieldinsert[17]= "code,libelle";
$tabfieldinsert[18]= "code,libelle";
// Nom du rowid si le champ n'est pas de type autoincr<EFBFBD>ment
// Nom du rowid si le champ n'est pas de type autoincrement
$tabrowid[1] = "";
$tabrowid[2] = "";
$tabrowid[3] = "";
@ -201,6 +208,7 @@ $tabrowid[14]= "";
$tabrowid[15]= "";
$tabrowid[16]= "code";
$tabrowid[17]= "id";
$tabrowid[18]= "rowid";
// Condition to show dictionnary in setup page
$tabcond[1] = true;
@ -220,6 +228,7 @@ $tabcond[14]= $conf->produit->enabled&&$conf->global->PRODUIT_USE_ECOTAXE;
$tabcond[15]= true;
$tabcond[16]= $conf->societe->enabled;
$tabcond[17]= $conf->deplacement->enabled;
$tabcond[18]= $conf->expedition->enabled;
$msg='';
@ -542,6 +551,7 @@ if ($_GET["id"])
}
// Affiche table des valeurs
dolibarr_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{

View File

@ -762,7 +762,7 @@ class Expedition extends CommonObject
$sql = "SELECT em.rowid, em.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."expedition_methode as em";
$sql.= " WHERE em.statut = 1 ORDER BY em.libelle ASC";
$sql.= " WHERE em.active = 1 ORDER BY em.libelle ASC";
$resql = $this->db->query($sql);
if ($resql)

View File

@ -370,6 +370,8 @@ if ($_GET["action"] == 'create')
$ligne = $object->lignes[$indiceAsked];
$var=!$var;
print "<tr ".$bc[$var].">\n";
// Desc
if ($ligne->fk_product > 0)
{
$product->fetch($ligne->fk_product);
@ -384,9 +386,11 @@ if ($_GET["action"] == 'create')
print "<td>".nl2br($ligne->desc)."</td>\n";
}
// Qty
print '<td align="center">'.$ligne->qty.'</td>';
$qtyProdCom=$ligne->qty;
// Sendings
print '<td align="center">';
$quantityDelivered = $object->expeditions[$ligne->id];
print $quantityDelivered;
@ -415,7 +419,8 @@ if ($_GET["action"] == 'create')
// Stock
if ($_GET["entrepot_id"])
{
print '<td align="right">'.$stock;
print '<td align="right">';
print $stock;
if ($stock < $quantityToBeDelivered)
{
print ' '.img_warning($langs->trans("StockTooLow"));
@ -468,7 +473,7 @@ if ($_GET["action"] == 'create')
print "</tr>\n";
// associations sous produits
// Show subproducts of product
if ($ligne->fk_product > 0)
{
$product->get_sousproduits_arbo ();
@ -485,10 +490,6 @@ if ($_GET["action"] == 'create')
$indiceAsked++;
}
/*
*
*/
print '<tr><td align="center" colspan="5"><br><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
print "</table>";
print '</form>';

View File

@ -2384,33 +2384,36 @@ class Form
print '<option value="-1"'.($id==-1?' selected="true"':'').'>&nbsp;</option>'."\n";
}
while (list($key, $value) = each ($array))
if (is_array($array))
{
print '<option value="'.($value_as_key?$value:$key).'"';
// Si il faut pré-sélectionner une valeur
if ($id != '' && ($id == $key || $id == $value))
while (list($key, $value) = each ($array))
{
print ' selected="true"';
print '<option value="'.($value_as_key?$value:$key).'"';
// Si il faut pré-sélectionner une valeur
if ($id != '' && ($id == $key || $id == $value))
{
print ' selected="true"';
}
print '>';
if ($key_in_label)
{
$newval=($translate?$langs->trans($value):$value);
$selectOptionValue = $key.' - '.($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
print $selectOptionValue;
}
else
{
$newval=($translate?$langs->trans($value):$value);
$selectOptionValue = ($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
if ($value == '' || $value == '-') { $selectOptionValue='&nbsp;'; }
print $selectOptionValue;
}
print "</option>\n";
}
print '>';
if ($key_in_label)
{
$newval=($translate?$langs->trans($value):$value);
$selectOptionValue = $key.' - '.($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
print $selectOptionValue;
}
else
{
$newval=($translate?$langs->trans($value):$value);
$selectOptionValue = ($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
if ($value == '' || $value == '-') { $selectOptionValue='&nbsp;'; }
print $selectOptionValue;
}
print "</option>\n";
}
print "</select>";
}

View File

@ -475,6 +475,7 @@ DictionnaryTypeContact=Contact types
DictionnaryEcotaxe=Ecotax (WEEE)
DictionnaryPaperFormat=Paper formats
DictionnaryFees=Type of fees
DictionnarySendingMethods=Sendings methods
SetupSaved=Setup saved
BackToModuleList=Back to modules list
BackToDictionnaryList=Back to dictionaries list

View File

@ -42,11 +42,11 @@ QtyDispatched=Quantity dispatched
OrderDispatch=Order dispatching
RuleForStockManagementDecrease=Rule for stock management decrease
RuleForStockManagementIncrease=Rule for stock management increase
DeStockOnBill=Decrease real stocks on invoices/credit notes (warning, in this version, it's only in warehouse number 1 that stock is modified)
DeStockOnValidateOrder=Decrease real stocks on orders notes (warning, in this version, it's only in warehouse number 1 that stock is modified)
DeStockOnShipment=Decrease real stocks on shipment (recommanded)
ReStockOnBill=Increase real stocks on invoices/credit notes (warning, in this version, it's only in warehouse number 1 that stock is modified)
ReStockOnValidateOrder=Increase real stocks on orders notes (warning, in this version, it's only in warehouse number 1 that stock is modified)
DeStockOnBill=Decrease real stocks on invoices/credit notes validation (warning, in this version, it's only in warehouse number 1 that stock is modified)
DeStockOnValidateOrder=Decrease real stocks on orders notes validation (warning, in this version, it's only in warehouse number 1 that stock is modified)
DeStockOnShipment=Decrease real stocks on shipment validation (recommanded)
ReStockOnBill=Increase real stocks on invoices/credit notes validation (warning, in this version, it's only in warehouse number 1 that stock is modified)
ReStockOnValidateOrder=Increase real stocks on orders notes validation (warning, in this version, it's only in warehouse number 1 that stock is modified)
StockDiffPhysicTeoric=Reason for difference stock physical and theorical
StockLimitShort=Limit
StockLimit=Stock limit for alerts

View File

@ -474,6 +474,7 @@ DictionnaryTypeContact=Types de contacts
DictionnaryEcotaxe=Barèmes Eco-participation (DEEE)
DictionnaryPaperFormat=Format papiers
DictionnaryFees=Types de déplacement et notes de frais
DictionnarySendingMethods=Méthodes d'expéditions
SetupSaved=Configuration sauvegardée
BackToModuleList=Retour liste des modules
BackToDictionnaryList=Retour liste des dictionnaires

View File

@ -42,11 +42,11 @@ QtyDispatched=Quantité ventilée
OrderDispatch=Ventilation commande
RuleForStockManagementDecrease=Règle de gestion des décrémentations de stock
RuleForStockManagementIncrease=Règle de gestion des incrémentations de stock
DeStockOnBill=Décrémente les stocks physiques sur les factures/avoirs (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
DeStockOnValidateOrder=Décrémente les stocks physiques sur les commandes (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
DeStockOnShipment=Décrémente les stocks physiques sur les expéditions (recommandé)
ReStockOnBill=Incrémente les stocks physiques sur les factures/avoirs (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
ReStockOnValidateOrder=Incrémente les stocks physiques sur les commandes (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
DeStockOnBill=Décrémente les stocks physiques sur validation des factures/avoirs (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
DeStockOnValidateOrder=Décrémente les stocks physiques sur validation des commandes (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
DeStockOnShipment=Décrémente les stocks physiques sur validation des expéditions (recommandé)
ReStockOnBill=Incrémente les stocks physiques sur validation des factures/avoirs (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
ReStockOnValidateOrder=Incrémente les stocks physiques sur validation des commandes (attention, dans cette version, c'est toujours dans le premier entrepot numero 1 que se fait l'ajustement)
StockDiffPhysicTeoric=Raison écart stock physique-théorique
StockLimitShort=Seuil
StockLimit=Seuil alerte stock

View File

@ -47,7 +47,7 @@ function ValidEmail($address)
if (eregi(".*<(.+)>", $address, $regs)) {
$address = $regs[1];
}
if (eregi("^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|coop|aero|biz|com|edu|gov|info|int|mil|name|net|org)\$",$address))
if (eregi("^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|asso|aero|biz|com|coop|edu|gov|info|int|mil|name|net|org|pro)\$",$address))
{
return true;
}

View File

@ -1392,3 +1392,7 @@ INSERT INTO llx_const (name,value,type,visible,note) VALUES ('MAIN_AGENDA_ACTION
INSERT INTO llx_const (name,value,type,visible,note) VALUES ('MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE','1','chaine',0,'');
INSERT INTO llx_const (name,value,type,visible,note) VALUES ('MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE','1','chaine',0,'');
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,statut) VALUES (1,'CATCH','Catch','Catch by client',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,statut) VALUES (2,'TRANS','Transporter','Generic transporter',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,statut) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi',0);

View File

@ -104,4 +104,9 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
alter table llx_product_stock add column pmp double(24,8) default 0 NOT NULL;
alter table llx_expedition_methode change statut active tinyint DEFAULT 1;
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (1,'CATCH','Catch','Catch by client',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (2,'TRANS','Transporter','Generic transporter',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi',0);