|
|
@ -325,12 +325,9 @@ foreach ($res as $data) { |
|
|
|
xhr.onreadystatechange = function() { |
|
|
|
if (this.readyState == 4 && this.status == 200) { |
|
|
|
data = JSON.parse(this.responseText); |
|
|
|
console.log('123'); |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
//console.log(data);return false; |
|
|
|
if (data.st == 'err') { |
|
|
|
console.log('123'); |
|
|
|
|
|
|
|
//alert(data.err); |
|
|
|
return false; |
|
|
|
} |
|
|
@ -346,8 +343,6 @@ foreach ($res as $data) { |
|
|
|
let a = data.content[k][0] + data.content[k][19][1]; |
|
|
|
$("#tb1").find("input[name=mi_fix]").eq(k).val(commafy(a)); |
|
|
|
} |
|
|
|
console.log('123'); |
|
|
|
|
|
|
|
let a = data.content[k][0] + data.content[k][19][1]; |
|
|
|
$("#tb1").find("input[name=mi_fix]").eq(k).val(commafy(a)); |
|
|
|
var mihtml = ""; |
|
|
@ -368,7 +363,7 @@ foreach ($res as $data) { |
|
|
|
console.log(data.content[k][12]); |
|
|
|
Object.keys(data.content[k][14]).forEach(function(m) { |
|
|
|
if (data.content[k][14][m][0] != '') { |
|
|
|
mihtml += "<li>" + data.content[k][14][m][0] + ":" + commafy(data.content[k][14][m][1]) + "</li>"; |
|
|
|
mihtml += "<li>" + data.content[k][14][m][0].replace("<br>", "").replace("&", "").replace("amp;", "").replace("()", "").replace(/\s+/g, '') + ":" + commafy(data.content[k][14][m][1]) + "</li>"; |
|
|
|
} |
|
|
|
}); |
|
|
|
Object.keys(data.content[k][16]).forEach(function(m) { |
|
|
@ -382,9 +377,16 @@ foreach ($res as $data) { |
|
|
|
mihtml += "<li>" + data.content[k][19][0] + ":" + commafy(data.content[k][19][1]) + "</li>"; |
|
|
|
mihtml += "以上合計:" + commafy(data.content[k][13]) + |
|
|
|
"<br>"; |
|
|
|
total_mi += data.content[k][13]; |
|
|
|
|
|
|
|
|
|
|
|
if(total_mi == ""){ |
|
|
|
console.log("undefided!!!"); |
|
|
|
} |
|
|
|
$("#tb1").find("tr[name=facil_templ2]").eq(k).find('td').eq(1).html(mihtml); |
|
|
|
//$("#tb1").find("input[name=mi_fix]").eq(k).closest('td').append(mihtml); |
|
|
|
document.getElementsByClassName('total_mi_fix')[k].value = commafy(total_mi) |
|
|
|
|
|
|
|
// document.getElementsByClassName('item_price_ct')[k].value =commafy(total_mi) |
|
|
|
document.getElementsByClassName('gross_profit')[k].value = commafy(Number(document.getElementsByClassName('item_price_ct')[k].value.replace(/[,]+/g, "")) - total_mi) |
|
|
|
document.getElementsByClassName('gross_profit_rate')[k].value = Math.round((Number(document.getElementsByClassName('gross_profit')[k].value.replace(/[,]+/g, "")) / Number(document.getElementsByClassName('item_price_ct')[k].value.replace(/[,]+/g, "")) * 100) * 10) / 10 |
|
|
@ -587,8 +589,8 @@ foreach ($res as $data) { |
|
|
|
<td><input type="text" name="item_unit_price" class="form-control dollar-right" size="8" value="<?= number_format($val["item_unit_price"]); ?>"></td> |
|
|
|
<td><input type="text" name="item_qty" class="form-control" size="2" value="1"></td> |
|
|
|
<td><input type="text" name="item_price_bp" class="form-control dollar-right" size="9" value="<?= number_format($val["item_unit_price"]); ?>"></td> |
|
|
|
<td><input type="text" name="mi_fix" class="form-control dollar-right" size="9" value="<?php echo ($val["mi_fix"]) ? number_format($val["mi_fix"]) : ""; ?>" disabled></td> |
|
|
|
<td><input type="text" name="item_price_ct" class="form-control dollar-right" size="9" value="<?= number_format($val["item_price_ct"] / $val["item_qty"]); ?>"></td> |
|
|
|
<td><input type="text" name="mi_fix" class="form-control dollar-right total_mi_fix" size="9" value="<?php echo ($val["mi_fix"]) ? number_format($val["mi_fix"]) : ""; ?>" disabled></td> |
|
|
|
<td><input type="text" name="item_price_ct" class="form-control dollar-right item_price_ct" size="9" value="<?= number_format($val["item_price_ct"] / $val["item_qty"]); ?>"></td> |
|
|
|
<!--<td><input type="text" name="item_price" class="form-control dollar-right" size="8" value="<?php echo ($val["item_price"]) ? number_format($val["item_price"]) : ""; ?>"></td>
|
|
|
|
<td><input type="text" name="pv_rate" class="form-control" size="1" value="<?= $val["pv_rate"]; ?>"></td> |
|
|
|
<td><input type="text" name="allocate" class="form-control" size="6" value="<?= $val["allocate"]; ?>"></td>--> |
|
|
|