diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index b03d26dbe1d..492cbbd7464 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -59,7 +59,7 @@ ReStockOnValidateOrder=Increase real stocks on suppliers orders approbation ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving ReStockOnDeleteInvoice=Increase real stocks on invoice deletion OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses. -StockDiffPhysicTeoric=Reason for difference stock physical and theoretical +StockDiffPhysicTeoric=Explanation for difference between physical and theoretical stock NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required. DispatchVerb=Dispatch StockLimitShort=Limit for alert diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 98cfd675fac..e4a46c76674 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -351,28 +351,29 @@ print ''; // MultiPrix if (! empty($conf->global->PRODUIT_MULTIPRICES)) { + // Price and min price are variable (depends on level of company). if (! empty($socid)) { $soc = new Societe($db); $soc->id = $socid; $soc->fetch($socid); + // Selling price print '' . $langs->trans("SellingPrice") . ''; - + print ''; if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { - print '' . price($object->multiprices_ttc ["$soc->price_level"]); + print price($object->multiprices_ttc["$soc->price_level"]); } else { - print '' . price($object->multiprices ["$soc->price_level"]); + print price($object->multiprices["$soc->price_level"]); } - if ($object->multiprices_base_type["$soc->price_level"]) { - print ' ' . $langs->trans($object->multiprices_base_type ["$soc->price_level"]); + print ' ' . $langs->trans($object->multiprices_base_type["$soc->price_level"]); } else { print ' ' . $langs->trans($object->price_base_type); } print ''; - // Prix mini + // Price min print '' . $langs->trans("MinPrice") . ''; if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { @@ -390,7 +391,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { // TVA - if ($i == 1) // We show only price for level 1 + if ($i == 1) // We show only vat for level 1 { print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . ''; } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 616e91d1924..3dff2284b2a 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -31,6 +31,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; @@ -203,26 +204,59 @@ if ($action == "transfert_stock" && ! $cancel) //print 'price src='.$pricesrc.', price dest='.$pricedest;exit; - // Remove stock - $result1=$product->correct_stock( - $user, - GETPOST("id_entrepot_source"), - GETPOST("nbpiece"), - 1, - GETPOST("label"), - $pricesrc - ); + $pdluoid=GETPOST('pdluoid','int'); - // Add stock - $result2=$product->correct_stock( - $user, - GETPOST("id_entrepot_destination"), - GETPOST("nbpiece"), - 0, - GETPOST("label"), - $pricedest - ); + if ($pdluoid>0) + { + $pdluo = new Productbatch($db); + $result=$pdluo->fetch($pdluoid); + if ($result>0 && $pdluo->id) + { + // Remove stock + $result1=$product->correct_stock_batch( + $user, + $pdluo->warehouseid, + GETPOST("nbpiece",'int'), + 1, + GETPOST("label",'san_alpha'), + $pricesrc, + $pdluo->eatby,$pdluo->sellby,$pdluo->batch + ); + // Add stock + $result2=$product->correct_stock_batch( + $user, + GETPOST("id_entrepot_destination",'int'), + GETPOST("nbpiece",'int'), + 0, + GETPOST("label",'san_alpha'), + $pricedest, + $pdluo->eatby,$pdluo->sellby,$pdluo->batch + ); + } + } + else + { + // Remove stock + $result1=$product->correct_stock( + $user, + GETPOST("id_entrepot_source"), + GETPOST("nbpiece"), + 1, + GETPOST("label"), + $pricesrc + ); + + // Add stock + $result2=$product->correct_stock( + $user, + GETPOST("id_entrepot_destination"), + GETPOST("nbpiece"), + 0, + GETPOST("label"), + $pricedest + ); + } if ($result1 >= 0 && $result2 >= 0) { $db->commit(); @@ -240,6 +274,7 @@ if ($action == "transfert_stock" && ! $cancel) } + /* * View */ @@ -309,13 +344,50 @@ if ($id > 0 || $ref) print ''.price($product->pmp).' '.$langs->trans("HT").''; print ''; - // Sell price - print ''.$langs->trans("SellPriceMin").''; - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print price($product->price).' '.$langs->trans("HT"); - else print $langs->trans("Variable"); - print ''; - print ''; + // Minimum Price + print ''.$langs->trans("BuyingPriceMin").''; + print ''; + $product_fourn = new ProductFournisseur($db); + if ($product_fourn->find_min_price_product_fournisseur($product->id) > 0) + { + if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); + else print $langs->trans("NotDefined"); + } + print ''; + + $object = $product; + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + // Price + print '' . $langs->trans("SellingPrice") . ''; + if ($object->price_base_type == 'TTC') { + print price($object->price_ttc) . ' ' . $langs->trans($object->price_base_type); + } else { + print price($object->price) . ' ' . $langs->trans($object->price_base_type); + } + print ''; + + // Price minimum + print '' . $langs->trans("MinPrice") . ''; + if ($object->price_base_type == 'TTC') { + print price($object->price_min_ttc) . ' ' . $langs->trans($object->price_base_type); + } else { + print price($object->price_min) . ' ' . $langs->trans($object->price_base_type); + } + print ''; + } + else + { + // Price + print '' . $langs->trans("SellingPrice") . ''; + print $langs->trans("Variable"); + print ''; + + // Price minimum + print '' . $langs->trans("MinPrice") . ''; + print $langs->trans("Variable"); + print ''; + } // Stock print ''.$form->editfieldkey("StockLimit",'stocklimit',$product->seuil_stock_alerte,$product,$user->rights->produit->creer).''; diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index 1ffd1ad0e3c..c81b1ac8e1f 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -27446,4 +27446,374 @@ -]]> \ No newline at end of file +]]>http://localhostalias/dolibarr_3.7/webservices/server_order.php?wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WS to get a particular invoice + + + + + WS to get all orders of a third party + + + + + WS to create an order + + + + + WS to update an order + + + + + WS to valid an order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]>http://schemas.xmlsoap.org/wsdl/http://localhostalias/dolibarr_3.6/webservices/server_order.phphttp://localhostalias/dolibarr_3.7/webservices/server_order.php<xml-fragment/>UTF-8http://localhostalias/dolibarr_3.7/webservices/server_order.php + + + + + + dolibarrkey + aaa + admin + admin + + + + + + 123ext + ? + 1 + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + + +]]>UTF-8http://localhostalias/dolibarr_3.7/webservices/server_order.php + + + + + + ? + ? + ? + ? + ? + + ? + ? + ? + + +]]>UTF-8http://localhostalias/dolibarr_3.7/webservices/server_order.php + + + + + + ? + ? + ? + ? + ? + + ? + + +]]>UTF-8http://localhostalias/dolibarr_3.7/webservices/server_order.php + + + + + + ? + ? + ? + ? + ? + + ? + + +]]><xml-fragment/>UTF-8http://localhostalias/dolibarr_3.7/webservices/server_order.php + + + + + + dolibarrkey + + admin + admin + + + + + 6 +0 + 2 + ? + ? + ? + ? + ? + ? + ? + ? + + + +]]> \ No newline at end of file