Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2e3aad282c
@ -61,6 +61,7 @@ For users:
|
||||
- New: Can send an email from thirdparty card.
|
||||
- New: Can cancel holidays that were previously validated.
|
||||
- Fix: [bug #1022] correct margin calculation for credit notes.
|
||||
- New: Can choose contact on event (action com) creation, and filtred by thirdparty
|
||||
|
||||
For translators:
|
||||
- Qual: Normalized sort order of all languages files with english reference files.
|
||||
|
||||
@ -564,23 +564,23 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$events=array();
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
//For external user force the company to user company
|
||||
if (!empty($user->societe_id)) {
|
||||
print $form->select_company($user->societe_id,'socid','',1,1);
|
||||
print $form->select_company($user->societe_id,'socid','',1,1,0,$events);
|
||||
} else {
|
||||
print $form->select_company('','socid','',1,1);
|
||||
print $form->select_company('','socid','',1,1,0,$events);
|
||||
}
|
||||
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// If company is forced, we propose contacts (may be contact is also forced)
|
||||
if (GETPOST("contactid") > 0 || GETPOST('socid','int') > 0)
|
||||
{
|
||||
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
$form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
$form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
@ -809,12 +809,14 @@ if ($id > 0)
|
||||
{
|
||||
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td>';
|
||||
print '<td>';
|
||||
print $form->select_company($act->societe->id,'socid','',1,1);
|
||||
$events=array();
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
print $form->select_company($act->societe->id,'socid','',1,1,0,$events);
|
||||
print '</td>';
|
||||
|
||||
// Contact
|
||||
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
|
||||
print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1);
|
||||
$form->select_contacts($act->societe->id, $act->contact->id,'contactid',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
0
htdocs/install/mysql/tables/llx_actioncomm_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_actioncomm_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_actioncomm_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_actioncomm_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_type_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_type_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_type_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_adherent_type_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_actioncomm.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_actioncomm.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_availability.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_availability.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_barcode_type.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_barcode_type.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_method.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_method.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_method.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_method.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_reason.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_reason.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_reason.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_c_input_reason.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commande_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commande_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commande_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commande_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commandedet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commandedet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commandedet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_commandedet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_fourn_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_fourn_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facture_fourn_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facturedet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facturedet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facturedet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_facturedet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_fichinter_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_fichinter_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_comments.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_comments.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_comments.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_comments.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_sondage.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_sondage.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_sondage.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_sondage.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_user_studs.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_user_studs.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_paiementcharge.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_paiementcharge.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_association.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_association.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_association.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_association.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_product_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_task_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_task_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_task_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_projet_task_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propal_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propal_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propal_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propal_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propaldet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propaldet_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propaldet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_propaldet_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_societe_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_societe_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_societe_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_societe_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_socpeople_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_socpeople_extrafields.key.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
Executable file → Normal file
0
htdocs/install/mysql/tables/llx_socpeople_extrafields.sql
Executable file → Normal file
@ -27,6 +27,7 @@ ListOfStockMovements=List of stock movements
|
||||
StocksArea=Stocks area
|
||||
Location=Location
|
||||
LocationSummary=Short name location
|
||||
NumberOfDifferentProducts=Number of different products
|
||||
NumberOfProducts=Total number of products
|
||||
LastMovement=Last movement
|
||||
LastMovements=Last movements
|
||||
@ -98,3 +99,4 @@ SelectProduct=Select at least one product
|
||||
AlertOnly= Alerts only
|
||||
WarehouseForStockDecrease=The warehouse <b>%s</b> will be used for stock decrease
|
||||
WarehouseForStockIncrease=The warehouse <b>%s</b> will be used for stock increase
|
||||
ForThisWarehouse=For this warehouse
|
||||
@ -27,6 +27,7 @@ ListOfStockMovements=Liste des mouvements de stock
|
||||
StocksArea=Espace stocks
|
||||
Location=Lieu
|
||||
LocationSummary=Nom court du lieu
|
||||
NumberOfDifferentProducts=Nombre de produits différents
|
||||
NumberOfProducts=Nombre total de produits
|
||||
LastMovement=Dernier mouvement
|
||||
LastMovements=Derniers mouvements
|
||||
@ -98,3 +99,4 @@ SelectProduct=Sélectionnez au moins un produit
|
||||
AlertOnly = Alertes seulement
|
||||
WarehouseForStockDecrease=L'entrepôt <b>%s</b> sera utilisé pour la décrémentation du stock
|
||||
WarehouseForStockIncrease=L'entrepôt <b>%s</b> sera utilisé pour l'incrémentation du stock
|
||||
ForThisWarehouse=Pour cet entrepôt
|
||||
@ -243,15 +243,15 @@ class Entrepot extends CommonObject
|
||||
function fetch($id, $ref='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
$sql = "SELECT rowid, label, description, statut, lieu, address, zip, town, fk_pays as country_id";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
|
||||
|
||||
if ($id)
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$sql.= " WHERE rowid = '".$id."'";
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE entity = " .$conf->entity;
|
||||
@ -276,12 +276,12 @@ class Entrepot extends CommonObject
|
||||
$this->zip = $obj->zip;
|
||||
$this->town = $obj->town;
|
||||
$this->country_id = $obj->country_id;
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
$tmp=getCountry($this->country_id,'all');
|
||||
$this->country=$tmp['label'];
|
||||
$this->country_code=$tmp['code'];
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -377,6 +377,38 @@ class Entrepot extends CommonObject
|
||||
return $liste;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of unique different product into a warehosue
|
||||
*
|
||||
* @return Array Array('nb'=>Nb, 'value'=>Value)
|
||||
*/
|
||||
function nb_different_products()
|
||||
{
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT count(distinct p.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE ps.fk_entrepot = ".$this->id;
|
||||
$sql.= " AND ps.fk_product = p.rowid";
|
||||
|
||||
//print $sql;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$ret['nb']=$obj->nb;
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return stock and value of warehosue
|
||||
*
|
||||
|
||||
@ -276,8 +276,14 @@ else
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
$calcproductsunique=$object->nb_different_products();
|
||||
$calcproducts=$object->nb_products();
|
||||
|
||||
// Total nb of different products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfDifferentProducts").'</td><td colspan="3">';
|
||||
print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Nb of products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
|
||||
|
||||
@ -190,9 +190,9 @@ if ($resql)
|
||||
|
||||
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
$texte = $langs->trans("ListOfStockMovements");
|
||||
$texte.=' ('.$langs->trans("ForThisWarehouse").')';
|
||||
llxHeader("",$texte,$help_url);
|
||||
|
||||
|
||||
/*
|
||||
* Show tab only if we ask a particular warehouse
|
||||
*/
|
||||
@ -236,8 +236,14 @@ if ($resql)
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
$calcproductsunique=$entrepot->nb_different_products();
|
||||
$calcproducts=$entrepot->nb_products();
|
||||
|
||||
// Total nb of different products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfDifferentProducts").'</td><td colspan="3">';
|
||||
print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Nb of products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
|
||||
@ -392,8 +398,8 @@ if ($resql)
|
||||
if ($snom) $param.='&snom='.urlencode($snom);
|
||||
if ($search_user) $param.='&search_user='.urlencode($search_user);
|
||||
if ($idproduct > 0) $param.='&idproduct='.$idproduct;
|
||||
if ($id) print_barre_liste($texte, $page, "mouvement.php", $param, $sortfield, $sortorder,'',$num,0,'');
|
||||
else print_barre_liste($texte, $page, "mouvement.php", $param, $sortfield, $sortorder,'',$num);
|
||||
if ($id) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,0,'');
|
||||
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
@ -401,7 +407,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"], "m.datem","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Product"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Warehouse"),$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Warehouse"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
|
||||
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Units"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
@ -426,7 +432,7 @@ if ($resql)
|
||||
print '<input class="flat" type="text" size="12" name="search_product" value="'.($idproduct?$product->libelle:$search_product).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="search_warehouse" value="'.($search_warehouse).'">';
|
||||
//print '<input class="flat" type="text" size="10" name="search_warehouse" value="'.($search_warehouse).'">'; // We are on a specific warehouse card, no filter on other should be possible
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_user" value="'.($search_user).'">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user