修复开票 过程中出现的错误提示
This commit is contained in:
1 parent
dd512a0dcb
commit
064bd1f142
2 files changed
+67
-19
No files matched your search
@@ -15,6 +15,7 @@ using MAX.Core.Helpers;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
@@ -475,13 +476,17 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
||||
|
||||
private void ShowSettingDialog()
|
||||
{
|
||||
var view = new PDDInvoiceDialog();
|
||||
new DialogWindow
|
||||
var view = new PDDInvoiceDialog(Config);
|
||||
DialogService.ShowDialog(view, null, result =>
|
||||
{
|
||||
Title = "设置",
|
||||
Content = view,
|
||||
}.ShowDialog();
|
||||
Config = view.Config;
|
||||
if (result.Result == ButtonResult.OK)
|
||||
{
|
||||
Config.Assign(view.Config);
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig(ConfigPath, Config);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public event EventHandler<int> BatchInvoiceChanged;
|
||||
@@ -506,7 +511,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
||||
BottomMsg = "已取消批量开票";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (AmountTotal >= Config.MaxAmount)
|
||||
{
|
||||
return;
|
||||
@@ -537,6 +542,11 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
||||
order.IsSelected = false;
|
||||
success++;
|
||||
AmountTotal += order.order_amount / 100m;
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
var temp = OrderInvoiceInfoList?.FirstOrDefault(a => a.order_sn == order.order_sn);
|
||||
if (temp != null) temp.IsInvoiced = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -547,6 +557,12 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
||||
BottomRMsg = $"批量开票状态:成功 {success} 个,失败 {fail} 个。总金额:{AmountTotal.ToString("N2")}";
|
||||
StatisticsInvoiceAmount();
|
||||
await Task.Delay(1000);
|
||||
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
SaveOrderInvoiceInfo();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -716,9 +732,10 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
||||
}
|
||||
}
|
||||
StatisticsInvoiceAmount();
|
||||
|
||||
|
||||
SaveOrderInvoiceInfo();
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
SaveOrderInvoiceInfo();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -897,4 +914,12 @@ public class InvoiceConfig
|
||||
public string TaxNo { get; set; }
|
||||
public decimal MaxAmount { get; set; }
|
||||
public bool IsSaveData { get; set; }
|
||||
|
||||
public void Assign(InvoiceConfig config)
|
||||
{
|
||||
Title = config.Title;
|
||||
TaxNo = config.TaxNo;
|
||||
MaxAmount = config.MaxAmount;
|
||||
IsSaveData = config.IsSaveData;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user