From 6d1eb4d1d542637ef71d29971e14c059c16bb92e Mon Sep 17 00:00:00 2001
From: pzy <2829717936@qq.com>
Date: 星期五, 06 九月 2024 16:14:49 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI
---
WebTM/views/采购管理/应付单/Cg_PayableBill.html | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 282 insertions(+), 12 deletions(-)
diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html"
index 0e2ac4c..6fe6045 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\272\224\344\273\230\345\215\225/Cg_PayableBill.html"
@@ -92,7 +92,7 @@
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="float:left;width:150px;">
<input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="float:left;width:150px;">
<input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="float:left;width:150px;">
- <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
+ <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float: left; width: 150px; ">
<button type="button" lay-submit="" class="layui-btn" lay-filter="HMainSource" style="width:40px;">
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
</button>
@@ -574,6 +574,243 @@
get_checkMainSource();
});
//#endregion
+
+ //#region 鍥炶溅閫夋嫨婧愬崟
+ $('#HMainSourceBillNo').on('keydown', function (event) {
+ var HSourceBillNo = $('#HMainSourceBillNo').val();//锛堟簮鍗曞崟鎹彿锛�
+ if (event.keyCode == 13) {
+ var ajaxLoad = layer.load();
+ var url;
+ //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁 new
+ if (HSourceBillNo == "") {
+ return;
+ }
+ if ($("#BillType").val() == "1102") {
+ //婧愬崟绫诲瀷鏄噰璐鍗�
+ url = "/Cg_POOrderBill/PushList";
+ } else if ($("#BillType").val() == "1201") {
+ //婧愬崟绫诲瀷鏄敹鏂欓�氱煡鍗�
+ url = "/Kf_POStockInBill/PushList";
+ }
+ $.ajax({
+ url: GetWEBURL() + url,
+ type: "GET",
+ data: { "HBillNo": HSourceBillNo, "user": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+ var dataArray = result.data;
+ if ($("#BillType").val() == "1102") {
+ form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+ "HMainSourceInterID": "0"
+ , "HMainSourceEntryID": "0"
+ /*, "HMainSourceBillNo": ""*/
+ , "HMainSourceBillType": $("#BillType").val()
+
+ , "HDeptID": dataArray[0].HDeptID
+ , "HDeptName": dataArray[0].閮ㄩ棬
+ , "HMangerID": dataArray[0].HManagerID
+ , "HMangerName": dataArray[0].涓荤
+ , "HEmpID": dataArray[0].HEmpID
+ , "HEmpName": dataArray[0].涓氬姟鍛�
+ , "HSupID": dataArray[0].HSupID
+ , "HSupName": dataArray[0].渚涘簲鍟�
+ , "HCurID": dataArray[0].HCurID
+ , "HCurName": dataArray[0].甯佸埆
+ , "HExRate": dataArray[0].姹囩巼
+ , "HSSID": dataArray[0].HSSID
+ , "HSSName": dataArray[0].缁撶畻鏂瑰紡
+ , "HPSStyleID": dataArray[0].HPSStyleID
+ , "HPSStyleName": dataArray[0].閲囪喘鏂瑰紡
+ });
+
+ //瀛愯〃Entry 璧嬪��
+ var rowdataEntry = [];
+ for (var i = 0; i < dataArray.length; i++) {
+ var HQty = dataArray[i].鏁伴噺 - dataArray[i].鍏宠仈鏁伴噺; //鏁伴噺
+ var HPrice = dataArray[i].鍗曚环; //鍗曚环
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxRate = dataArray[i].绋庣巼 * 0.01; //绋庣巼
+ var HTaxMoney = Number((HMoney * HTaxRate)); //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+ var HExRate = $("#HExRate").val(); //姹囩巼
+ var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
+ rowdataEntry.push(
+ {
+ "HMaterID": dataArray[i].HMaterID
+ , "鐗╂枡浠g爜": dataArray[i].鐗╂枡浠g爜
+ , "鐗╂枡鍚嶇О": dataArray[i].鐗╂枡鍚嶇О
+ , "瑙勬牸鍨嬪彿": dataArray[i].瑙勬牸鍨嬪彿
+ , "HUnitID": dataArray[i].HUnitID
+ , "璁¢噺鍗曚綅": dataArray[i].璁¢噺鍗曚綅
+ , "HQty": dealDoubleToFixed(HQty, 1)
+ , "HPrice": dealDoubleToFixed(dataArray[i].鍗曚环, 3)
+ , "HTaxPrice": dealDoubleToFixed(dataArray[i].鍚◣鍗曚环, 3)
+ , 'HDiscountRate': "0" //
+ , 'HRelTaxPrice': "0"
+ , "HTaxRate": dataArray[i].绋庣巼
+ , 'HTaxMoney': HTaxMoney //
+ , "HMoney": dealDoubleToFixed(HMoney, 2)
+ , 'HMoneyBB': dealDoubleToFixed(HMoneyBB, 2)
+ , 'HlineTotal': dealDoubleToFixed(HlineTotal, 2)
+ , 'HlineTotalBB': dealDoubleToFixed(HlineTotalBB, 2)
+ , "HRemark": ""
+
+ , "HSourceInterID": dataArray[i].hmainid
+ , "HSourceEntryID": dataArray[i].hsubid
+ , "HSourceBillNo": dataArray[i].鍗曟嵁鍙�
+ , "HSourceBillType": dataArray[i].鍗曟嵁绫诲瀷
+ , "HRelationQty": "0"
+ , "HRelationMoney": "0"
+
+ , 'HPOOrderInterID': "0"
+ , 'HPOOrderEntryID': "0"
+ , 'HPOOrderBillNo': ""
+
+ , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].鍚◣鍗曚环, 3)
+ , "HSeOrderInterID": dataArray[i].hmainid
+ , "HSeOrderEntryID": dataArray[i].hsubid
+ , "HSeOrderBillNo": dataArray[i].鍗曟嵁鍙�
+ }
+ );
+ }
+ optionEntry.data = rowdataEntry;
+ table.render(optionEntry);
+ //瀛愯〃姹囨��
+ for (var i = 0; i < rowdataEntry.length; i++) {
+ var item = rowdataEntry[i];
+
+ for (var j = i + 1; j < rowdataEntry.length; j++) {
+ if (rowdataEntry[j].HMaterID == item.HMaterID) {
+ rowdataEntry[i].HQty += rowdataEntry[j].HQty;//鏁伴噺
+ rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//閲戦=鏁伴噺*鍗曚环
+ rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//绋庨
+ rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //浠风◣鍚堣
+ var HExRate = $("#HExRate").val();
+ rowdataEntry[i].HlineTotalBB = Number(((rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney) * HExRate).toFixed(4)) //鏈綅甯佷环绋庡悎璁�
+ rowdataEntry[i].HMoneyBB = Number((rowdataEntry[i].HMoney * HExRate).toFixed(4)) //鏈綅甯侀噾棰�
+ rowdataEntry.splice(j, 1);
+ j = j - 1;
+ }
+ }
+ }
+ set_InitGridHaveSource();
+ option.data = rowdataEntry;
+
+ } else if ($("#BillType").val() == "1201") {
+ form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+ "HMainSourceInterID": "0"
+ , "HMainSourceEntryID": "0"
+ /*, "HMainSourceBillNo": ""*/
+ , "HMainSourceBillType": $("#BillType").val()
+
+ , "HDeptID": dataArray[0].HDeptID
+ , "HDeptName": dataArray[0].閮ㄩ棬
+ , "HMangerID": dataArray[0].hmanagerid == null ? "0" : dataArray[0].hmanagerid
+ , "HMangerName": dataArray[0].涓荤
+ , "HEmpID": dataArray[0].HEmpID
+ , "HEmpName": dataArray[0].涓氬姟鍛�
+ , "HSupID": dataArray[0].HSupID
+ , "HSupName": dataArray[0].渚涘簲鍟�
+ , "HCurID": dataArray[0].HCurID
+ , "HCurName": dataArray[0].甯佸埆
+ , "HExRate": dataArray[0].姹囩巼
+ , "HSSID": "0"
+ , "HSSName": ""
+ , "HPSStyleID": dataArray[0].HPSStyleID
+ , "HPSStyleName": dataArray[0].閲囪喘鏂瑰紡
+ });
+ //瀛愯〃Entry 璧嬪��
+ var rowdataEntry = [];
+ for (var i = 0; i < dataArray.length; i++) {
+ var HQty = dataArray[i].瀹炴敹鏁伴噺 - dataArray[i].鍏宠仈鏁伴噺; //鏁伴噺
+ var HPrice = dataArray[i].鍗曚环; //鍗曚环
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxRate = dataArray[i].绋庣巼 * 0.01; //绋庣巼
+ var HTaxMoney = Number((HMoney * HTaxRate)); //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+ var HExRate = $("#HExRate").val(); //姹囩巼
+ var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
+ rowdataEntry.push(
+ {
+ "HMaterID": dataArray[i].HMaterID
+ , "鐗╂枡浠g爜": dataArray[i].鐗╂枡浠g爜
+ , "鐗╂枡鍚嶇О": dataArray[i].鐗╂枡鍚嶇О
+ , "瑙勬牸鍨嬪彿": dataArray[i].瑙勬牸鍨嬪彿
+ , "HUnitID": dataArray[i].HUnitID
+ , "璁¢噺鍗曚綅": dataArray[i].璁¢噺鍗曚綅
+ , "HQty": dealDoubleToFixed(HQty, 1)
+ , "HPrice": dealDoubleToFixed(dataArray[i].鍗曚环, 3)
+ , "HTaxPrice": dealDoubleToFixed(dataArray[i].鍚◣鍗曚环, 3)
+ , 'HDiscountRate': "0" //
+ , 'HRelTaxPrice': "0"
+ , "HTaxRate": dataArray[i].绋庣巼
+ , 'HTaxMoney': HTaxMoney //
+ , "HMoney": dealDoubleToFixed(HMoney, 2)
+ , 'HMoneyBB': dealDoubleToFixed(HMoneyBB, 2)
+ , 'HlineTotal': dealDoubleToFixed(HlineTotal, 2)
+ , 'HlineTotalBB': dealDoubleToFixed(HlineTotalBB, 2)
+ , "HRemark": ""
+
+ , "HSourceInterID": dataArray[i].hmainid
+ , "HSourceEntryID": dataArray[i].hsubid
+ , "HSourceBillNo": dataArray[i].鍗曟嵁鍙�
+ , "HSourceBillType": dataArray[i].鍗曟嵁绫诲瀷
+ , "HRelationQty": "0"
+ , "HRelationMoney": "0"
+
+ , 'HPOOrderInterID': "0"
+ , 'HPOOrderEntryID': "0"
+ , 'HPOOrderBillNo': ""
+
+ // , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].鍚◣鍗曚环, 3)
+ , "HSeOrderInterID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceInterID : "0"
+ , "HSeOrderEntryID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceEntryID : "0"
+ , "HSeOrderBillNo": dataArray[i].HSourceBillType == "1401" ? dataArray[i].婧愬崟鍗曞彿 : ""
+ }
+ );
+ }
+ optionEntry.data = rowdataEntry;
+ table.render(optionEntry);
+ //瀛愯〃姹囨��
+ for (var i = 0; i < rowdataEntry.length; i++) {
+ var item = rowdataEntry[i];
+ for (var j = i + 1; j < rowdataEntry.length; j++) {
+ if (rowdataEntry[j].HMaterID == item.HMaterID) {
+ rowdataEntry[i].HQty += rowdataEntry[j].HQty;
+ rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//閲戦=鏁伴噺*鍗曚环
+ rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//绋庨
+ rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //浠风◣鍚堣
+ var HExRate = $("#HExRate").val();
+ rowdataEntry[i].HlineTotalBB = Number(((rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney) * HExRate).toFixed(4)) //鏈綅甯佷环绋庡悎璁�
+ rowdataEntry[i].HMoneyBB = Number((rowdataEntry[i].HMoney * HExRate).toFixed(4)) //鏈綅甯侀噾棰�
+ rowdataEntry.splice(j, 1);
+ j = j - 1;
+ }
+ }
+ }
+ set_InitGridHaveSource();
+ option.data = rowdataEntry;
+
+ }
+ haveSource = true;
+ table.render(option);
+ layer.close(ajaxLoad);
+ layer.msg("鏌ヨ鎴愬姛", { time: 1 * 1000, icon: 1 });
+ } else {
+ layer.alert(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+ layer.close(ajaxLoad);
+ }
+ }, error: function () {
+ layer.alert(result.Message + "鍙戠敓閿欒!", { icon: 5 });
+ layer.close(ajaxLoad);
+ }
+ });
+ }
+ });
+ //#endregion
+
//#endregion
@@ -1248,6 +1485,7 @@
var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
var HExRate = $("#HExRate").val(); //姹囩巼
var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
HQty = Number(HQty.toFixed(HQtyDec));
HPrice = Number(HPrice.toFixed(HPriceDec));
@@ -1255,6 +1493,7 @@
HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
HlineTotalBB = Number(HlineTotalBB.toFixed(HMoneyDec));
+ HMoneyBB = Number(HMoneyBB.toFixed(HMoneyDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
HQty: HQty
@@ -1263,6 +1502,7 @@
, HTaxMoney: HTaxMoney
, HlineTotal: HlineTotal
, HlineTotalBB: HlineTotalBB
+ , HMoneyBB: HMoneyBB
});
table.render(option);
break;
@@ -1291,7 +1531,7 @@
var HRelTaxPrice = Number((HTaxPrice * HDiscountRate).toFixed(4)); //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�
var HExRate = $("#HExRate").val(); //姹囩巼
var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate).toFixed(4)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
-
+ var HMoneyBB = HMoney * HExRate;
//鏁板瓧绮惧害
HQty = Number(HQty.toFixed(HQtyDec));
HPrice = Number(HPrice.toFixed(HPriceDec));
@@ -1301,6 +1541,7 @@
HRelTaxPrice = Number(HRelTaxPrice.toFixed(HPriceDec));
HlineTotalBB = Number(HlineTotalBB.toFixed(HMoneyDec));
HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+ HMoneyBB = Number(HMoneyBB.toFixed(HMoneyDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
HQty: HQty
@@ -1311,6 +1552,7 @@
, HTaxPrice, HTaxPrice
, HRelTaxPrice: HRelTaxPrice
, HlineTotalBB: HlineTotalBB
+ , HMoneyBB: HMoneyBB
});
table.render(option);
break;
@@ -1341,6 +1583,7 @@
var HRelTaxPrice = Number((HTaxPrice * HDiscountRate).toFixed(4)); //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�
var HExRate = $("#HExRate").val(); //姹囩巼
var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate).toFixed(4)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
//鏁板瓧绮惧害
HQty = Number(HQty.toFixed(HQtyDec));
HPrice = Number(HPrice.toFixed(HPriceDec));
@@ -1350,6 +1593,7 @@
HRelTaxPrice = Number(HRelTaxPrice.toFixed(HPriceDec));
HlineTotalBB = Number(HlineTotalBB.toFixed(HMoneyDec));
HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+ HMoneyBB = Number(HMoneyBB.toFixed(HMoneyDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
HTaxRate: HTaxRate * 100
@@ -1362,6 +1606,7 @@
, HTaxPrice, HTaxPrice
, HRelTaxPrice: HRelTaxPrice
, HlineTotalBB: HlineTotalBB
+ , HMoneyBB: HMoneyBB
});
table.render(option);
break;
@@ -1409,7 +1654,6 @@
});
table.render(option);
break;
-
case "HTaxPrice": //鍗曚环
//鏁版嵁鏍煎紡鏍¢獙
temp = value + ""; //淇敼鍚庣殑鍊� 杞负瀛楃涓� 璧嬪�肩粰 鍙橀噺temp
@@ -1436,6 +1680,7 @@
var HRelTaxPrice = Number((HTaxPrice * HDiscountRate).toFixed(4)); //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�
var HExRate = $("#HExRate").val(); //姹囩巼
var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate).toFixed(4)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
//鏁板瓧绮惧害
HQty = Number(HQty.toFixed(HQtyDec));
HPrice = Number(HPrice.toFixed(HPriceDec));
@@ -1445,6 +1690,7 @@
HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
HRelTaxPrice = Number(HRelTaxPrice.toFixed(HPriceDec));
HlineTotalBB = Number(HlineTotalBB.toFixed(HMoneyDec));
+ HMoneyBB = Number(HMoneyBB.toFixed(HMoneyDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({ //鏇存柊琛ㄦ牸鏁版嵁 鏂规硶鏄瀵硅薄鎻愪緵鐨勪竴涓柟娉曪紝鐢ㄤ簬鏇存柊鍏跺唴閮ㄧ姸鎬佹垨涓庝箣鍏宠仈鐨勬暟鎹簮
HQty: HQty //鏇存柊HQty瀛楁锛孒Qty
@@ -1455,6 +1701,7 @@
, HTaxPrice, HTaxPrice //鏇存柊HTaxPrice瀛楁锛孒TaxPrice
, HRelTaxPrice: HRelTaxPrice //鏇存柊HRelTaxPrice瀛楁锛屽叾鍊兼潵鑷彉閲廐RelTaxPrice
, HlineTotalBB: HlineTotalBB //鏇存柊HlineTotalBB瀛楁锛屽叾鍊兼潵鑷彉閲廐lineTotalBB
+ , HMoneyBB: HMoneyBB
});
table.render(option);
break;
@@ -2589,6 +2836,15 @@
//瀛愯〃Entry 璧嬪��
var rowdataEntry = [];
for (var i = 0; i < dataArray.length; i++) {
+ var HQty = dataArray[i].鏁伴噺 - dataArray[i].鍏宠仈鏁伴噺; //鏁伴噺
+ var HPrice = dataArray[i].鍗曚环; //鍗曚环
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxRate = dataArray[i].绋庣巼 * 0.01; //绋庣巼
+ var HTaxMoney = Number((HMoney * HTaxRate)); //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+ var HExRate = $("#HExRate").val(); //姹囩巼
+ var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
rowdataEntry.push(
{
"HMaterID": dataArray[i].HMaterID
@@ -2597,17 +2853,17 @@
, "瑙勬牸鍨嬪彿": dataArray[i].瑙勬牸鍨嬪彿
, "HUnitID": dataArray[i].HUnitID
, "璁¢噺鍗曚綅": dataArray[i].璁¢噺鍗曚綅
- , "HQty": dealDoubleToFixed(dataArray[i].鏁伴噺 - dataArray[i].鍏宠仈鏁伴噺, 1)
+ , "HQty": dealDoubleToFixed(HQty, 1)
, "HPrice": dealDoubleToFixed(dataArray[i].鍗曚环, 3)
, "HTaxPrice": dealDoubleToFixed(dataArray[i].鍚◣鍗曚环, 3)
, 'HDiscountRate': "0" //
, 'HRelTaxPrice': "0"
, "HTaxRate": dataArray[i].绋庣巼
- , 'HTaxMoney': "0" //
- , "HMoney": dealDoubleToFixed(dataArray[i].閲戦, 2)
- , 'HMoneyBB': dealDoubleToFixed(dataArray[i].閲戦 * dataArray[0].姹囩巼, 2)
- , 'HlineTotal': dealDoubleToFixed(dataArray[i].浠风◣鍚堣, 2)
- , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].浠风◣鍚堣 * dataArray[0].姹囩巼, 2)
+ , 'HTaxMoney': HTaxMoney //
+ , "HMoney": dealDoubleToFixed(HMoney, 2)
+ , 'HMoneyBB': dealDoubleToFixed(HMoneyBB, 2)
+ , 'HlineTotal': dealDoubleToFixed(HlineTotal, 2)
+ , 'HlineTotalBB': dealDoubleToFixed(HlineTotalBB, 2)
, "HRemark": ""
, "HSourceInterID": dataArray[i].hmainid
@@ -2642,6 +2898,7 @@
rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //浠风◣鍚堣
var HExRate = $("#HExRate").val();
rowdataEntry[i].HlineTotalBB = Number(((rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney) * HExRate).toFixed(4)) //鏈綅甯佷环绋庡悎璁�
+ rowdataEntry[i].HMoneyBB = Number((rowdataEntry[i].HMoney * HExRate).toFixed(4)) //鏈綅甯侀噾棰�
rowdataEntry.splice(j, 1);
j = j - 1;
}
@@ -2703,6 +2960,15 @@
//瀛愯〃Entry 璧嬪��
var rowdataEntry = [];
for (var i = 0; i < dataArray.length; i++) {
+ var HQty = dataArray[i].瀹炴敹鏁伴噺 - dataArray[i].鍏宠仈鏁伴噺; //鏁伴噺
+ var HPrice = dataArray[i].鍗曚环; //鍗曚环
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxRate = dataArray[i].绋庣巼 * 0.01; //绋庣巼
+ var HTaxMoney = Number((HMoney * HTaxRate)); //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+ var HExRate = $("#HExRate").val(); //姹囩巼
+ var HlineTotalBB = Number(((HMoney + HTaxMoney) * HExRate)); //鏈綅甯佷环绋庡悎璁�=(绋庨+閲戦)*姹囩巼
+ var HMoneyBB = HMoney * HExRate;
rowdataEntry.push(
{
"HMaterID": dataArray[i].HMaterID
@@ -2711,14 +2977,17 @@
, "瑙勬牸鍨嬪彿": dataArray[i].瑙勬牸鍨嬪彿
, "HUnitID": dataArray[i].HUnitID
, "璁¢噺鍗曚綅": dataArray[i].璁¢噺鍗曚綅
- , "HQty": dealDoubleToFixed(dataArray[i].瀹炴敹鏁伴噺 - dataArray[i].鍏宠仈鏁伴噺, 1)
+ , "HQty": dealDoubleToFixed(HQty, 1)
, "HPrice": dealDoubleToFixed(dataArray[i].鍗曚环, 3)
, "HTaxPrice": dealDoubleToFixed(dataArray[i].鍚◣鍗曚环, 3)
, 'HDiscountRate': "0" //
, 'HRelTaxPrice': "0"
, "HTaxRate": dataArray[i].绋庣巼
- , 'HTaxMoney': "0" //
- , "HMoney": dataArray[i].閲戦
+ , 'HTaxMoney': HTaxMoney //
+ , "HMoney": dealDoubleToFixed(HMoney, 2)
+ , 'HMoneyBB': dealDoubleToFixed(HMoneyBB, 2)
+ , 'HlineTotal': dealDoubleToFixed(HlineTotal, 2)
+ , 'HlineTotalBB': dealDoubleToFixed(HlineTotalBB, 2)
, "HRemark": ""
, "HSourceInterID": dataArray[i].hmainid
@@ -2752,6 +3021,7 @@
rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //浠风◣鍚堣
var HExRate = $("#HExRate").val();
rowdataEntry[i].HlineTotalBB = Number(((rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney) * HExRate).toFixed(4)) //鏈綅甯佷环绋庡悎璁�
+ rowdataEntry[i].HMoneyBB = Number((rowdataEntry[i].HMoney * HExRate).toFixed(4)) //鏈綅甯侀噾棰�
rowdataEntry.splice(j, 1);
j = j - 1;
}
--
Gitblit v1.9.1