Skip to content

Commit

Permalink
Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry committed Nov 6, 2015
2 parents 8d829dc + fe78996 commit 600dbce
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
28 changes: 27 additions & 1 deletion htdocs/comm/action/card.php
Expand Up @@ -88,7 +88,7 @@
/*
* Actions
*/

$listUserAssignedUpdated = false;
// Remove user to assigned list
if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
{
Expand All @@ -106,6 +106,8 @@
$donotclearsession=1;
if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit';

$listUserAssignedUpdated = true;
}

// Add user to assigned list
Expand All @@ -125,6 +127,8 @@
$donotclearsession=1;
if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit';

$listUserAssignedUpdated = true;
}

// Add event
Expand Down Expand Up @@ -803,6 +807,28 @@ function setdatefields()
$result4=$object->fetch_userassigned();
$result5=$object->fetch_optionals($id,$extralabels);

if($listUserAssignedUpdated || $donotclearsession) {

$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);

$object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->priority = GETPOST("priority");
$object->fulldayevent= GETPOST("fullday")?1:0;
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->contactid = GETPOST("contactid",'int');
//$object->societe->id = $_POST["socid"]; // deprecated
//$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = GETPOST("projectid",'int');

$object->note = GETPOST("note");
}

if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
{
dol_print_error($db,$object->error);
Expand Down
5 changes: 3 additions & 2 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -393,7 +393,7 @@ function set_draft($user, $idwarehouse=-1)
{
$mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
if ($result < 0) { $error++; }
}
}
Expand Down Expand Up @@ -576,7 +576,7 @@ function cancel($idwarehouse=-1)
{
$mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderCanceledInDolibarr",$this->ref)); // price is 0, we don't want WAP to be changed
if ($result < 0)
{
$error++;
Expand Down Expand Up @@ -920,6 +920,7 @@ function createFromClone($socid=0)
// Clear fields
$this->user_author_id = $user->id;
$this->user_valid = '';
$this->date = dol_now();
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -1761,7 +1761,7 @@ function validate($user, $force_number='', $idwarehouse=0, $notrigger=0)
$mouvP = new MouvementStock($this->db);
$mouvP->origin = &$this;
// We decrease stock for product
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr",$num));
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($result < 0) {
$error++;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/objectline_create.tpl.php
Expand Up @@ -451,7 +451,7 @@ function price2numjs(num)
<?php if (! empty($usemargins) && $user->rights->margins->creer) { ?>

/* Code for margin */
$("#fournprice_predef options").remove();
$("#fournprice_predef").find("option").remove();
$("#fournprice_predef").hide();
$("#buying_price").val("").show();
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', { 'idprod': $(this).val() }, function(data) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expedition/class/expedition.class.php
Expand Up @@ -980,7 +980,7 @@ function delete()
$mouvS->origin = &$this;
// We decrement stock of product (and sub-products)
// We use warehouse selected for each line
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
if ($result < 0)
{
$error++;
Expand Down
3 changes: 2 additions & 1 deletion htdocs/product/stock/product.php
Expand Up @@ -682,9 +682,10 @@ function init_price()
print '</tr>';
}

$sql = "SELECT e.rowid, e.label, ps.reel, ps.pmp, ps.rowid as product_stock_id";
$sql = "SELECT e.rowid, e.label, ps.reel, p.pmp, ps.rowid as product_stock_id";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
$sql.= " WHERE ps.reel != 0";
$sql.= " AND ps.fk_entrepot = e.rowid";
$sql.= " AND e.entity IN (".getEntity('stock',1).')';
Expand Down

0 comments on commit 600dbce

Please sign in to comment.