2
0
forked from Wavyzz/dolibarr

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

Conflicts:
	htdocs/expedition/class/expedition.class.php
	htdocs/install/mysql/migration/3.6.0-3.7.0.sql
	htdocs/langs/en_US/stocks.lang
This commit is contained in:
Laurent Destailleur
2015-02-16 20:59:04 +01:00
10 changed files with 39 additions and 21 deletions

View File

@@ -108,6 +108,8 @@ For users:
- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export. - New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export.
- New : Option on extrafields to have them always editable regardless of the document status. - New : Option on extrafields to have them always editable regardless of the document status.
- New : New module PrintIPP to print without opening document is available as stable. - New : New module PrintIPP to print without opening document is available as stable.
- New : Introduce hidden option STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS to solve at no risk
a missing control on missing warehouse.
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem

View File

@@ -114,7 +114,7 @@ class modMyModule extends DolibarrModules
// Array to add new pages in new tabs // Array to add new pages in new tabs
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2 // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
// where objecttype can be // where objecttype can be
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)

View File

@@ -67,7 +67,7 @@ class Canvas
$newaction = $action; $newaction = $action;
if ($newaction == 'add') $newaction='create'; if ($newaction == 'add') $newaction='create';
if ($newaction == 'update') $newaction='edit'; if ($newaction == 'update') $newaction='edit';
if (empty($newaction) || $newaction == 'delete' || $newaction == 'create_user') $newaction='view'; if (empty($newaction) || $newaction == 'delete' || $newaction == 'create_user' || $newaction == 'presend' || $newaction == 'send') $newaction='view';
return $newaction; return $newaction;
} }

View File

@@ -748,10 +748,12 @@ class Expedition extends CommonObject
} }
/** /**
* Add a expedition line * Add a expedition line.
* If STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS is set, you can add a shipment line, with no stock source defined
* If STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT is not set, you can add a shipment line, even if not enough into stock
* *
* @param int $entrepot_id Id of warehouse * @param int $entrepot_id Id of warehouse
* @param int $id Id of source line * @param int $id Id of source line (order line)
* @param int $qty Quantity * @param int $qty Quantity
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@@ -766,13 +768,19 @@ class Expedition extends CommonObject
$line->origin_line_id = $id; $line->origin_line_id = $id;
$line->qty = $qty; $line->qty = $qty;
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT)
{
$orderline = new OrderLine($this->db); $orderline = new OrderLine($this->db);
$orderline->fetch($id); $orderline->fetch($id);
$fk_product = $orderline->fk_product; $fk_product = $orderline->fk_product;
if (! empty($orderline->fk_product)) if (! empty($orderline->fk_product))
{
if (! ($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS))
{
$this->error=$langs->trans("ErrorWarehouseRequiredIntoShipmentLine");
return -1;
}
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) // FIXME Check is done for stock of product, it must be done for stock of product into warehouse if $entrepot_id defined
{ {
$product=new Product($this->db); $product=new Product($this->db);
$result=$product->fetch($fk_product); $result=$product->fetch($fk_product);
@@ -816,6 +824,12 @@ class Expedition extends CommonObject
} }
$linebatch->dluo_qty=$value['q']; $linebatch->dluo_qty=$value['q'];
$tab[]=$linebatch; $tab[]=$linebatch;
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT)
{
// TODO
}
} }
} }
$line->entrepot_id = $linebatch->entrepot_id; $line->entrepot_id = $linebatch->entrepot_id;

View File

@@ -1156,4 +1156,5 @@ ALTER TABLE llx_resource MODIFY COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid);
-- this update change the old formated url on llx_bank_url -- this update change the old formated url on llx_bank_url
UPDATE llx_bank_url set url = replace( url, 'fiche.php', 'card.php'); UPDATE llx_bank_url set url = REPLACE( url, 'fiche.php', 'card.php');

View File

@@ -193,9 +193,9 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
// Test database version is not forbidden for migration // Test database version is not forbidden for migration
$dbversion_disallowed=array( $dbversion_disallowed=array(
array('type'=>'mysql','version'=>array(5,5,40)), array('type'=>'mysql','version'=>array(5,5,40)),
array('type'=>'mysqli','version'=>array(5,5,40)), array('type'=>'mysqli','version'=>array(5,5,40))
array('type'=>'mysql','version'=>array(5,5,41)), //,array('type'=>'mysql','version'=>array(5,5,41)),
array('type'=>'mysqli','version'=>array(5,5,41)) //array('type'=>'mysqli','version'=>array(5,5,41))
); );
$listofforbiddenversion=''; $listofforbiddenversion='';
foreach ($dbversion_disallowed as $dbversion_totest) foreach ($dbversion_disallowed as $dbversion_totest)

View File

@@ -23,7 +23,7 @@ QtyOrdered=Qty ordered
QtyShipped=Qty shipped QtyShipped=Qty shipped
QtyToShip=Qty to ship QtyToShip=Qty to ship
QtyReceived=Qty received QtyReceived=Qty received
KeepToShip=Keep to ship KeepToShip=Remain to ship
OtherSendingsForSameOrder=Other shipments for this order OtherSendingsForSameOrder=Other shipments for this order
DateSending=Date sending order DateSending=Date sending order
DateSendingShort=Date sending order DateSendingShort=Date sending order

View File

@@ -130,3 +130,4 @@ IsInPackage=Contained into package
ShowWarehouse=Show warehouse ShowWarehouse=Show warehouse
MovementCorrectStock=Stock content correction for product %s MovementCorrectStock=Stock content correction for product %s
MovementTransferStock=Stock transfer of product %s into another warehouse MovementTransferStock=Stock transfer of product %s into another warehouse
WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn=Source warehouse must be defined here when batch module is on. It will be used to list wich lot/serial is available for product that required lot/serial data for movement. If you want to send products from different warehouses, just make the shipment into several steps.

View File

@@ -43,8 +43,8 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortfield) $sortfield="p.titre"; if (! $sortfield) $sortfield="p.date_fin";
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="DESC";
if ($page < 0) { if ($page < 0) {
$page = 0; $page = 0;
} }