1
yusijie
2024-09-18 dd9145bbd9e2e7ba27324250dd16abfa6af41d08
WebTM/views/²É¹º¹ÜÀí/Ó¦¸¶µ¥/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>
@@ -575,6 +575,243 @@
            });
            //#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
                                                , "物料代码": dataArray[i].物料代码
                                                , "物料名称": 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
                                                , "物料代码": dataArray[i].物料代码
                                                , "物料名称": 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
            //#region å¤é€‰æ¡†çŠ¶æ€å˜æ›´
@@ -1002,7 +1239,17 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        var HSupID = $("#HSupID").val();//判断供应商
                        if (HSupID == 0 || HSupID == '') {
                            HSupID = checkStatus.data[0]["HSupID"];
                        }
                        for (var i = 0; i < checkStatus.data.length; i++) {
                            if (checkStatus.data[i]["HSupID"] != HSupID) {
                                layer.msg("下推失败!已经选中的记录中存在不同供应商!");
                                layer.close(index);//关闭弹窗
                                return;
                            }
                        }
                        if ($("#BillType").val() == "1102") {
                            setInitByPOOrderBill(checkStatus);
                        }
@@ -1248,6 +1495,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 +1503,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 +1512,7 @@
                            , HTaxMoney: HTaxMoney
                            , HlineTotal: HlineTotal
                            , HlineTotalBB: HlineTotalBB
                            , HMoneyBB: HMoneyBB
                        });
                        table.render(option);
                        break;
@@ -1274,7 +1524,7 @@
                            obj.update({
                                HPrice: oldText
                            });
                            table.render(option);
                            layer.msg("单价请输入大于0的数字!");
                            return;
                        }
@@ -1291,16 +1541,17 @@
                        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));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        HTaxPrice = Number(HPrice.toFixed(HPriceDec));
                        HRelTaxPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        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 +1562,7 @@
                            , HTaxPrice, HTaxPrice
                            , HRelTaxPrice: HRelTaxPrice
                            , HlineTotalBB: HlineTotalBB
                            , HMoneyBB: HMoneyBB
                        });
                        table.render(option);
                        break;
@@ -1322,7 +1574,7 @@
                            obj.update({
                                HTaxRate: oldText
                            });
                            table.render(option);
                            layer.msg("税率请输入不小于0的数字!");
                            return;
                        }
@@ -1341,15 +1593,17 @@
                        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));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        HTaxPrice = Number(HPrice.toFixed(HPriceDec));
                        HRelTaxPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        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 +1616,7 @@
                            , HTaxPrice, HTaxPrice
                            , HRelTaxPrice: HRelTaxPrice
                            , HlineTotalBB: HlineTotalBB
                            , HMoneyBB: HMoneyBB
                        });
                        table.render(option);
                        break;
@@ -1373,7 +1628,7 @@
                            obj.update({
                                HDiscountRate: oldText
                            });
                            table.render(option);
                            layer.msg("折扣率请输入不小于0的数字!");
                            return;
                        }
@@ -1393,8 +1648,8 @@
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HTaxPrice = Number(HPrice.toFixed(HPriceDec));
                        HRelTaxPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        HRelTaxPrice = Number(HRelTaxPrice.toFixed(HPriceDec));
                        HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -1409,7 +1664,6 @@
                        });
                        table.render(option);
                        break;
                    case "HTaxPrice":                                         //单价
                        //数据格式校验  
                        temp = value + "";     //修改后的值 è½¬ä¸ºå­—符串 èµ‹å€¼ç»™  å˜é‡temp
@@ -1436,6 +1690,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 +1700,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字段,HQty
@@ -1455,6 +1711,7 @@
                            , HTaxPrice, HTaxPrice                   //更新HTaxPrice字段,HTaxPrice
                            , HRelTaxPrice: HRelTaxPrice            //更新HRelTaxPrice字段,其值来自变量HRelTaxPrice
                            , HlineTotalBB: HlineTotalBB              //更新HlineTotalBB字段,其值来自变量HlineTotalBB
                            , HMoneyBB: HMoneyBB
                        });
                        table.render(option);
                        break;
@@ -1832,6 +2089,11 @@
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { icon: 1 });
                            if (data.Verify == "Y") //自动审核
                            {
                                $("#HInterID").val(data.HInterID);//获取提交成功返回的单据主ID
                                set_CheckBill(0); //审核
                            }
                            $('#set_SaveBill').addClass("layui-btn-disabled").attr("disabled", true);
                            //保存后浏览
                            //ReRoadBillMain();
@@ -2584,6 +2846,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
@@ -2592,17 +2863,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
@@ -2637,6 +2908,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;
                        }
@@ -2698,6 +2970,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
@@ -2706,14 +2987,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
@@ -2747,6 +3031,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;
                        }