From 12b89ad6301b6e1b13d3cd179b5eb3a4ef05ea13 Mon Sep 17 00:00:00 2001 From: mmrbnjd Date: Thu, 23 May 2024 01:16:59 +0330 Subject: [PATCH] ... --- Back/Data/Models/InvoiceItem.cs | 2 + Back/Services/servInvoice.cs | 3 +- Shared/DTOs/InvoiceDtos.cs | 8 ++- TaxPayerFull/CUSComponent/Employee.cs | 8 --- TaxPayerFull/Front.csproj | 4 -- TaxPayerFull/Layout/LGridInvoiceItem.razor | 66 ++++++++++++++++++ TaxPayerFull/Layout/LGridInvoicePayment.razor | 66 ++++++++++++++++++ .../{CUSComponent => Layout}/LTable.razor | 0 .../UserPanel}/InvoiceItem.razor | 68 +++++++++++++------ .../Pages/UserPanel/InvoiceItem.razor.css | 42 ++++++++++++ 10 files changed, 229 insertions(+), 38 deletions(-) delete mode 100644 TaxPayerFull/CUSComponent/Employee.cs create mode 100644 TaxPayerFull/Layout/LGridInvoiceItem.razor create mode 100644 TaxPayerFull/Layout/LGridInvoicePayment.razor rename TaxPayerFull/{CUSComponent => Layout}/LTable.razor (100%) rename TaxPayerFull/{CUSComponent => Pages/UserPanel}/InvoiceItem.razor (85%) create mode 100644 TaxPayerFull/Pages/UserPanel/InvoiceItem.razor.css diff --git a/Back/Data/Models/InvoiceItem.cs b/Back/Data/Models/InvoiceItem.cs index 37081e4..a37062e 100644 --- a/Back/Data/Models/InvoiceItem.cs +++ b/Back/Data/Models/InvoiceItem.cs @@ -64,6 +64,8 @@ namespace Back.Data.Models //نرخ مالیات بر ازش افزوده [MaxLength(5)] public decimal? vra { get { return cODItem.TaxRate; } } + //واحد اندازه گیری عنوان + public string? unitTitle { get { return cODItem.CODUnit.Title; } } #endregion #region fild diff --git a/Back/Services/servInvoice.cs b/Back/Services/servInvoice.cs index 7d5b0cc..b0e2ba2 100644 --- a/Back/Services/servInvoice.cs +++ b/Back/Services/servInvoice.cs @@ -60,7 +60,7 @@ namespace Back.Services am = x.am.Value, dis = x.dis, fee = x.fee.Value, - mu = x.mu, + mu = x.unitTitle, sstt = x.sstt, tsstam = x.tsstam, vam = x.am, @@ -73,6 +73,7 @@ namespace Back.Services iinn = x.acn, pcn = x.acn, pdt = x.pdt, + PaymentDateTime=x.PaymentDateTime, pid = x.pid, pmt = x.pmt, pv = x.pv, diff --git a/Shared/DTOs/InvoiceDtos.cs b/Shared/DTOs/InvoiceDtos.cs index d53bae0..e2e3e42 100644 --- a/Shared/DTOs/InvoiceDtos.cs +++ b/Shared/DTOs/InvoiceDtos.cs @@ -76,8 +76,8 @@ namespace Shared.DTOs [Display(Name = "مجموع صورتحساب")] public decimal? tbill { get; set; } public int? BillReference { get; set; } - public ICollection items { get; set; } - public ICollection payments { get; set; } + public ICollection items { get; set; }=new List(); + public ICollection payments { get; set; } = new List(); // public ICollection Invoicestatuschanges { get; set; } // public ICollection InvoiceSendTaxs { get; set; } @@ -88,7 +88,7 @@ namespace Shared.DTOs public int CODID { get; set; } // شرح کاال/خدمت public string? sstt { get; set; } - //واحد اندازهگیری + //واحد اندازهگیری------ public string? mu { get; set; } //تعداد/مقدار public decimal am { get; set; } @@ -104,6 +104,7 @@ namespace Shared.DTOs public decimal? adis { get; set; } //مبلغ کل کالا/خدمت public decimal? tsstam { get; set; } + } public class InvoicePaymentDTO { @@ -131,6 +132,7 @@ namespace Shared.DTOs //تاریخ و زمان پرداخت [MaxLength(13)] public long? pdt { get; set; } + public string? PaymentDateTime { get; set; } //مبلغ پرداختی [MaxLength(18)] public decimal? pv { get; set; } diff --git a/TaxPayerFull/CUSComponent/Employee.cs b/TaxPayerFull/CUSComponent/Employee.cs deleted file mode 100644 index 967586a..0000000 --- a/TaxPayerFull/CUSComponent/Employee.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Front.CUSComponent -{ - public class Employee - { - public string LastName { get; set; } - public string FirstName { get; set; } - } -} diff --git a/TaxPayerFull/Front.csproj b/TaxPayerFull/Front.csproj index ac6ab40..7f214af 100644 --- a/TaxPayerFull/Front.csproj +++ b/TaxPayerFull/Front.csproj @@ -8,10 +8,6 @@ - - - - diff --git a/TaxPayerFull/Layout/LGridInvoiceItem.razor b/TaxPayerFull/Layout/LGridInvoiceItem.razor new file mode 100644 index 0000000..90c1dcc --- /dev/null +++ b/TaxPayerFull/Layout/LGridInvoiceItem.razor @@ -0,0 +1,66 @@ +@using Shared.DTOs + + + + @context.ID + + + @context.CODID + + + @context.sstt + + + @context.mu + + + @context.am + + + @context.fee + + + @context.vra + + + @context.vam + + + @context.dis + +@* + @context.adis + *@ + + @context.tsstam + + + + +@code { + [Inject] ModalService ModalService { get; set; } = default!; + [Parameter] public IEnumerable InvoiceItems { get; set; } + private async Task> DataProvider(GridDataProviderRequest request) + { + if (InvoiceItems is null) // pull employees only one time for client-side filtering, sorting, and paging + InvoiceItems = GetInvoiceItems(); // call a service or an API to pull the employees + + return await Task.FromResult(request.ApplyTo(InvoiceItems)); + } + private async Task OnRowClick(GridRowEventArgs args) + { + await ModalService.ShowAsync(new ModalOption { Type = ModalType.Primary, Title = "Event: Row Click", Message = $"Id: {args.Item.ID}, Name: {args.Item.sstt}" }); + } + private IEnumerable GetInvoiceItems() + { + return new List(); + + } + +} \ No newline at end of file diff --git a/TaxPayerFull/Layout/LGridInvoicePayment.razor b/TaxPayerFull/Layout/LGridInvoicePayment.razor new file mode 100644 index 0000000..f561208 --- /dev/null +++ b/TaxPayerFull/Layout/LGridInvoicePayment.razor @@ -0,0 +1,66 @@ +@using Shared.DTOs + + + + @context.ID + + + @context.iinn + + + @context.acn + + + @context.trmn + + + @context.pmt + + + @context.trn + + + @context.pcn + + + @context.pid + + + @context.PaymentDateTime + +@* + @context.adis + *@ + + @context.pv + + + + +@code { + [Inject] ModalService ModalService { get; set; } = default!; + [Parameter] public IEnumerable InvoicePays { get; set; } + private async Task> DataProvider(GridDataProviderRequest request) + { + if (InvoicePays is null) // pull employees only one time for client-side filtering, sorting, and paging + InvoicePays = GetInvoicePays(); // call a service or an API to pull the employees + + return await Task.FromResult(request.ApplyTo(InvoicePays)); + } + private async Task OnRowClick(GridRowEventArgs args) + { + await ModalService.ShowAsync(new ModalOption { Type = ModalType.Primary, Title = "Event: Row Click", Message = $"Id: {args.Item.ID}, Name: {args.Item.PaymentDateTime}" }); + } + private IEnumerable GetInvoicePays() + { + return new List(); + + } + +} \ No newline at end of file diff --git a/TaxPayerFull/CUSComponent/LTable.razor b/TaxPayerFull/Layout/LTable.razor similarity index 100% rename from TaxPayerFull/CUSComponent/LTable.razor rename to TaxPayerFull/Layout/LTable.razor diff --git a/TaxPayerFull/CUSComponent/InvoiceItem.razor b/TaxPayerFull/Pages/UserPanel/InvoiceItem.razor similarity index 85% rename from TaxPayerFull/CUSComponent/InvoiceItem.razor rename to TaxPayerFull/Pages/UserPanel/InvoiceItem.razor index 7e4f9e1..f890683 100644 --- a/TaxPayerFull/CUSComponent/InvoiceItem.razor +++ b/TaxPayerFull/Pages/UserPanel/InvoiceItem.razor @@ -123,12 +123,32 @@ -

