Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d255e3b77b
@ -505,7 +505,7 @@ elseif ($modecompta=="BOOKKEEPING")
|
||||
$resultNP = $totPerAccount[$cpt['account_number']]['NP'];
|
||||
$resultN = $totPerAccount[$cpt['account_number']]['N'];
|
||||
|
||||
if ($showaccountdetail == 'all' || $resultN > 0) {
|
||||
if ($showaccountdetail == 'all' || $resultN != 0) {
|
||||
print '<tr>';
|
||||
print '<td></td>';
|
||||
print '<td class="tdoverflowmax200">';
|
||||
|
||||
@ -392,10 +392,24 @@ if ($action == "updateprice")
|
||||
{
|
||||
foreach ($invoice->lines as $line)
|
||||
{
|
||||
if ($line->id == $idline) { $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if ($line->id == $idline)
|
||||
{
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($line->fk_product);
|
||||
$customer = new Societe($db);
|
||||
$customer->fetch($invoice->socid);
|
||||
$datapriceofproduct = $prod->getSellPrice($mysoc, $customer, 0);
|
||||
$price_min = $datapriceofproduct['price_min'];
|
||||
$usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS));
|
||||
$pu_ht = price2num($number / (1 + ($line->tva_tx / 100)), 'MU');
|
||||
//Check min price
|
||||
if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($line->remise_percent) / 100) < price2num($price_min))))
|
||||
{
|
||||
echo $langs->trans("CantBeLessThanMinPrice");
|
||||
}
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
|
||||
$invoice->fetch($placeid);
|
||||
}
|
||||
|
||||
@ -403,11 +417,25 @@ if ($action == "updatereduction")
|
||||
{
|
||||
foreach ($invoice->lines as $line)
|
||||
{
|
||||
if ($line->id == $idline) { $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
if ($line->id == $idline)
|
||||
{
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($line->fk_product);
|
||||
$customer = new Societe($db);
|
||||
$customer->fetch($invoice->socid);
|
||||
$datapriceofproduct = $prod->getSellPrice($mysoc, $customer, 0);
|
||||
$price_min = $datapriceofproduct['price_min'];
|
||||
$usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS));
|
||||
$pu_ht = price2num($line->multicurrency_subprice / (1 + ($line->tva_tx / 100)), 'MU');
|
||||
//Check min price
|
||||
if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->multicurrency_subprice) * (1 - price2num($number) / 100) < price2num($price_min))))
|
||||
{
|
||||
echo $langs->trans("CantBeLessThanMinPrice");
|
||||
}
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
|
||||
$invoice->fetch($placeid);
|
||||
$invoice->fetch($placeid);
|
||||
}
|
||||
|
||||
if ($action == "order" and $placeid != 0)
|
||||
|
||||
@ -440,7 +440,7 @@ function New() {
|
||||
|
||||
function Search2() {
|
||||
console.log("Search2 Call ajax search to replace products");
|
||||
if(window.event.keyCode == 13) ClickProduct(0);
|
||||
if(window.event.keyCode == 13) var key=13;
|
||||
pageproducts=0;
|
||||
jQuery(".wrapper2 .catwatermark").hide();
|
||||
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term='+$('#search').val(), function(data) {
|
||||
@ -459,7 +459,9 @@ function Search2() {
|
||||
$("#prodiv"+i).data("rowid", data[i]['rowid']);
|
||||
$("#prodiv"+i).data("iscat", 0);
|
||||
}
|
||||
});
|
||||
}).always(function() {
|
||||
if(key==13) ClickProduct(0);
|
||||
});
|
||||
}
|
||||
|
||||
function Edit(number) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user