This commit is contained in:
mmrbnjd
2024-06-08 21:48:26 +03:30
parent 39dbbf03d8
commit eddbc54c4c
7 changed files with 150 additions and 93 deletions

View File

@@ -35,7 +35,7 @@
<ItemGroup>
<Reference Include="Service">
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
<HintPath>..\..\Dlls\Service.dll</HintPath>
</Reference>
</ItemGroup>

View File

@@ -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,

View File

@@ -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,9 +131,14 @@ 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; }
}
//مبلغ نسیه

View File

@@ -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<T>(_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))

View File

@@ -39,8 +39,8 @@
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"))
{
@@ -50,6 +50,18 @@
@decimal.Parse(property.GetValue(item, null).ToString()).ToString("N0") ريال
</td>
}
else if (property.Name.ToLower() == "id")
{
if (id > 0)
{
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">@property.GetValue(item, null)</button></td>
}
else
{
<td><button type="button" class="btn btn-link disabled">@property.GetValue(item, null)</button></td>
}
}
else
{
<td>@property.GetValue(item, null)</td>
@@ -58,7 +70,7 @@
}
}
if (id>0)
if (id > 0)
{
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">ویرایش</button></td>
}

View File

@@ -7,7 +7,27 @@
<ConfirmDialog @ref="dialog" />
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
<PageTitle>آماده سازی صورتحساب</PageTitle>
@* alert *@
<div class="row">
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
<Icon Name="@alertIconName" class="me-2"></Icon>
@alertMessage
</Alert>
</div>
<div class="row">
<div class="col-md-12">
<div class="card mb-4">
<h4 style="color:red;" class="card-header">توجه</h4>
<div class="card-body">
<p>1) این یک پیش نمایش کامل از صورتحساب شماست با دقت آنرا بررسی کنید</p>
<p>2) یسری از فیلدها قابل دسترس هستند میتوانید در این مرحله اطلاعات تکمیلی بیشتری برای صورتحساب وارد کنید</p>
<p>3) فیلد هایی که قابل دسترسی نیستند به صورت خودکار از صورتحساب پر شده اند</p>
<p>4) فیلد های قرمز را حتما مشخص کنید</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card mb-4">
@@ -34,7 +54,7 @@
{
<select @bind="item.Value" class="form-control" aria-label="Default select example">
<option value="100" style="color: #b5b5b5; " selected>@item.fName...</option>
<option style="color: #b5b5b5; " selected>@item.fName...</option>
@foreach (var itema in item.DefVals)
{
if (itema.ID == item.Value)
@@ -78,13 +98,14 @@
<div class="row">
<div class="col-md-12">
<div class="card mb-4">
<h5 class="card-header">اطلاعات تکمیلی بدنه صورتحساب</h5>
<h5 class="card-header">اطلاعات تکمیلی بدنه صورتحساب (کالاها)</h5>
<div class="card-body">
@if (invoice?.Bodys != null)
{
<Accordion>
@foreach (var item in invoice?.Bodys)
{<div class="col-md-12">
{
<div class="col-md-12">
<div class="card mb-4">
<AccordionItem Title="@item.filds.Where(w=>w.eName=="sstt").Select(s=>s.Value).First()">
<Content>
@@ -150,22 +171,27 @@
</div>
</div>
</div>
</div>
</div>
@* action *@
<div class="row">
@if (invoice!=null)
{
@* action *@
<div class="row">
<div class="col-md-12">
<div class="mb-2">
<div class="row">
<div class="col-md-12">
<div class="col-auto">
<button type="submit" @onclick="Send" class="btn btn-primary">ارسال</button>
<button type="submit" @onclick="Send" class="btn btn-primary">آماده سازی و ارسال</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
@code {
private ConfirmDialog dialog = default!;
@@ -181,13 +207,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 +231,12 @@
var response = await rsp.Content.ReadFromJsonAsync<bool>();
if (response)
{
ShowSuccessAlert("آماده سازی با موفقیت انجام شد");
ShowMessage(ToastType.Success, "آماده سازی با موفقیت انجام شد");
}
else
{
ShowDangerAlert("خطای در آماده سازی اطلاعات رخ داده");
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
}
}
else
@@ -226,7 +262,7 @@
}
private async Task LoadData()
{
PreloadService.Show(SpinnerColor.Dark);
var rsp = await hc.Get($"TaxPayer/GetInvoice/{InvoiceID}");
if (rsp.IsSuccessStatusCode)
{
@@ -237,6 +273,6 @@
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
ShowDangerAlert(request[0]);
}
PreloadService.Hide();
}
}

View File

@@ -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");