From f15ca632c30b80aa8516c9d752b978c04e268c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Tue, 9 Sep 2025 16:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E5=88=92=E8=BD=AC=EF=BC=8C?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E4=BF=9D=E7=95=992=E4=BD=8D=E5=B0=8F?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClientModule/ClientCashInCashOutDataService.cs | 9 ++++++--- YLErpWeb/Properties/launchSettings.json | 2 +- .../wwwroot/Scripts/app/client/entryexitEdit.js | 14 +++++++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs b/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs index ad74c2f1..ccdad4d4 100644 --- a/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs +++ b/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs @@ -708,15 +708,18 @@ namespace YLErp.Modules.ClientModule } var money = r.Money ?? 0; money=isAddNew? money: money-(originalMoney??0); - if (r.TransferOutAccount == "初保账户" && money > clientbalance.NetFundAll) + var netFundAll = Math.Round(clientbalance.NetFundAll,2,MidpointRounding.AwayFromZero); + var vmFundSum = Math.Round(clientbalance.VmFundSum,2,MidpointRounding.AwayFromZero); + var winLoss = Math.Round(clientbalance.WinLoss,2,MidpointRounding.AwayFromZero); + if (r.TransferOutAccount == "初保账户" && money > netFundAll) { throw new ServiceException("划转金额不能超过初保账户金额"); } - if (r.TransferOutAccount == "追保账户" && money > clientbalance.VmFundSum) + if (r.TransferOutAccount == "追保账户" && money > vmFundSum) { throw new ServiceException("划转金额不能超过追保账户金额"); } - if (r.TransferOutAccount == "已实现盈亏" && money > clientbalance.WinLoss) + if (r.TransferOutAccount == "已实现盈亏" && money > winLoss) { throw new ServiceException("划转金额不能超过已实现盈亏"); } diff --git a/YLErpWeb/Properties/launchSettings.json b/YLErpWeb/Properties/launchSettings.json index 6b0464ba..be61e851 100644 --- a/YLErpWeb/Properties/launchSettings.json +++ b/YLErpWeb/Properties/launchSettings.json @@ -5,7 +5,7 @@ "launchBrowser": true, "launchUrl": "http://localhost:49462", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "local" + "ASPNETCORE_ENVIRONMENT": "dev" }, "applicationUrl": "http://localhost:49462" } diff --git a/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js b/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js index 159c707e..10d5a0cc 100644 --- a/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js +++ b/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js @@ -256,9 +256,9 @@ function setClientCash() { } }); main.post("/trade_span/GetClientLatestBalance", { clientId: clientId }).done(function (data) { - winloss = data.WinLoss; - netFund = data.NetFund; - vmFund = data.VmFundSum; + winloss = numFormart(data.WinLoss); + netFund = numFormart(data.NetFund); + vmFund = numFormart(data.VmFundSum); setTransferMoney(); }); } @@ -289,6 +289,14 @@ function setTransferMoney() { $("#transfer_in_account_money").text("余额:" + winloss); } } +function numFormart(num) { + num = num || 0; + var result = numeral(num).format("0,0.00") === "NaN" ? "0.00" : numeral(num).format("0,0.00"); + if (result === "-0.00") { + result = "0.00"; + } + return result; +} $(function () { cardInputMgr.init();