...
This commit is contained in:
@@ -4,6 +4,7 @@ using Shared.DTOs.Warehouse;
|
|||||||
using Net.Pkcs11Interop.Common;
|
using Net.Pkcs11Interop.Common;
|
||||||
using Back.Services;
|
using Back.Services;
|
||||||
using Back.Data.Models;
|
using Back.Data.Models;
|
||||||
|
using Back.Common;
|
||||||
|
|
||||||
namespace Back.Validations.Warehouse.Receipt
|
namespace Back.Validations.Warehouse.Receipt
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,21 @@ namespace Back.Validations.Warehouse.Receipt
|
|||||||
context.AddFailure("توضیحی برای رسید در نظر بگیرید");
|
context.AddFailure("توضیحی برای رسید در نظر بگیرید");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
RuleFor(r => r.Item1.Date)
|
||||||
|
.Custom((InvoiceDate, context) =>
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(InvoiceDate))
|
||||||
|
context.AddFailure("تاریخ نمی تواند خالی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Length != 8)
|
||||||
|
context.AddFailure("تاریخ صحیح نمی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Trim().ToMiladi() > DateTime.Now)
|
||||||
|
context.AddFailure("تاریخ از امروز جلوتر باشد");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
RuleFor(r => r.Item2)
|
RuleFor(r => r.Item2)
|
||||||
.Custom((CompanyID, context) =>
|
.Custom((CompanyID, context) =>
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Back.Data.Contracts;
|
using Back.Common;
|
||||||
|
using Back.Data.Contracts;
|
||||||
using Back.Services;
|
using Back.Services;
|
||||||
using Back.Services.Warehouse;
|
using Back.Services.Warehouse;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
@@ -13,6 +14,18 @@ namespace Back.Validations.Warehouse.Receipt
|
|||||||
public UpdateValidation(IAsyncRepository<Back.Data.Models.Warehouse.Receipt> _ReceiptRepo, ServCOD servCOD, WarehouseService warehouseService)
|
public UpdateValidation(IAsyncRepository<Back.Data.Models.Warehouse.Receipt> _ReceiptRepo, ServCOD servCOD, WarehouseService warehouseService)
|
||||||
{
|
{
|
||||||
CascadeMode = CascadeMode.Stop;
|
CascadeMode = CascadeMode.Stop;
|
||||||
|
RuleFor(r => r.Item1.Date)
|
||||||
|
.Custom((InvoiceDate, context) =>
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(InvoiceDate))
|
||||||
|
context.AddFailure("تاریخ نمی تواند خالی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Length != 8)
|
||||||
|
context.AddFailure("تاریخ صحیح نمی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Trim().ToMiladi() > DateTime.Now)
|
||||||
|
context.AddFailure("تاریخ از امروز جلوتر باشد");
|
||||||
|
});
|
||||||
RuleFor(model => model)
|
RuleFor(model => model)
|
||||||
.Custom((model, context) =>
|
.Custom((model, context) =>
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Back.Services;
|
using Back.Common;
|
||||||
|
using Back.Services;
|
||||||
using Back.Services.Warehouse;
|
using Back.Services.Warehouse;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Shared.DTOs.Warehouse;
|
using Shared.DTOs.Warehouse;
|
||||||
@@ -11,6 +12,19 @@ namespace Back.Validations.Warehouse.Remittance
|
|||||||
{
|
{
|
||||||
CascadeMode = CascadeMode.Stop;
|
CascadeMode = CascadeMode.Stop;
|
||||||
|
|
||||||
|
RuleFor(r => r.Item1.Date)
|
||||||
|
.Custom((InvoiceDate, context) =>
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(InvoiceDate))
|
||||||
|
context.AddFailure("تاریخ نمی تواند خالی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Length != 8)
|
||||||
|
context.AddFailure("تاریخ صحیح نمی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Trim().ToMiladi() > DateTime.Now)
|
||||||
|
context.AddFailure("تاریخ از امروز جلوتر باشد");
|
||||||
|
});
|
||||||
|
|
||||||
RuleFor(model => model)
|
RuleFor(model => model)
|
||||||
.Custom((model, context) =>
|
.Custom((model, context) =>
|
||||||
{
|
{
|
||||||
|
@@ -4,6 +4,7 @@ using Back.Services;
|
|||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Shared.DTOs.Warehouse;
|
using Shared.DTOs.Warehouse;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Back.Common;
|
||||||
|
|
||||||
namespace Back.Validations.Warehouse.Remittance
|
namespace Back.Validations.Warehouse.Remittance
|
||||||
{
|
{
|
||||||
@@ -12,6 +13,20 @@ namespace Back.Validations.Warehouse.Remittance
|
|||||||
public UpdateValidation(IAsyncRepository<Back.Data.Models.Warehouse.Remittance> _Repo, ServCOD servCOD, WarehouseService warehouseService)
|
public UpdateValidation(IAsyncRepository<Back.Data.Models.Warehouse.Remittance> _Repo, ServCOD servCOD, WarehouseService warehouseService)
|
||||||
{
|
{
|
||||||
CascadeMode = CascadeMode.Stop;
|
CascadeMode = CascadeMode.Stop;
|
||||||
|
RuleFor(r => r.Item1.Date)
|
||||||
|
.Custom((InvoiceDate, context) =>
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(InvoiceDate))
|
||||||
|
context.AddFailure("تاریخ نمی تواند خالی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Length != 8)
|
||||||
|
context.AddFailure("تاریخ صحیح نمی باشد");
|
||||||
|
|
||||||
|
else if (InvoiceDate.Trim().ToMiladi() > DateTime.Now)
|
||||||
|
context.AddFailure("تاریخ از امروز جلوتر باشد");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
RuleFor(model => model)
|
RuleFor(model => model)
|
||||||
.Custom((model, context) => {
|
.Custom((model, context) => {
|
||||||
var ORGitem = _Repo.Get(w => w.ID == model.Item1.ID && !w.Deleted).Include(i => i.cODItem).FirstOrDefault();
|
var ORGitem = _Repo.Get(w => w.ID == model.Item1.ID && !w.Deleted).Include(i => i.cODItem).FirstOrDefault();
|
||||||
|
@@ -118,6 +118,24 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
if (Selected.promotionDetails.Any(w => w.PermissionID == 18))
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>@Selected.promotionDetails.Where(w => w.PermissionID == 18).Select(s => s.PermissionTitle).FirstOrDefault()</td>
|
||||||
|
<td>@Selected.promotionDetails.Where(w => w.PermissionID == 18).Select(s => s.APrice).FirstOrDefault().ToString("N0") ريال</td>
|
||||||
|
<td>
|
||||||
|
@if (Selected.ID < 0)
|
||||||
|
{
|
||||||
|
<InputNumber @bind-Value="values[4]" @bind-Value:after="OnInput" type="text" class="form-control" id="inputax" style="text-align:center;" placeholder="تعداد" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input value="@Selected.promotionDetails.Where(w => w.PermissionID == 18).Select(s => s.CreditAmount).FirstOrDefault()" style="text-align:center;" class="form-control" type="text" readonly>
|
||||||
|
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -154,7 +172,7 @@
|
|||||||
public List<PromotionDto> Promotions { get; set; } = new();
|
public List<PromotionDto> Promotions { get; set; } = new();
|
||||||
public PromotionDto? Selected { get; set; } = null;
|
public PromotionDto? Selected { get; set; } = null;
|
||||||
// invoice cod cus tax
|
// invoice cod cus tax
|
||||||
int[] values = { 0,0,0,0};
|
int[] values = { 0,0,0,0,0};
|
||||||
decimal TotalPrice = 0;
|
decimal TotalPrice = 0;
|
||||||
}
|
}
|
||||||
@functions {
|
@functions {
|
||||||
@@ -176,7 +194,7 @@
|
|||||||
{
|
{
|
||||||
orderSelectName = "نوع سفارش";
|
orderSelectName = "نوع سفارش";
|
||||||
Selected = null;
|
Selected = null;
|
||||||
values =new int[] { 0,0,0,0};
|
values =new int[] { 0,0,0,0,0};
|
||||||
TotalPrice = 0;
|
TotalPrice = 0;
|
||||||
Promotions = await fv.GetPromotion();
|
Promotions = await fv.GetPromotion();
|
||||||
orderstype = new List<IdName<int>>();
|
orderstype = new List<IdName<int>>();
|
||||||
@@ -220,6 +238,10 @@
|
|||||||
if (itemtax != null)
|
if (itemtax != null)
|
||||||
itemtax.CreditAmount = values[3];
|
itemtax.CreditAmount = values[3];
|
||||||
|
|
||||||
|
var itemwarehouse = Selected.promotionDetails.Where(w => w.PermissionID == 18).FirstOrDefault();
|
||||||
|
if (itemwarehouse != null)
|
||||||
|
itemwarehouse.CreditAmount = values[4];
|
||||||
|
|
||||||
TotalPrice = Selected.TotalPrice;
|
TotalPrice = Selected.TotalPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,8 +252,8 @@
|
|||||||
SpinnerVisible = true;
|
SpinnerVisible = true;
|
||||||
if (Selected != null)
|
if (Selected != null)
|
||||||
{
|
{
|
||||||
if (Selected.ID < 0 && (values[0] < 0 || values[1] < 0 || values[2] < 0 || values[3] < 0)) return;
|
if (Selected.ID < 0 && (values[0] < 0 || values[1] < 0 || values[2] < 0 || values[3] < 0 || values[4] < 0)) return;
|
||||||
if (Selected.ID < 0 && values[0] == 0 && values[1] == 0 && values[2] == 0 && values[3] == 0) return;
|
if (Selected.ID < 0 && values[0] == 0 && values[1] == 0 && values[2] == 0 && values[3] == 0 && values[4] == 0) return;
|
||||||
|
|
||||||
//---------
|
//---------
|
||||||
var itemFac = Selected.promotionDetails.Where(w => w.PermissionID == 3).FirstOrDefault();
|
var itemFac = Selected.promotionDetails.Where(w => w.PermissionID == 3).FirstOrDefault();
|
||||||
@@ -249,6 +271,10 @@
|
|||||||
var itemtax = Selected.promotionDetails.Where(w => w.PermissionID == 16).FirstOrDefault();
|
var itemtax = Selected.promotionDetails.Where(w => w.PermissionID == 16).FirstOrDefault();
|
||||||
if (itemtax != null)
|
if (itemtax != null)
|
||||||
itemtax.CreditAmount = values[3];
|
itemtax.CreditAmount = values[3];
|
||||||
|
|
||||||
|
var itemwarehouse = Selected.promotionDetails.Where(w => w.PermissionID == 18).FirstOrDefault();
|
||||||
|
if (itemwarehouse != null)
|
||||||
|
itemwarehouse.CreditAmount = values[4];
|
||||||
//---------
|
//---------
|
||||||
var rsp = await hc.Post<PromotionDto>($"Orders/AddOrder", Selected);
|
var rsp = await hc.Post<PromotionDto>($"Orders/AddOrder", Selected);
|
||||||
if (rsp.IsSuccessStatusCode)
|
if (rsp.IsSuccessStatusCode)
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
@* search *@
|
@* search *@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h4 class="fw-bold py-3 mb-4">
|
<h4 class="fw-bold py-3 mb-4">
|
||||||
<span class="text-muted fw-light">سرویس ها /</span> مشتری
|
<span class="text-muted fw-light">سرویس ها /</span> انبارداری
|
||||||
</h4>
|
</h4>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card mb-2">
|
<div class="card mb-2">
|
||||||
|
Reference in New Issue
Block a user