Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git …
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
eldy committed Dec 19, 2011
2 parents 005b919 + 5f02432 commit 6498742
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion htdocs/expedition/class/expedition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ function valid($user)
// If stock increment is done on sending (recommanded choice)
if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT)
{
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");

$langs->load("agenda");

Expand Down
33 changes: 18 additions & 15 deletions htdocs/product/stock/class/mouvementstock.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,28 @@ function MouvementStock($DB)
}

/**
* Add a movement of stock (in one direction only)
* @param user User object
* @param fk_product Id of product
* @param entrepot_id Id of warehouse
* @param qty Qty of movement (can be <0 or >0)
* @param type Direction of movement:
* 0=input (stock increase after stock transfert), 1=output (stock decrease after stock transfer),
* 2=output (stock decrease), 3=input (stock increase)
* @param price Unit price HT of product
* @param label Label of stock movement
* @return int <0 if KO, >0 if OK
* Add a movement of stock (in one direction only)
*
* @param User $user User object
* @param int $fk_product Id of product
* @param int $entrepot_id Id of warehouse
* @param int $qty Qty of movement (can be <0 or >0)
* @param int $type Direction of movement:
* 0=input (stock increase after stock transfert), 1=output (stock decrease after stock transfer),
* 2=output (stock decrease), 3=input (stock increase)
* @param int $price Unit price HT of product
* @param string $label Label of stock movement
* @param string $datem Force date of movement
* @return int <0 if KO, >0 if OK
*/
function _create($user, $fk_product, $entrepot_id, $qty, $type, $price=0, $label='')
function _create($user, $fk_product, $entrepot_id, $qty, $type, $price=0, $label='', $datem='')
{
global $conf, $langs;

$error = 0;
dol_syslog("MouvementStock::_create start userid=$user->id, fk_product=$fk_product, warehouse=$entrepot_id, qty=$qty, type=$type, price=$price label=$label");

$now=dol_now();
$now=(! empty($datem) ? $datem : dol_now());

$this->db->begin();

Expand Down Expand Up @@ -305,11 +307,12 @@ function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price=
* @param int $qty Quantity
* @param int $price Price
* @param string $label Label of stock movement
* @param string $datem Force date of movement
* @return int <0 if KO, >0 if OK
*/
function livraison($user, $fk_product, $entrepot_id, $qty, $price=0, $label='')
function livraison($user, $fk_product, $entrepot_id, $qty, $price=0, $label='', $datem='')
{
return $this->_create($user, $fk_product, $entrepot_id, (0 - $qty), 2, $price, $label);
return $this->_create($user, $fk_product, $entrepot_id, (0 - $qty), 2, $price, $label, $datem);
}


Expand Down

0 comments on commit 6498742

Please sign in to comment.