FSN#24836 MLD: opdrachtmaterialen: decimale aantallen en sortering

svn path=/Website/trunk/; revision=15947
This commit is contained in:
Erik Groener
2012-11-14 11:32:57 +00:00
parent 43904406e4
commit 1f47f063fb
4 changed files with 16 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ sql = "SELECT ud.fac_usrdata_key"
+ " WHERE ud.fac_usrtab_key = " + S("mld_ordermaterial_fac_usrtab_key")
+ " AND ud.fac_usrdata_key " + (filter == "P"? "NOT" : "") + " IN (" + matkeystr.join(",") + ")"
+ " AND ud.fac_usrdata_verwijder IS NULL"
+ " ORDER BY UPPER(ud.fac_usrdata_omschr)";
+ " ORDER BY ud.fac_usrdata_volgnr, UPPER(ud.fac_usrdata_omschr)";
FCLTselectorOptions(sql,
{ multi: true,

View File

@@ -290,7 +290,7 @@ function makeMaterialStrings(data)
matexiststr += (matexiststr == ""? "" : ",") + "1";
matopdrkeystr += (matopdrkeystr == ""? "" : ",") + data.matExistArray[i].matopdrkey;
matkeystr += (matkeystr == ""? "" : ",") + data.matExistArray[i].key;
matamountstr += (matamountstr == ""? "" : ",") + data.matExistArray[i].amount;
matamountstr += (matamountstr == ""? "" : ",") + String(data.matExistArray[i].amount).replace(",",".");
matpricestr += (matpricestr == ""? "" : ",") + String(data.matExistArray[i].price).replace(",",".");
matdescriptarr.push("");
}
@@ -305,7 +305,7 @@ function makeMaterialStrings(data)
matexiststr += (matexiststr == ""? "" : ",") + "0";
matopdrkeystr += (matopdrkeystr == ""? "" : ",") + data.matUserArray[i].matopdrkey;
matkeystr += (matkeystr == ""? "" : ",") + "-1";
matamountstr += (matamountstr == ""? "" : ",") + data.matUserArray[i].amount;
matamountstr += (matamountstr == ""? "" : ",") + String(data.matUserArray[i].amount).replace(",",".");
matpricestr += (matpricestr == ""? "" : ",") + String(data.matUserArray[i].price).replace(",",".");
matdescriptarr.push(data.matUserArray[i].descript);
}

View File

@@ -344,7 +344,7 @@ for (var u = 0; u < uitvkeyArray.length; u++)
{
var ddmin = new Date(oRs("ddmin").value);
var ddmax = new Date(oRs("ddmax").value);
// Vallen de geschreven uren (ddmin...ddmax) BINNEN DE WEEK van de looptijd?
// Daarom ddfrom (begindatum) naar begin van de week (maandag) en ddto (einddatum) naar eind van de week (zondag) verschuiven.
var ddfrom_day = new Date(ddfrom).getDay();
@@ -389,7 +389,7 @@ for (var u = 0; u < uitvkeyArray.length; u++)
var matexiststrArr = getFParamIntArray("matexiststr", []);
var matopdrkeystrArr = getFParamIntArray("matopdrkeystr", []);
var matkeystrArr = getFParamIntArray("matkeystr", []);
var matamountstrArr = getFParamIntArray("matamountstr", []);
var matamountstrArr = getFParamArray("matamountstr", []);
var matpricestrArr = getFParamArray("matpricestr", []);
var matdescriptstrArr = getFParamArray("matdescriptstr", [], true); // nosplit
if (!isNew)

View File

@@ -90,7 +90,9 @@ function isGoodCurrency(str, digits)
function checkInput(str, field, typeNC)
{
if (str != "" && ((typeNC == "C" && !isGoodCurrency(str.replace(',', '.'))) || (typeNC == "N" && !isGoodNumber(str,true,true,4,-1))))
if (str != "" && ( (typeNC == "C" && !isGoodCurrency(str.replace(',', '.')))
|| (typeNC == "N" && !isGoodNumber(str.replace(',', '.'),false,true,8,2))
))
{
alert(L("lcl_shared_invalid_format"));
field.select();
@@ -102,12 +104,12 @@ function checkInput(str, field, typeNC)
function onChangeAmount(key)
{
var amount = parseInt($("#amount" + key).val(), 10) || 0;
var price = $("#price" + key).val().replace(',', '.') || 0;
var amount = $("#amount" + key).val().replace(',', '.') || 0;
var price = $("#price" + key).val().replace(',', '.') || 0;
if (!checkInput(amount, $("#amount" + key), "N")) return;
// show the total price of the selected artikel
$("#amount" + key).val(amount);
$("#amount" + key).val(parseFloat(amount));
if (!$("#price" + key).attr("readonly"))
$("#price" + key).val(num2currEditable(parseFloat(price)));
$("#total" + key).val(num2currEditable(amount * parseFloat(price)));
@@ -175,9 +177,9 @@ function makeMaterialHtml(matExistArray)
+ "<td></td>"
+ "<td>"
+ "<input class='fldmatamount number' type='text' name='amount" + matExistArray[i].key + "'"
+ " id='amount" + matExistArray[i].key + "' value='" + matExistArray[i].amount + "'"
+ " index='" + i + "' maxlength='6' onChange='onChangeAmount(" + matExistArray[i].key + ");'"
+ " size='6' onKeyPress='checkKey(event, 0);'>&nbsp;"
+ " id='amount" + matExistArray[i].key + "' value='" + parseFloat(matExistArray[i].amount) + "'"
+ " index='" + i + "' maxlength='8' onChange='onChangeAmount(" + matExistArray[i].key + ");'"
+ " size='8' onKeyPress='checkKey(event, 1);'>&nbsp;"
+ "</td>"
+ "<td>"
+ "<input class='fldmatprice currency' type='text' name='price" + matExistArray[i].key + "'"
@@ -342,7 +344,7 @@ function CreateRow(qty, prc, descr, key)
cell.innerHTML = "<input type='text' class='fldfinsom'"
+ " onfocus='this.select();'"
+ " onblur='QtyChanged(event);'"
+ " id='qty" + rowIndex + "' name='qty" + rowIndex + "' maxlength='10' value='" + parseInt(qty) + "'>&nbsp;";
+ " id='qty" + rowIndex + "' name='qty" + rowIndex + "' maxlength='10' value='" + parseFloat(qty) + "'>&nbsp;";
cell.align = 'right';
// Create price field
@@ -380,7 +382,7 @@ function QtyChanged(evt)
if (obj.value == '')
obj.value = qty = defaultamount;
if (obj.value == '' || isNaN(qty > 0? qty : -qty) ||
!isGoodNumber(obj.value,true,true,6,-1))
!isGoodNumber(obj.value,false,true,8,2))
{
alert(L("lcl_mld_opdr_invalid_quantity"));
obj.focus();