Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-11-06 23:07:07 +01:00
commit b3fb15652d
5 changed files with 21 additions and 8 deletions

View File

@ -789,6 +789,7 @@ if ($action == 'create') {
print $langs->trans("CorrectStock"); print $langs->trans("CorrectStock");
print "</a></td>"; print "</a></td>";
} }
if (!empty($conf->global->PRODUCT_USE_UNITS)) { if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if ($i == 0) { if ($i == 0) {
$units = $productstatic->fk_unit; $units = $productstatic->fk_unit;
@ -796,11 +797,13 @@ if ($action == 'create') {
$sameunits = false; $sameunits = false;
} }
} }
print "</tr>"; print "</tr>";
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
// Total
print '<tr class="liste_total"><td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>';
print '<td class="liste_total right">'; print '<td class="liste_total right">';
$valtoshow = price2num($totalunit, 'MS'); $valtoshow = price2num($totalunit, 'MS');
@ -818,9 +821,15 @@ if ($action == 'create') {
print '<td class="liste_total">&nbsp;</td>'; print '<td class="liste_total">&nbsp;</td>';
print '<td class="liste_total right">'.price(price2num($totalvaluesell, 'MT')).'</td>'; print '<td class="liste_total right">'.price(price2num($totalvaluesell, 'MT')).'</td>';
} }
print '<td class="liste_total">&nbsp;</td>';
print '<td class="liste_total">&nbsp;</td>'; if ($user->rights->stock->mouvement->creer) {
print '<td class="liste_total">&nbsp;</td>'; print '<td class="liste_total">&nbsp;</td>';
}
if ($user->rights->stock->creer) {
print '<td class="liste_total">&nbsp;</td>';
}
print '</tr>'; print '</tr>';
} else { } else {
dol_print_error($db); dol_print_error($db);

View File

@ -358,6 +358,7 @@ if (empty($reshook)) {
$batch = "batch".$i; $batch = "batch".$i;
$cost_price = "cost_price".$i; $cost_price = "cost_price".$i;
//if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS')) || (GETPOST($qty, 'int') < 0 && getDolGlobalString('RECEPTION_ALLOW_NEGATIVE_QTY'))) {
if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) {
$ent = "entl".$i; $ent = "entl".$i;

View File

@ -571,7 +571,7 @@ class Reception extends CommonObject
$qty = $obj->qty; $qty = $obj->qty;
if ($qty <= 0) { if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) {
continue; continue;
} }
dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);

View File

@ -583,8 +583,9 @@ function New() {
/** /**
* Search products * Search products
* *
* @param {int} keyCodeForEnter Key code for "enter" * @param string keyCodeForEnter Key code for "enter" or '' if not
* return {void} * @param int moreorless ??
* return void
*/ */
function Search2(keyCodeForEnter, moreorless) { function Search2(keyCodeForEnter, moreorless) {
var eventKeyCode = window.event.keyCode; var eventKeyCode = window.event.keyCode;
@ -599,6 +600,8 @@ function Search2(keyCodeForEnter, moreorless) {
search_start = $('#search_start_'+moreorless).val(); search_start = $('#search_start_'+moreorless).val();
} }
console.log("search_term="+search_term);
if (search_term == '') { if (search_term == '') {
$("[id^=prowatermark]").html(""); $("[id^=prowatermark]").html("");
$("[id^=prodesc]").text(""); $("[id^=prodesc]").text("");
@ -612,7 +615,7 @@ function Search2(keyCodeForEnter, moreorless) {
} }
var search = false; var search = false;
if (keyCodeForEnter != '' || eventKeyCode == keyCodeForEnter) { if (keyCodeForEnter == '' || eventKeyCode == keyCodeForEnter) {
search = true; search = true;
} }

View File

@ -1688,7 +1688,7 @@ if (($action == "valid" || $action == "history") && $invoice->type != Facture::T
if ($action == "search") { if ($action == "search") {
print '<center> print '<center>
<input type="text" id="search" class="input-search-takepos" name="search" onkeyup="Search2();" style="width: 80%; font-size: 150%;" placeholder="'.dol_escape_htmltag($langs->trans('Search')).'"> <input type="text" id="search" class="input-search-takepos" name="search" onkeyup="Search2(\'\', null);" style="width: 80%; font-size: 150%;" placeholder="'.dol_escape_htmltag($langs->trans('Search')).'">
</center>'; </center>';
} }