This is the placeholder content for the Home tab.

+
+
+ +
+
+ +
+
+
-

This is the placeholder content for the Profile tab.

+
+
+ +
+
+ + +
+
+ +
@@ -141,11 +161,29 @@ -
- +
+
+
+
+ @if (invoice.ID == 0) + { + + } + else + { + + + } +
@@ -153,21 +191,7 @@ -@if (invoice.ID == 0) -{ - -} -else -{ - - -} + @code { @@ -191,7 +215,7 @@ else protected override async Task OnParametersSetAsync() { PreloadService.Show(SpinnerColor.Dark); - Cus =await fv.GetCustomers(); + Cus = await fv.GetCustomers(); Patterns = await fv.GetPatterns(); if (InvoiceID != null && InvoiceID > 0) { @@ -202,7 +226,7 @@ else } else hc._nav.NavigateTo("/Pael"); - + } else { @@ -214,7 +238,7 @@ else Udate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront() }; } - + Hidealert = true; alertMessage = ""; diff --git a/TaxPayerFull/Pages/UserPanel/InvoiceItem.razor.css b/TaxPayerFull/Pages/UserPanel/InvoiceItem.razor.css new file mode 100644 index 0000000..f831d04 --- /dev/null +++ b/TaxPayerFull/Pages/UserPanel/InvoiceItem.razor.css @@ -0,0 +1,42 @@ +/* CSS */ +.button-8 { + background-color: #e1ecf4; + border-radius: 3px; + border: 1px solid #7aa7c7; + box-shadow: rgba(255, 255, 255, .7) 0 1px 0 0 inset; + box-sizing: border-box; + color: #39739d; + cursor: pointer; + display: inline-block; + font-family: -apple-system,system-ui,"Segoe UI","Liberation Sans",sans-serif; + font-size: 13px; + font-weight: 400; + line-height: 1.15385; + margin: 0; + outline: none; + padding: 8px .8em; + position: relative; + text-align: center; + text-decoration: none; + user-select: none; + -webkit-user-select: none; + touch-action: manipulation; + vertical-align: baseline; + white-space: nowrap; +} + + .button-8:hover, + .button-8:focus { + background-color: #b3d3ea; + color: #2c5777; + } + + .button-8:focus { + box-shadow: 0 0 0 4px rgba(0, 149, 255, .15); + } + + .button-8:active { + background-color: #a0c7e4; + box-shadow: none; + color: #2c5777; + }