Skip to content

Commit

Permalink
Merge branch '18.0' of [email protected]:Dolibarr/dolibarr.git into 19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 24, 2024
2 parents 399d778 + 0e62008 commit 0ed4c9f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
16 changes: 14 additions & 2 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}

if (empty($reshook)) {
$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';

Expand Down Expand Up @@ -1622,7 +1621,20 @@
$result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int'));
} elseif ($action == 'setconditions' && $usercancreate) {
// Terms of payment
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
$sql = "SELECT code ";
$sql .= "FROM " . $db->prefix() . "c_payment_term";
$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
$result = $db->query($sql);
if ($result) {
$obj = $db->fetch_object($result);
if ($obj->code == 'DEP30PCTDEL') {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
} else {
$object->deposit_percent = 0;
$object->update($user);
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), $object->deposit_percent);
}
}
//} elseif ($action == 'setremisepercent' && $usercancreate) {
// $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
//} elseif ($action == 'setremiseabsolue' && $usercancreate) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,7 @@
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
}

if ($reliquat > $generic_product->stock_reel) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list_det.php
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,7 @@
$productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$obj->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'];
}

if ($reliquat > $generic_product->stock_reel) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/migration/repair.sql
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ drop table tmp_societe_double;
-- Sequence to removed duplicated values of llx_accounting_account. Run several times if you still have duplicate.
drop table tmp_accounting_account_double;
--select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2;
create table tmp_accounting_account_double as (select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2);
create table tmp_accounting_account_double as (select account_number, fk_pcg_version, entity, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version, entity having count(rowid) >= 2);
--select * from tmp_accounting_account_double;
delete from llx_accounting_account where (rowid) in (select max_rowid from tmp_accounting_account_double); --update to avoid duplicate, delete to delete
drop table tmp_accounting_account_double;
Expand Down
5 changes: 5 additions & 0 deletions htdocs/reception/class/reception.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,11 @@ public function delete(User $user)
$mouvS->origin = null;

$result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed
if ($result < 0) {
$error++;
$this->error = $mouvS->error;
$this->errors = $mouvS->errors;
}
}
} else {
$error++;
Expand Down

0 comments on commit 0ed4c9f

Please sign in to comment.