invoicepays component
This commit is contained in:
@@ -40,9 +40,9 @@ namespace Back.Controllers
|
|||||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||||
|
|
||||||
//-----Validaton
|
//-----Validaton
|
||||||
//var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.add));
|
var resultValidationmodel = await _validation.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.add));
|
||||||
//if (!resultValidationmodel.IsValid)
|
if (!resultValidationmodel.IsValid)
|
||||||
// return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
||||||
|
|
||||||
//-----Get invoice
|
//-----Get invoice
|
||||||
Invoice invoice = await _servInvoice.GetInvoiceByInvoiceID(user.RolUsers.First().CompanyID, model.invoiceID);
|
Invoice invoice = await _servInvoice.GetInvoiceByInvoiceID(user.RolUsers.First().CompanyID, model.invoiceID);
|
||||||
@@ -91,16 +91,16 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
|
|
||||||
//-----Validaton
|
//-----Validaton
|
||||||
//var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.update));
|
var resultValidationmodel = await _validation.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.update));
|
||||||
//if (!resultValidationmodel.IsValid)
|
if (!resultValidationmodel.IsValid)
|
||||||
//{
|
{
|
||||||
// if (invoice.invoiceType != InvoiceType.BackFrmSale || (invoice.invoiceType != InvoiceType.BackFrmSale
|
if (invoice.invoiceType != InvoiceType.BackFrmSale || (invoice.invoiceType != InvoiceType.BackFrmSale
|
||||||
// && resultValidationmodel.Errors.Count > 1))
|
&& resultValidationmodel.Errors.Count > 1))
|
||||||
// {
|
{
|
||||||
// return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
||||||
// }
|
}
|
||||||
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -146,9 +146,9 @@ namespace Back.Controllers
|
|||||||
return NotFound(new List<string> { "invoice pay notFound..." });
|
return NotFound(new List<string> { "invoice pay notFound..." });
|
||||||
|
|
||||||
////-----Validaton
|
////-----Validaton
|
||||||
//var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, invoiceitem.InvoiceID, new InvoiceItemDTO(), eActionValidation.delete));
|
var resultValidationmodel = await _validation.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, payitem.InvoiceID, new InvoicePaymentDTO(), eActionValidation.delete));
|
||||||
//if (!resultValidationmodel.IsValid)
|
if (!resultValidationmodel.IsValid)
|
||||||
// return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -99,7 +99,7 @@ namespace Back.Services
|
|||||||
acn = x.acn,
|
acn = x.acn,
|
||||||
iinn = x.acn,
|
iinn = x.acn,
|
||||||
pcn = x.acn,
|
pcn = x.acn,
|
||||||
PaymentDateTime = x.PaymentDateTime,
|
PaymentDateTime = x.PaymentDateTime.ShamciToFormatShamci(),
|
||||||
pid = x.pid,
|
pid = x.pid,
|
||||||
pmt = x.pmt,
|
pmt = x.pmt,
|
||||||
pv = x.pv,
|
pv = x.pv,
|
||||||
|
81
TaxPayerFull/CUSComponent/InvoicePays.razor
Normal file
81
TaxPayerFull/CUSComponent/InvoicePays.razor
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
@using Shared.DTOs
|
||||||
|
|
||||||
|
<Grid @ref="grid"
|
||||||
|
TItem="InvoicePaymentDTO"
|
||||||
|
Class="table table-hover table-bordered table-striped mt-3"
|
||||||
|
Data="payments">
|
||||||
|
|
||||||
|
<GridColumns>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شناسه" PropertyName="ID">
|
||||||
|
@context.ID
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شماره سوییچ پرداخت" PropertyName="iinn">
|
||||||
|
@context.iinn
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شماره پذیرنده فروشگاهی" PropertyName="acn">
|
||||||
|
@context.acn
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شماره پایانه" PropertyName="trmn">
|
||||||
|
@context.trmn
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="روش پرداخت" PropertyName="pmt">
|
||||||
|
@context.pmt
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شماره پیگیری/شماره مرجع" PropertyName="trn">
|
||||||
|
@context.trn
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شماره کارت پرداخت کننده" PropertyName="pcn">
|
||||||
|
@context.pcn
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="شماره/شناسه ملی/کد فراگیر اتباع غیر ایرانی پرداخت کننده" PropertyName="pid">
|
||||||
|
@context.pid
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="تاریخ" PropertyName="PaymentDateTime">
|
||||||
|
@context.PaymentDateTime
|
||||||
|
</GridColumn>
|
||||||
|
<GridColumn TItem="InvoicePaymentDTO" HeaderText="مبلغ" PropertyName="pv">
|
||||||
|
@context.pv??.ToString("N0")
|
||||||
|
</GridColumn>
|
||||||
|
</GridColumns>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public ICollection<InvoicePaymentDTO> payments { get; set; }
|
||||||
|
Grid<InvoicePaymentDTO> grid = default!;
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
// payments = new List<InvoicePaymentDTO>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// private async Task AddEmployee()
|
||||||
|
// {
|
||||||
|
// // for the same employees collection, we are adding an object
|
||||||
|
// // explicit grid refresh required
|
||||||
|
// employees!.Add(CreateEmployee());
|
||||||
|
// await grid.RefreshDataAsync();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void AddEmployee2()
|
||||||
|
// {
|
||||||
|
// // creates a shallow copy
|
||||||
|
// var emps = employees!.GetRange(0, employees.Count);
|
||||||
|
// emps.Add(CreateEmployee());
|
||||||
|
// // now employees variable has a new reference. So no need to refresh the grid explicitly
|
||||||
|
// // explicit grid refresh is not required
|
||||||
|
// employees = emps;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private Employee1 CreateEmployee()
|
||||||
|
// {
|
||||||
|
// var emp = new Employee1();
|
||||||
|
// emp.Id = employees!.Max(x => x.Id) + 1;
|
||||||
|
// emp.Name = $"Employee {emp.Id}";
|
||||||
|
// emp.Designation = $"QA Engineer {emp.Id}";
|
||||||
|
// emp.DOJ = new DateOnly(new Random().Next(1970, 2000), new Random().Next(1, 12), new Random().Next(1, 25));
|
||||||
|
// emp.IsActive = true;
|
||||||
|
// return emp;
|
||||||
|
// }
|
||||||
|
}
|
Reference in New Issue
Block a user