diff --git a/Back/Back.csproj b/Back/Back.csproj index 899d7e4..fd97cd7 100644 --- a/Back/Back.csproj +++ b/Back/Back.csproj @@ -36,7 +36,7 @@ - ..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll + ..\..\Dlls\Service.dll diff --git a/Back/Controllers/InvoiceController.cs b/Back/Controllers/InvoiceController.cs index 19c7924..f11382c 100644 --- a/Back/Controllers/InvoiceController.cs +++ b/Back/Controllers/InvoiceController.cs @@ -95,7 +95,8 @@ namespace Back.Controllers LastChangeUserID = Convert.ToInt32(UserID), BillReference = null, IsDeleted = false, - PatternID = item.PatternID + PatternID = item.PatternID, + setm=1 })); @@ -249,6 +250,7 @@ namespace Back.Controllers BillReference = Invoice.ID, IsDeleted = false, PatternID = Invoice.PatternID, + setm=Invoice.setm, invoiceDetails=Invoice.invoiceDetails.Select(s=>new InvoiceItem { CODID=s.CODID, @@ -277,6 +279,7 @@ namespace Back.Controllers BillReference = Invoice.ID, IsDeleted = false, PatternID = Invoice.PatternID, + setm = Invoice.setm, invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem { CODID = s.CODID, @@ -361,7 +364,8 @@ namespace Back.Controllers BillReference = Invoice.ID, IsDeleted = false, PatternID = Invoice.PatternID, - invoiceDetails=Invoice.invoiceDetails.Select(s => new InvoiceItem + setm = Invoice.setm, + invoiceDetails =Invoice.invoiceDetails.Select(s => new InvoiceItem { CODID = s.CODID, am = s.am, diff --git a/Back/Data/Models/Invoice.cs b/Back/Data/Models/Invoice.cs index ea77d6e..0fefad4 100644 --- a/Back/Data/Models/Invoice.cs +++ b/Back/Data/Models/Invoice.cs @@ -90,7 +90,7 @@ namespace Back.Data.Models public string? sbc { get { return company?.BranchID; } } //مبلغ پرداختی نقدی [MaxLength(18)] - public decimal? cap { get { return insp - tvam - todam - tbill; } } + public decimal? cap { get { return tbill- insp- tvam- todam; } } //موضوع صورتحساب [MaxLength(1)] public int? ins { get { return (int)invoiceType; } } @@ -131,11 +131,16 @@ namespace Back.Data.Models //روش تسویه private int? _setm; [MaxLength(1)] - public int? setm { get { return pattern.BillTypeID == 3 || pattern.BillTypeID == 4 || pattern.inp==8 + public int? setm + { + get + { + return pattern.BillTypeID == 3 || pattern.BillTypeID == 4 || pattern.inp == 8 ? 1 - :_setm; } + : _setm; + } set { _setm = value; } - } + } //مبلغ نسیه [MaxLength(18)] public decimal? insp { get; set; } = 0; diff --git a/Back/Services/servTaxPayer.cs b/Back/Services/servTaxPayer.cs index 04f5941..bc06050 100644 --- a/Back/Services/servTaxPayer.cs +++ b/Back/Services/servTaxPayer.cs @@ -95,7 +95,7 @@ namespace Back.Services foreach (_TaxPayer.Fild item in head) { var resval = InvoiceItem.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(InvoiceItem)).FirstOrDefault(); - item.Value = resval == null ? "" : (item.eName == "InvoicIssueDate" || item.eName == "InvoiceDate" || item.eName == "CottageDateOfCustomsDeclaration" ? resval.ToString().ShamciToFormatShamci() : resval.ToString()); + item.Value = resval == null ? "" : (item.eName == "InvoicIssueDate" || item.eName == "InvoiceDate" || item.eName == "CottageDateOfCustomsDeclaration" ? resval.ToString().ShamciToFormatShamci() :resval.ToString().Split('.').Length==2 ? ((decimal)resval).ToString("N0") : resval.ToString()); item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>(); item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null; } @@ -117,7 +117,7 @@ namespace Back.Services foreach (_TaxPayer.Fild item in body) { var resval = invoicedetail.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(invoicedetail)).FirstOrDefault(); - item.Value = resval == null ? "" : resval.ToString(); + item.Value = resval == null ? "" : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString(); item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>(); item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null; } @@ -140,7 +140,7 @@ namespace Back.Services foreach (_TaxPayer.Fild item in pay) { var resval = InvoiceItem.payments.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(InvoiceItem.payments)).FirstOrDefault(); - item.Value = resval == null ? "" : resval.ToString(); + item.Value = resval == null ? "" : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString(); item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>(); item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null; } @@ -195,7 +195,7 @@ namespace Back.Services } private void SetValue(_TaxPayer.Fild fild, ref T obj) { - var resvaltype = obj.GetType().GetProperties().Where(w => w.Name == (fild.eName=="tax17" ? "seventeentax" : fild.eName)).FirstOrDefault(); + var resvaltype = obj.GetType().GetProperties().Where(w => w.Name == fild.eName).FirstOrDefault(); //if (resvaltype != null) //{ if ((resvaltype.GetValue(obj) == null && !string.IsNullOrEmpty(fild.Value)) diff --git a/TaxPayerFull/Layout/LTable.razor b/TaxPayerFull/Layout/LTable.razor index 7f00178..71f76cf 100644 --- a/TaxPayerFull/Layout/LTable.razor +++ b/TaxPayerFull/Layout/LTable.razor @@ -39,26 +39,38 @@ int id = 0; foreach (PropertyInfo property in properties) { - if (property.Name.ToLower()=="id") - id =Convert.ToInt32(property.GetValue(item, null)); - + if (property.Name.ToLower() == "id") + id = Convert.ToInt32(property.GetValue(item, null)); + if (property.CustomAttributes.Any(w => w.AttributeType.Name == "DisplayAttribute")) { if (property.PropertyType == typeof(Nullable) || property.PropertyType == typeof(System.Decimal)) { @decimal.Parse(property.GetValue(item, null).ToString()).ToString("N0") ريال - + + } + else if (property.Name.ToLower() == "id") + { + if (id > 0) + { + + } + else + { + + } + } else { @property.GetValue(item, null) } - + } } - if (id>0) + if (id > 0) { } @@ -66,7 +78,7 @@ { } - + } } diff --git a/TaxPayerFull/Pages/UserPanel/TaxPayerInvoiceItem.razor b/TaxPayerFull/Pages/UserPanel/TaxPayerInvoiceItem.razor index 8e4c65f..8c5520d 100644 --- a/TaxPayerFull/Pages/UserPanel/TaxPayerInvoiceItem.razor +++ b/TaxPayerFull/Pages/UserPanel/TaxPayerInvoiceItem.razor @@ -7,7 +7,30 @@ آماده سازی صورتحساب +@* alert *@ +
+ +
+

+ سرویس ها / صورتحساب / آماده سازی قبل از ارسال به سامانه مودیان +

+
+
+
+

توجه

+
+

1) این یک پیش نمایش کامل از صورتحساب شماست با دقت آنرا بررسی کنید

+

2) یسری از فیلدها قابل دسترس هستند میتوانید در این مرحله اطلاعات تکمیلی بیشتری برای صورتحساب وارد کنید

+

3) فیلد هایی که قابل دسترسی نیستند به صورت خودکار از صورتحساب پر شده اند

+

4) فیلد های قرمز را حتما مشخص کنید

+
+
+
+
@@ -34,7 +57,7 @@ { @@ -76,96 +99,102 @@
-
+
-
اطلاعات تکمیلی بدنه صورتحساب
+
اطلاعات تکمیلی بدنه صورتحساب (کالاها)
- @if (invoice?.Bodys != null) - { - - @foreach (var item in invoice?.Bodys) - {
-
- s.Value).First()"> - -
- @foreach (var itemB in item.filds) - { -
+ @if (invoice?.Bodys != null) + { + + @foreach (var item in invoice?.Bodys) + { +
+
+ s.Value).First()"> + +
+ @foreach (var itemB in item.filds) + { +
@if (itemB.ModeID == 1 && itemB.InputBox != "autofild") - { - - } - else - { - - } - @if (itemB.InputBox == "fromdb") - { - - + else + { + + } + @if (itemB.InputBox == "fromdb") + { + + + } + else if (itemB.InputBox == "autofild") + { + + + } + else + { + + + } + + +
} - else if (itemB.InputBox == "autofild") - { - - - } - else - { - - - } - -
- } -
- - - + + +
- } + } - + - } + }
-
+
-@* action *@ -
-
-
-
-
-
- + +@if (invoice!=null) +{ + @* action *@ +
+
+
+
+
+
+ +
-
+} + @code { private ConfirmDialog dialog = default!; @@ -181,13 +210,22 @@ protected override async Task OnParametersSetAsync() { + PreloadService.Show(SpinnerColor.Dark); await LoadData(); + PreloadService.Hide(); await base.OnParametersSetAsync(); } } @functions { + private void ShowMessage(ToastType toastType, string msg) => messages.Add(CreateToastMessage(toastType, msg)); + private ToastMessage CreateToastMessage(ToastType toastType, string msg) + => new ToastMessage + { + Type = toastType, + Message = msg, + }; public async Task Send() { var rsp = await hc.Post<_TaxPayer.Atemplatefield>($"TaxPayer/PreparationInvoiceBeforeSending", invoice); @@ -196,11 +234,12 @@ var response = await rsp.Content.ReadFromJsonAsync(); if (response) { - ShowSuccessAlert("آماده سازی با موفقیت انجام شد"); + ShowMessage(ToastType.Success, "آماده سازی با موفقیت انجام شد"); + } else { - ShowDangerAlert("خطای در آماده سازی اطلاعات رخ داده"); + ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده"); } } else @@ -209,7 +248,7 @@ ShowDangerAlert(request[0]); } } - + private void ShowSuccessAlert(string msg) { Hidealert = false; @@ -226,7 +265,7 @@ } private async Task LoadData() { - PreloadService.Show(SpinnerColor.Dark); + var rsp = await hc.Get($"TaxPayer/GetInvoice/{InvoiceID}"); if (rsp.IsSuccessStatusCode) { @@ -237,6 +276,6 @@ var request = await rsp.Content.ReadFromJsonAsync>(); ShowDangerAlert(request[0]); } - PreloadService.Hide(); + } } diff --git a/TaxPayerFull/Program.cs b/TaxPayerFull/Program.cs index f8805c2..628e6c3 100644 --- a/TaxPayerFull/Program.cs +++ b/TaxPayerFull/Program.cs @@ -34,9 +34,9 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO() }) ; -//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") }); +builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") }); -builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") }); +//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") }); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");