Merge remote-tracking branch 'origin/3.7' into develop

This commit is contained in:
Laurent Destailleur 2015-02-02 21:45:31 +01:00
commit 21c78cc392
7 changed files with 29 additions and 11 deletions

View File

@ -324,6 +324,7 @@ if ($resql)
$var=true; $var=true;
$total=0; $total=0;
$subtotal=0; $subtotal=0;
$productstat_cache=array();
$generic_commande = new Commande($db); $generic_commande = new Commande($db);
$generic_product = new Product($db); $generic_product = new Product($db);
@ -356,17 +357,32 @@ if ($resql)
if ($generic_commande->lines[$lig]->product_type==0) { if ($generic_commande->lines[$lig]->product_type==0) {
$nbprod++; // order contains real products $nbprod++; // order contains real products
$generic_product->id = $generic_commande->lines[$lig]->fk_product; $generic_product->id = $generic_commande->lines[$lig]->fk_product;
$generic_product->load_stock(); if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
$generic_product->load_stock(true);
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
} else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
}
// stock order and stock order_supplier // stock order and stock order_supplier
$stock_order=0; $stock_order=0;
$stock_order_supplier=0; $stock_order_supplier=0;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
if (! empty($conf->commande->enabled)) { if (! empty($conf->commande->enabled)) {
$generic_product->load_stats_commande(0,'1,2'); if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
$generic_product->load_stats_commande(0,'1,2',true);
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
} else {
$generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
}
$stock_order=$generic_product->stats_commande['qty']; $stock_order=$generic_product->stats_commande['qty'];
} }
if (! empty($conf->fournisseur->enabled)) { if (! empty($conf->fournisseur->enabled)) {
$generic_product->load_stats_commande_fournisseur(0,'3'); if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
$generic_product->load_stats_commande_fournisseur(0,'3',true);
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
} else {
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
}
$stock_order_supplier=$generic_product->stats_commande_fournisseur['qty']; $stock_order_supplier=$generic_product->stats_commande_fournisseur['qty'];
} }
} }

View File

@ -1260,7 +1260,7 @@ else
* Lines of contracts * Lines of contracts
*/ */
if ($conf->product->enabled) { if ($conf->product->enabled || $conf->service->enabled) {
$productstatic=new Product($db); $productstatic=new Product($db);
} }
@ -1329,7 +1329,7 @@ else
$productstatic->ref=$objp->label; $productstatic->ref=$objp->label;
print $productstatic->getNomUrl(0,'',16); print $productstatic->getNomUrl(0,'',16);
} }
if (! empty($conf->global->PRODUIT_DESC_IN_FORM) and $objp->description) if (! empty($conf->global->PRODUIT_DESC_IN_FORM) && !empty($objp->description))
print '<br>'.dol_nl2br($objp->description); print '<br>'.dol_nl2br($objp->description);
print '</td>'; print '</td>';
} }

View File

@ -2458,7 +2458,7 @@ function dol_print_error($db='',$error='')
if ($_SERVER['DOCUMENT_ROOT']) // Mode web if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{ {
$out.=$langs->trans("DolibarrHasDetectedError").".<br>\n"; $out.=$langs->trans("DolibarrHasDetectedError").".<br>\n";
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental level of features, so please do NOT report any bugs, anywhere, until going back to MAIN_FEATURES_LEVEL = 0.<br>\n"; if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
$out.=$langs->trans("InformationToHelpDiagnose").":<br>\n"; $out.=$langs->trans("InformationToHelpDiagnose").":<br>\n";
$out.="<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n"; $out.="<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";

View File

@ -294,7 +294,7 @@ DoNotUseInProduction=Do not use in production
ThisIsProcessToFollow=This is setup to process: ThisIsProcessToFollow=This is setup to process:
StepNb=Step %s StepNb=Step %s
FindPackageFromWebSite=Find a package that provides feature you want (for example on official web site %s). FindPackageFromWebSite=Find a package that provides feature you want (for example on official web site %s).
DownloadPackageFromWebSite=Download package. DownloadPackageFromWebSite=Download package %s.
UnpackPackageInDolibarrRoot=Unpack package file into Dolibarr's root directory <b>%s</b> UnpackPackageInDolibarrRoot=Unpack package file into Dolibarr's root directory <b>%s</b>
SetupIsReadyForUse=Install is finished and Dolibarr is ready to use with this new component. SetupIsReadyForUse=Install is finished and Dolibarr is ready to use with this new component.
NotExistsDirect=The alternative root directory is not defined.<br> NotExistsDirect=The alternative root directory is not defined.<br>

View File

@ -43,6 +43,8 @@ ECMDocsByContracts=Documents linked to contracts
ECMDocsByInvoices=Documents linked to customers invoices ECMDocsByInvoices=Documents linked to customers invoices
ECMDocsByProducts=Documents linked to products ECMDocsByProducts=Documents linked to products
ECMDocsByProjects=Documents linked to projects ECMDocsByProjects=Documents linked to projects
ECMDocsByUsers=Documents linked to users
ECMDocsByInterventions=Documents linked to interventions
ECMNoDirectoryYet=No directory created ECMNoDirectoryYet=No directory created
ShowECMSection=Show directory ShowECMSection=Show directory
DeleteSection=Remove directory DeleteSection=Remove directory

View File

@ -26,11 +26,11 @@ ProductsAndServicesOnSell=Available Products and Services
ProductsAndServicesNotOnSell=Obsolete Products and Services ProductsAndServicesNotOnSell=Obsolete Products and Services
ProductsAndServicesStatistics=Products and Services statistics ProductsAndServicesStatistics=Products and Services statistics
ProductsStatistics=Products statistics ProductsStatistics=Products statistics
ProductsOnSell=Available products ProductsOnSell=Product for sale or for pruchase
ProductsNotOnSell=Obsolete products ProductsNotOnSell=Product out of sale and out of purchase
ProductsOnSellAndOnBuy=Products for sale and for purchase ProductsOnSellAndOnBuy=Products for sale and for purchase
ServicesOnSell=Available services ServicesOnSell=Services for sale or for pruchase
ServicesNotOnSell=Obsolete services ServicesNotOnSell=Services out of sale
ServicesOnSellAndOnBuy=Services for sale and for purchase ServicesOnSellAndOnBuy=Services for sale and for purchase
InternalRef=Internal reference InternalRef=Internal reference
LastRecorded=Last products/services on sell recorded LastRecorded=Last products/services on sell recorded