...
This commit is contained in:
@@ -23,51 +23,55 @@ namespace Back.Services.Warehouse
|
|||||||
_RemittanceRepo = remittanceRepo;
|
_RemittanceRepo = remittanceRepo;
|
||||||
_ReceiptRepo = receiptRepo;
|
_ReceiptRepo = receiptRepo;
|
||||||
}
|
}
|
||||||
public async Task<PagingDto<CirculationDto>> Circulation(int CompanyID,string date="",int CODID=0,int PageIndex=1,int PageSize=5)
|
public async Task<PagingDto<CirculationDto>> Circulation(int CompanyID, string date = "", int CODID = 0, int PageIndex = 1, int PageSize = 5)
|
||||||
{
|
{
|
||||||
var RequestRemittance = _RemittanceRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted)
|
var RequestRemittance = _RemittanceRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted)
|
||||||
.Select(s=>new CirculationDto
|
.Select(s => new CirculationDto
|
||||||
{
|
{
|
||||||
CODID=s.CODID,
|
ID= s.ID,
|
||||||
CODTitle=s.cODItem.Title,
|
CODID = s.CODID,
|
||||||
Date=s.Date,
|
CODTitle = s.cODItem.Title,
|
||||||
Count=s.Count,
|
Date = s.Date.ShamciToFormatShamci(),
|
||||||
info=s.info,
|
Count = s.Count,
|
||||||
Type=TypeCirculation.Remittance,
|
info = s.info,
|
||||||
|
Type = TypeCirculation.Remittance,
|
||||||
ModelTypeID = (int)s.Type,
|
ModelTypeID = (int)s.Type,
|
||||||
ModelTypeTitle= s.Type.GetDisplayName()
|
ModelTypeTitle = s.Type.GetDisplayName(),
|
||||||
|
invoiceID = s.InvoiceID,
|
||||||
});
|
});
|
||||||
if (!string.IsNullOrEmpty(date))
|
if (!string.IsNullOrEmpty(date))
|
||||||
RequestRemittance = RequestRemittance.Where(w => w.Date == date);
|
RequestRemittance = RequestRemittance.Where(w => w.Date == date);
|
||||||
if (CODID!=0)
|
if (CODID != 0)
|
||||||
RequestRemittance = RequestRemittance.Where(w => w.CODID == CODID);
|
RequestRemittance = RequestRemittance.Where(w => w.CODID == CODID);
|
||||||
//-----------
|
//-----------
|
||||||
var RequestReceipt = _ReceiptRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted)
|
var RequestReceipt = _ReceiptRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted)
|
||||||
.Select(s => new CirculationDto
|
.Select(s => new CirculationDto
|
||||||
{
|
{
|
||||||
|
ID = s.ID,
|
||||||
CODID = s.CODID,
|
CODID = s.CODID,
|
||||||
CODTitle = s.cODItem.Title,
|
CODTitle = s.cODItem.Title,
|
||||||
Date = s.Date,
|
Date = s.Date.ShamciToFormatShamci(),
|
||||||
Count = s.Count,
|
Count = s.Count,
|
||||||
info = s.info,
|
info = s.info,
|
||||||
Type = TypeCirculation.Receipt,
|
Type = TypeCirculation.Receipt,
|
||||||
ModelTypeID = (int)s.Type,
|
ModelTypeID = (int)s.Type,
|
||||||
ModelTypeTitle = s.Type.GetDisplayName()
|
ModelTypeTitle = s.Type.GetDisplayName(),
|
||||||
|
invoiceID = s.InvoiceID,
|
||||||
});
|
});
|
||||||
if (!string.IsNullOrEmpty(date))
|
if (!string.IsNullOrEmpty(date))
|
||||||
RequestReceipt = RequestReceipt.Where(w => w.Date == date);
|
RequestReceipt = RequestReceipt.Where(w => w.Date == date);
|
||||||
if (CODID != 0)
|
if (CODID != 0)
|
||||||
RequestReceipt = RequestReceipt.Where(w => w.CODID == CODID);
|
RequestReceipt = RequestReceipt.Where(w => w.CODID == CODID);
|
||||||
|
|
||||||
return await RequestReceipt.Union(RequestRemittance).OrderByDescending(o => o.Date).Paging(PageIndex, PageSize);
|
return await RequestReceipt.Union(RequestRemittance).OrderByDescending(o => o.Date).Paging(PageIndex, PageSize);
|
||||||
//var list = await RequestReceipt.ToListAsync();
|
//var list = await RequestReceipt.ToListAsync();
|
||||||
//list.AddRange(await RequestRemittance.ToListAsync());
|
//list.AddRange(await RequestRemittance.ToListAsync());
|
||||||
//return await list.OrderByDescending(o=>o.Date).AsQueryable().Paging(PageIndex, PageSize);
|
//return await list.OrderByDescending(o=>o.Date).AsQueryable().Paging(PageIndex, PageSize);
|
||||||
}
|
}
|
||||||
public async Task<decimal> Inventory(int CompanyID,int CODID)
|
public async Task<decimal> Inventory(int CompanyID, int CODID)
|
||||||
{
|
{
|
||||||
var CReceipt=await _ReceiptRepo.Get(w => w.cODItem.CompanyID == CompanyID && w.CODID == CODID && w.ForSale && !w.Deleted).SumAsync(s => s.Count);
|
var CReceipt = await _ReceiptRepo.Get(w => w.cODItem.CompanyID == CompanyID && w.CODID == CODID && w.ForSale && !w.Deleted).SumAsync(s => s.Count);
|
||||||
var CRemittance=await _RemittanceRepo.Get(w => w.cODItem.CompanyID == CompanyID && w.CODID == CODID && !w.Deleted).SumAsync(s => s.Count);
|
var CRemittance = await _RemittanceRepo.Get(w => w.cODItem.CompanyID == CompanyID && w.CODID == CODID && !w.Deleted).SumAsync(s => s.Count);
|
||||||
return CReceipt - CRemittance;
|
return CReceipt - CRemittance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,13 +11,14 @@ namespace Shared.DTOs.Warehouse
|
|||||||
public enum TypeCirculation
|
public enum TypeCirculation
|
||||||
{
|
{
|
||||||
[Display(Name = "رسید")]
|
[Display(Name = "رسید")]
|
||||||
Receipt,
|
Receipt=10,
|
||||||
|
|
||||||
[Display(Name = "حواله")]
|
[Display(Name = "حواله")]
|
||||||
Remittance
|
Remittance=20
|
||||||
}
|
}
|
||||||
public class CirculationDto
|
public class CirculationDto
|
||||||
{
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
public int CODID { get; set; }
|
public int CODID { get; set; }
|
||||||
[Display(Name = "کالا")]
|
[Display(Name = "کالا")]
|
||||||
public string? CODTitle { get; set; }
|
public string? CODTitle { get; set; }
|
||||||
@@ -35,5 +36,6 @@ namespace Shared.DTOs.Warehouse
|
|||||||
public TypeCirculation Type { get; set; }
|
public TypeCirculation Type { get; set; }
|
||||||
[Display(Name = "نوع سند")]
|
[Display(Name = "نوع سند")]
|
||||||
public string msgType { get { return Type.GetEnumDisplayName(); } }
|
public string msgType { get { return Type.GetEnumDisplayName(); } }
|
||||||
|
public int? invoiceID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,11 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "View", "View", "{25C58D68-C
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "moadiran", "moadiran\moadiran.csproj", "{E209C152-76D5-469F-A969-B5BE5970CA7A}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "moadiran", "moadiran\moadiran.csproj", "{E209C152-76D5-469F-A969-B5BE5970CA7A}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8B482DB5-6DE6-4983-A3B2-36458EAEAD5F}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
next.txt = next.txt
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
321
TaxPayerFull/CUSComponent/WarehouseItem.razor
Normal file
321
TaxPayerFull/CUSComponent/WarehouseItem.razor
Normal file
@@ -0,0 +1,321 @@
|
|||||||
|
@using Front.Services
|
||||||
|
@using Shared
|
||||||
|
@using Shared.DTOs
|
||||||
|
@using Shared.DTOs.Warehouse
|
||||||
|
@using Shared.Enums
|
||||||
|
@inject HttpClientController hc;
|
||||||
|
<ConfirmDialog @ref="dialog" />
|
||||||
|
<form>
|
||||||
|
@* alert *@
|
||||||
|
<div class="row">
|
||||||
|
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||||||
|
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||||||
|
@alertMessage
|
||||||
|
</Alert>
|
||||||
|
</div>
|
||||||
|
<ul>
|
||||||
|
@if (_UsedFromInvoice)
|
||||||
|
{
|
||||||
|
<li> style="color:indianred"این سند از فاکتور صادر شده، ویرایش مستقیم آن ممکن نیست</li>
|
||||||
|
<br />
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<AutoComplete @bind-Value="model.CODTitle"
|
||||||
|
TItem="CODIdName<int>"
|
||||||
|
DataProvider="CODDataProvider"
|
||||||
|
PropertyName="Title"
|
||||||
|
Placeholder="جستجو در کالا..."
|
||||||
|
OnChanged="(CODIdName<int> cod) => OnAutoCompleteChanged(cod)" />
|
||||||
|
</div>
|
||||||
|
@* <div class="col-md-2">
|
||||||
|
<select style="text-align:center" @bind="Doctype" class="form-control" aria-label="Default select example">
|
||||||
|
<option value="0" style="color: #b5b5b5" selected>نوع ...</option>
|
||||||
|
<option value="10">رسید</option>
|
||||||
|
<option value="20">حواله</option>
|
||||||
|
</select>
|
||||||
|
</div> *@
|
||||||
|
|
||||||
|
<div class="form-group col-md-2">
|
||||||
|
<label class="col-sm-4 col-form-label" style="color:red" for="inputFullName">تعداد</label>
|
||||||
|
<InputNumber @bind-Value="model.Count" type="text" class="form-control" id="inputam" placeholder="تعداد" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-2">
|
||||||
|
<label class="col-sm-5 col-form-label" for="inputInvoicIssueDate">تاریخ</label>
|
||||||
|
<InputText style=" text-align: center;" @bind-Value="model.Date" type="text" class="form-control" id="inputInvoicIssueDate" placeholder="تاریخ" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<select style="text-align:center" @bind="model.ModelTypeID" class="form-control" aria-label="Default select example">
|
||||||
|
<option value="0" style="color: #b5b5b5" selected>نوع سند ...</option>
|
||||||
|
@if (model.Type == TypeCirculation.Receipt)
|
||||||
|
{
|
||||||
|
<option value="1">خرید</option>
|
||||||
|
<option value="2">امانت</option>
|
||||||
|
}
|
||||||
|
@if (model.Type == TypeCirculation.Remittance)
|
||||||
|
{
|
||||||
|
|
||||||
|
<option value="3">فروش</option>
|
||||||
|
<option value="4">امانت</option>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@if (model.Type == TypeCirculation.Receipt)
|
||||||
|
{
|
||||||
|
<div class="col-md-2">
|
||||||
|
<Switch @bind-Value="forsale" Label="اجازه فروش" />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label class="col-form-label" for="inputdes">توضیحات</label>
|
||||||
|
<InputText @bind-Value="model.info" type="text" class="form-control" id="inputdes" placeholder="توضیحات" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="col-md-10">
|
||||||
|
@if (model.CODID == 0)
|
||||||
|
{
|
||||||
|
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAddOrUpdate" Type="ButtonType.Button">
|
||||||
|
جدید
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@if (!_UsedFromInvoice)
|
||||||
|
{
|
||||||
|
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAddOrUpdate" Type="ButtonType.Button">
|
||||||
|
ثبت تغییرات
|
||||||
|
</Button>
|
||||||
|
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||||
|
حذف
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@code {
|
||||||
|
[Parameter] public CirculationDto model { get; set; }
|
||||||
|
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
|
||||||
|
[Parameter] public bool NewItem { get; set; }
|
||||||
|
[Parameter] public List<CODIdName<int>> CODrequest { get; set; }
|
||||||
|
private ConfirmDialog dialog = default!;
|
||||||
|
|
||||||
|
AlertColor alertColor = AlertColor.Primary;
|
||||||
|
IconName alertIconName = IconName.CheckCircleFill;
|
||||||
|
bool Hidealert = true;
|
||||||
|
string alertMessage = "";
|
||||||
|
|
||||||
|
bool _UsedFromInvoice = false;
|
||||||
|
|
||||||
|
public bool SpinnerVisible { get; set; } = false;
|
||||||
|
|
||||||
|
private bool forsale { get; set; } = false;
|
||||||
|
}
|
||||||
|
@functions {
|
||||||
|
protected override async Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
_UsedFromInvoice = model.invoiceID.HasValue;
|
||||||
|
if (NewItem)
|
||||||
|
model.Date = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront();
|
||||||
|
|
||||||
|
await base.OnParametersSetAsync();
|
||||||
|
}
|
||||||
|
private void ShowSuccessAlert(string msg)
|
||||||
|
{
|
||||||
|
Hidealert = false;
|
||||||
|
alertColor = AlertColor.Success;
|
||||||
|
alertIconName = IconName.CheckCircleFill;
|
||||||
|
alertMessage = msg;
|
||||||
|
}
|
||||||
|
private void ShowDangerAlert(string msg)
|
||||||
|
{
|
||||||
|
Hidealert = false;
|
||||||
|
alertColor = AlertColor.Danger;
|
||||||
|
alertIconName = IconName.ExclamationTriangleFill;
|
||||||
|
alertMessage = msg;
|
||||||
|
}
|
||||||
|
public async Task OnClickDelete()
|
||||||
|
{
|
||||||
|
if (NewItem)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SpinnerVisible = true;
|
||||||
|
await Delete();
|
||||||
|
SpinnerVisible = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
private async Task Delete()
|
||||||
|
{
|
||||||
|
string route = model.Type == TypeCirculation.Receipt ? "Receipt" : "Remittance";
|
||||||
|
|
||||||
|
var rsp = await hc.Delete($"{route}/{model.ID}");
|
||||||
|
if (rsp.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||||
|
if (request)
|
||||||
|
{
|
||||||
|
ActionInResultComponent result = new ActionInResultComponent();
|
||||||
|
result.Status = ComponentStatus.success;
|
||||||
|
result.Action = ComponentAction.delete;
|
||||||
|
await OnMultipleOfThree.InvokeAsync(result);
|
||||||
|
}
|
||||||
|
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (rsp.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||||
|
{
|
||||||
|
ShowDangerAlert("سندی یافت نشد");
|
||||||
|
}
|
||||||
|
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||||
|
}
|
||||||
|
private async Task Addorupdate()
|
||||||
|
{
|
||||||
|
string controller = model.Type == TypeCirculation.Receipt ? "Receipt" : "Remittance";
|
||||||
|
string route = NewItem ? "ADD" : "Update";
|
||||||
|
ActionInResultComponent result = new ActionInResultComponent();
|
||||||
|
HttpResponseMessage rsp = new HttpResponseMessage();
|
||||||
|
|
||||||
|
if (NewItem)
|
||||||
|
{
|
||||||
|
if (model.Type == TypeCirculation.Receipt)
|
||||||
|
rsp = await hc.Post($"{controller}/{NewItem}/{model.ID}", new ReceiptDto()
|
||||||
|
{
|
||||||
|
CODID = model.CODID,
|
||||||
|
Count = model.Count,
|
||||||
|
Date = model.Date,
|
||||||
|
ForSale = model.ForSale.Value,
|
||||||
|
info = model.info,
|
||||||
|
Type = (TypeReceipt)model.ModelTypeID,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (model.Type == TypeCirculation.Remittance)
|
||||||
|
rsp = await hc.Post($"{route}/Update/{model.ID}", new RemittanceDto()
|
||||||
|
{
|
||||||
|
CODID = model.CODID,
|
||||||
|
Count = model.Count,
|
||||||
|
Date = model.Date,
|
||||||
|
info = model.info,
|
||||||
|
Type = (TypeRemittance)model.ModelTypeID,
|
||||||
|
});
|
||||||
|
result.Action = ComponentAction.add;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (model.Type == TypeCirculation.Receipt)
|
||||||
|
rsp = await hc.Put($"{controller}/{NewItem}/{model.ID}", new ReceiptDto()
|
||||||
|
{
|
||||||
|
CODID = model.CODID,
|
||||||
|
Count = model.Count,
|
||||||
|
Date = model.Date,
|
||||||
|
ForSale = model.ForSale.Value,
|
||||||
|
info = model.info,
|
||||||
|
Type = (TypeReceipt)model.ModelTypeID,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (model.Type == TypeCirculation.Remittance)
|
||||||
|
rsp = await hc.Put($"{route}/Update/{model.ID}", new RemittanceDto()
|
||||||
|
{
|
||||||
|
CODID = model.CODID,
|
||||||
|
Count = model.Count,
|
||||||
|
Date = model.Date,
|
||||||
|
info = model.info,
|
||||||
|
Type = (TypeRemittance)model.ModelTypeID,
|
||||||
|
});
|
||||||
|
|
||||||
|
result.Action = ComponentAction.update;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (rsp.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
result.Status = ComponentStatus.success;
|
||||||
|
|
||||||
|
await OnMultipleOfThree.InvokeAsync(result);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||||
|
ShowDangerAlert(request[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public async Task OnClickAddOrUpdate()
|
||||||
|
{
|
||||||
|
SpinnerVisible = true;
|
||||||
|
await Addorupdate();
|
||||||
|
SpinnerVisible = false;
|
||||||
|
}
|
||||||
|
private async Task ShowConfirmationDeleteAsync()
|
||||||
|
{
|
||||||
|
if (!NewItem)
|
||||||
|
{
|
||||||
|
var confirmation = await dialog.ShowAsync(
|
||||||
|
title: "عملیات حذف سند انبار",
|
||||||
|
message1: $"{model.info}",
|
||||||
|
message2: "اطمینان دارید?");
|
||||||
|
|
||||||
|
if (confirmation)
|
||||||
|
await OnClickDelete();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private async Task<bool> ValidateRemittance()
|
||||||
|
{
|
||||||
|
if (model.Type == TypeCirculation.Remittance)
|
||||||
|
{
|
||||||
|
if (model.ModelTypeID != 3 && model.ModelTypeID != 4)
|
||||||
|
ShowDangerAlert("نوع سند صحیح نمی باشد");
|
||||||
|
|
||||||
|
else return await Validate();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
private async Task<bool> ValidateReceipt()
|
||||||
|
{
|
||||||
|
if (model.Type == TypeCirculation.Receipt)
|
||||||
|
{
|
||||||
|
model.ForSale = forsale;
|
||||||
|
if (model.ModelTypeID != 1 && model.ModelTypeID != 2)
|
||||||
|
ShowDangerAlert("نوع سند صحیح نمی باشد");
|
||||||
|
|
||||||
|
else return await Validate();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
private async Task<bool> Validate()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (model.CODID == null || model.CODID == 0)
|
||||||
|
ShowDangerAlert("کالایی انتخاب کنید");
|
||||||
|
if (model.Count <= 0)
|
||||||
|
ShowDangerAlert("تعدادی وارد کنید");
|
||||||
|
if (string.IsNullOrEmpty(model.Date))
|
||||||
|
ShowDangerAlert("تاریخ را مشخص کنید");
|
||||||
|
if (model.Date.Replace("/", "").Length != 10)
|
||||||
|
ShowDangerAlert("تاریخ صحیح نمی باشد");
|
||||||
|
if (string.IsNullOrEmpty(model.info))
|
||||||
|
ShowDangerAlert("توضیحی مشخص کنید");
|
||||||
|
else return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
private async Task<AutoCompleteDataProviderResult<CODIdName<int>>> CODDataProvider(AutoCompleteDataProviderRequest<CODIdName<int>> request)
|
||||||
|
{
|
||||||
|
return await Task.FromResult(request.ApplyTo(CODrequest.OrderBy(cod => cod.ID)));
|
||||||
|
}
|
||||||
|
private void OnAutoCompleteChanged(CODIdName<int> cOD)
|
||||||
|
{
|
||||||
|
model.CODID = cOD.ID;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,5 +1,6 @@
|
|||||||
<PageTitle>انبارداری</PageTitle>
|
<PageTitle>انبارداری</PageTitle>
|
||||||
@page "/Warehouse"
|
@page "/Warehouse"
|
||||||
|
@using Front.CUSComponent
|
||||||
@using Front.Services
|
@using Front.Services
|
||||||
@using Shared.DTOs
|
@using Shared.DTOs
|
||||||
@using Shared.DTOs.Warehouse
|
@using Shared.DTOs.Warehouse
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
<ul class="list-group fa-padding" style="border: 2px solid #0d6efd">
|
<ul class="list-group fa-padding" style="border: 2px solid #0d6efd">
|
||||||
<li class="list-group-item" data-toggle="modal" data-target="#issue">
|
<li class="list-group-item" data-toggle="modal" data-target="#issue">
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
=
|
=
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<input @bind-value="date" placeholder="تاریخ" style="text-align:center" dir="ltr" class="form-control" type="number">
|
<input @bind-value="date" placeholder="تاریخ" style="text-align:center" dir="ltr" class="form-control" type="number">
|
||||||
</div>
|
</div>
|
||||||
@@ -157,7 +158,15 @@
|
|||||||
string query = "";
|
string query = "";
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(date))
|
if (!string.IsNullOrEmpty(date))
|
||||||
query = $"date={date}&";
|
{
|
||||||
|
if (date.Replace("/","").Length==10)
|
||||||
|
query = $"date={date}&";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowDangerAlert("تاریخ صحیح نمی باشد");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CODID != null && CODID != 0)
|
if (CODID != null && CODID != 0)
|
||||||
query += $"CODID={CODID}&";
|
query += $"CODID={CODID}&";
|
||||||
@@ -183,44 +192,41 @@
|
|||||||
}
|
}
|
||||||
public async Task CallBackItem(ActionInResultComponent result)
|
public async Task CallBackItem(ActionInResultComponent result)
|
||||||
{
|
{
|
||||||
|
if (result.Status == ComponentStatus.success && result.Action==ComponentAction.delete)
|
||||||
|
ShowSuccessAlert("حذف با موفقیت انجام شد");
|
||||||
|
if (result.Status == ComponentStatus.success && result.Action == ComponentAction.update)
|
||||||
|
ShowSuccessAlert("ویرایش با موفقیت انجام شد");
|
||||||
|
if (result.Status == ComponentStatus.success && result.Action == ComponentAction.add)
|
||||||
|
ShowSuccessAlert("سند جدید اضافه شد");
|
||||||
|
|
||||||
|
if (result.Status==ComponentStatus.success)
|
||||||
|
{
|
||||||
|
await Load(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public async Task Item(CirculationDto circulationDto)
|
public async Task Item(CirculationDto circulationDto)
|
||||||
{
|
{
|
||||||
//رسید
|
string title = "";
|
||||||
|
//رسید
|
||||||
if (circulationDto.Type == TypeCirculation.Receipt)
|
if (circulationDto.Type == TypeCirculation.Receipt)
|
||||||
{
|
title = "رسید";
|
||||||
//جدید
|
|
||||||
if (circulationDto.CODID==0)
|
//حواله
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//حواله
|
|
||||||
if (circulationDto.Type == TypeCirculation.Remittance)
|
if (circulationDto.Type == TypeCirculation.Remittance)
|
||||||
{
|
title = "حواله";
|
||||||
//جدید
|
|
||||||
if (circulationDto.CODID == 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
if (circulationDto.CODID == 0)
|
||||||
}
|
title += " جدید";
|
||||||
|
else title = "اطلاعات " + title;
|
||||||
// var parameters = new Dictionary<string, object>();
|
var parameters = new Dictionary<string, object>();
|
||||||
|
|
||||||
// if (ID == 0) parameters.Add("Cus", new RCustomer() { ID = 0 });
|
|
||||||
// else parameters.Add("Cus", request.list.Where(w => w.ID == ID).First().Clone());
|
|
||||||
|
|
||||||
// parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBackCustomerItem));
|
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBackItem));
|
||||||
// await modal.ShowAsync<CustomerItem>(title: ID == 0 ? "مشتری جدید" : "ویرایش اطلاعات", parameters: parameters);
|
parameters.Add("model", circulationDto);
|
||||||
|
parameters.Add("NewItem", circulationDto.CODID == 0);
|
||||||
|
parameters.Add("CODrequest", CODrequest);
|
||||||
|
await modal.ShowAsync<WarehouseItem>(title: title, parameters: parameters);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user