...
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Service">
|
<Reference Include="Service">
|
||||||
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@@ -6,10 +6,12 @@ using Shared.DTOs;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Back.Common;
|
using Back.Common;
|
||||||
using Back.Validations;
|
using Back.Validations;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
namespace Back.Controllers
|
namespace Back.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
|
[Authorize]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class CODController : ControllerBase
|
public class CODController : ControllerBase
|
||||||
{
|
{
|
||||||
@@ -45,6 +47,7 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
[HttpGet("GetUnits")]
|
[HttpGet("GetUnits")]
|
||||||
|
[AllowAnonymous]
|
||||||
public async Task<ActionResult<List<IdName<int>>>> GetUnits()
|
public async Task<ActionResult<List<IdName<int>>>> GetUnits()
|
||||||
{
|
{
|
||||||
return Ok(await _servCOD.GetUnits());
|
return Ok(await _servCOD.GetUnits());
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
using Back.Data.Models;
|
using Back.Data.Models;
|
||||||
using Back.Services;
|
using Back.Services;
|
||||||
using Back.Validations;
|
using Back.Validations;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Shared.DTOs;
|
using Shared.DTOs;
|
||||||
@@ -10,6 +11,7 @@ using Shared.DTOs.Serch;
|
|||||||
namespace Back.Controllers
|
namespace Back.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
|
[Authorize]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class InvoiceController : ControllerBase
|
public class InvoiceController : ControllerBase
|
||||||
{
|
{
|
||||||
@@ -36,7 +38,7 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
[HttpGet("Get/{ID}")]
|
[HttpGet("Get/{ID}")]
|
||||||
public async Task<ActionResult<PagingDto<InvoiceGridDTO>?>> GetAll(int ID)
|
public async Task<ActionResult<InvoiceGridDTO>?> GetAll(int ID)
|
||||||
{
|
{
|
||||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
var UserID = claim.Value;
|
var UserID = claim.Value;
|
||||||
|
@@ -2,6 +2,8 @@
|
|||||||
using Back.Data.Models;
|
using Back.Data.Models;
|
||||||
using Back.Services;
|
using Back.Services;
|
||||||
using Back.Validations;
|
using Back.Validations;
|
||||||
|
using FluentValidation;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Shared.DTOs;
|
using Shared.DTOs;
|
||||||
@@ -10,6 +12,7 @@ using System.Net;
|
|||||||
namespace Back.Controllers
|
namespace Back.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
|
[Authorize]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class InvoiceItemController : ControllerBase
|
public class InvoiceItemController : ControllerBase
|
||||||
{
|
{
|
||||||
@@ -26,8 +29,8 @@ namespace Back.Controllers
|
|||||||
_servInvoice = servInvoice;
|
_servInvoice = servInvoice;
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpPost("AddItem/{invoiceID}")]
|
[HttpPost("AddItem")]
|
||||||
public async Task<ActionResult<bool>> AddItem([FromRoute] int invoiceID, [FromBody] InvoiceItemDTO model)
|
public async Task<ActionResult<bool>> AddItem([FromBody]InvoiceItemAction<InvoiceItemDTO> model)
|
||||||
{
|
{
|
||||||
//-----GetUserAndCompany
|
//-----GetUserAndCompany
|
||||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
@@ -35,12 +38,12 @@ 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, invoiceID, model, eActionValidation.add));
|
var resultValidationmodel = await _validationInvoiceItem.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, invoiceID);
|
Invoice invoice = await _servInvoice.GetInvoiceByInvoiceID(user.RolUsers.First().CompanyID, model.invoiceID);
|
||||||
if (invoice == null)
|
if (invoice == null)
|
||||||
return BadRequest(new List<string> { "invoice notFound..." });
|
return BadRequest(new List<string> { "invoice notFound..." });
|
||||||
|
|
||||||
@@ -51,11 +54,11 @@ namespace Back.Controllers
|
|||||||
{
|
{
|
||||||
return Ok(await _servInvoiceItem.Add(new InvoiceItem
|
return Ok(await _servInvoiceItem.Add(new InvoiceItem
|
||||||
{
|
{
|
||||||
am=model.am,
|
am=model.item.am,
|
||||||
fee=model.fee,
|
fee=model.item.fee,
|
||||||
dis=model.dis,
|
dis=model.item.dis,
|
||||||
CODID=model.CODID,
|
CODID=model.item.CODID,
|
||||||
InvoiceID=invoiceID,
|
InvoiceID=model.invoiceID,
|
||||||
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -63,8 +66,8 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpPut("UpdateItem/{invoiceID}")]
|
[HttpPut("UpdateItem")]
|
||||||
public async Task<ActionResult<bool>> UpdateItem([FromRoute] int invoiceID, [FromBody] InvoiceItemDTO model)
|
public async Task<ActionResult<bool>> UpdateItem([FromBody] InvoiceItemAction<InvoiceItemDTO> model)
|
||||||
{
|
{
|
||||||
//-----GetUserAndCompany
|
//-----GetUserAndCompany
|
||||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
@@ -72,33 +75,33 @@ 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, invoiceID, model, eActionValidation.update));
|
var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.update));
|
||||||
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, invoiceID);
|
Invoice invoice = await _servInvoice.GetInvoiceByInvoiceID(user.RolUsers.First().CompanyID, model.invoiceID);
|
||||||
if (invoice == null)
|
if (invoice == null)
|
||||||
return BadRequest(new List<string> { "invoice notFound..." });
|
return BadRequest(new List<string> { "invoice notFound..." });
|
||||||
|
|
||||||
|
|
||||||
var invoiceitem=await _servInvoiceItem.Getinvoiceitem(user.RolUsers.First().CompanyID, invoiceID, model.ID.Value);
|
var invoiceitem=await _servInvoiceItem.Getinvoiceitem(user.RolUsers.First().CompanyID, model.invoiceID, model.item.ID.Value);
|
||||||
if (invoiceitem == null)
|
if (invoiceitem == null)
|
||||||
return BadRequest(new List<string> { "invoice Item notFound..." });
|
return BadRequest(new List<string> { "invoice Item notFound..." });
|
||||||
|
|
||||||
if (invoice.invoiceType==InvoiceType.BackFrmSale && invoiceitem.am < model.am)
|
if (invoice.invoiceType==InvoiceType.BackFrmSale && invoiceitem.am < model.item.am)
|
||||||
return BadRequest(new List<string> { "در حالت برگشت از فروش تعداد آیتم فقط میتواند کاهشی باشد" });
|
return BadRequest(new List<string> { "در حالت برگشت از فروش تعداد آیتم فقط میتواند کاهشی باشد" });
|
||||||
|
|
||||||
invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
||||||
|
|
||||||
if (invoice.invoiceType == InvoiceType.BackFrmSale)
|
if (invoice.invoiceType == InvoiceType.BackFrmSale)
|
||||||
invoiceitem.am = model.am;
|
invoiceitem.am = model.item.am;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
invoiceitem.am = model.am;
|
invoiceitem.am = model.item.am;
|
||||||
invoiceitem.fee = model.fee;
|
invoiceitem.fee = model.item.fee;
|
||||||
invoiceitem.dis = model.dis;
|
invoiceitem.dis = model.item.dis;
|
||||||
invoiceitem.CODID = model.CODID;
|
invoiceitem.CODID = model.item.CODID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _servInvoice.UpdateInvoice(invoice))
|
if (await _servInvoice.UpdateInvoice(invoice))
|
||||||
@@ -108,34 +111,32 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpDelete("DeleteItem/{invoiceID}/{invoiceItemID}")]
|
[HttpDelete("DeleteItem/{InvoiceItemID}")]
|
||||||
public async Task<ActionResult<bool>> DeleteItem([FromRoute] int invoiceID, [FromRoute] int invoiceItemID)
|
public async Task<ActionResult<bool>> DeleteItem(int InvoiceItemID)
|
||||||
{
|
{
|
||||||
|
|
||||||
//-----GetUserAndCompany
|
//-----GetUserAndCompany
|
||||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
var UserID = claim.Value;
|
var UserID = claim.Value;
|
||||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||||
|
|
||||||
//-----Validaton
|
|
||||||
var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, invoiceID, new InvoiceItemDTO(), eActionValidation.delete)) ;
|
|
||||||
if (!resultValidationmodel.IsValid)
|
|
||||||
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
|
||||||
|
|
||||||
//-----Get invoice
|
//-----Get invoice
|
||||||
Invoice invoice = await _servInvoice.GetInvoiceByInvoiceID(user.RolUsers.First().CompanyID, invoiceID);
|
var invoiceitem = await _servInvoiceItem.GetInvoiceItemByInvoiceItemID(user.RolUsers.First().CompanyID, InvoiceItemID);
|
||||||
if (invoice == null)
|
|
||||||
return NotFound(new List<string> { "invoice notFound..." });
|
|
||||||
|
|
||||||
|
|
||||||
var invoiceitem = await _servInvoiceItem.Getinvoiceitem(user.RolUsers.First().CompanyID, invoiceID, invoiceItemID);
|
|
||||||
if (invoiceitem == null)
|
if (invoiceitem == null)
|
||||||
return NotFound(new List<string> { "invoice Item notFound..." });
|
return NotFound(new List<string> { "invoice Item notFound..." });
|
||||||
|
|
||||||
invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
//-----Validaton
|
||||||
|
var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, invoiceitem.InvoiceID.Value, new InvoiceItemDTO(), eActionValidation.delete)) ;
|
||||||
|
if (!resultValidationmodel.IsValid)
|
||||||
|
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (await _servInvoice.UpdateInvoice(invoice))
|
invoiceitem.invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (await _servInvoice.UpdateInvoice(invoiceitem.invoice))
|
||||||
return Ok(await _servInvoiceItem.Delete(invoiceitem));
|
return Ok(await _servInvoiceItem.Delete(invoiceitem));
|
||||||
|
|
||||||
else return BadRequest(new List<string> { "خطایی رخ داده" });
|
else return BadRequest(new List<string> { "خطایی رخ داده" });
|
||||||
|
@@ -138,7 +138,7 @@ namespace Back.Data.Models
|
|||||||
}
|
}
|
||||||
//مبلغ نسیه
|
//مبلغ نسیه
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? insp { get; set; }
|
public decimal? insp { get; set; } = 0;
|
||||||
//مالیات موضوع ماده 17
|
//مالیات موضوع ماده 17
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public string? seventeentax { get; set; }
|
public string? seventeentax { get; set; }
|
||||||
|
@@ -19,10 +19,10 @@ namespace Back.Data.Models
|
|||||||
// شرح کاال/خدمت
|
// شرح کاال/خدمت
|
||||||
[MaxLength(13)]
|
[MaxLength(13)]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||||
public string? sstt { get { return cODItem.Title; } }
|
public string? sstt { get { return cODItem != null ? cODItem.Title : null; } }
|
||||||
//واحد اندازهگیری
|
//واحد اندازهگیری
|
||||||
[MaxLength(8)]
|
[MaxLength(8)]
|
||||||
public string? mu { get { return cODItem.CODUnit.UnitTaxID; } }
|
public string? mu { get { return cODItem != null ? cODItem.CODUnit.UnitTaxID : null; } }
|
||||||
//میزان ارز
|
//میزان ارز
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? cfee { get { return fee / exr; } }
|
public decimal? cfee { get { return fee / exr; } }
|
||||||
@@ -30,8 +30,8 @@ namespace Back.Data.Models
|
|||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? vam { get
|
public decimal? vam { get
|
||||||
{
|
{
|
||||||
return invoice.pattern.inp == 9 ? fee*vra/100 :
|
return invoice?.pattern?.inp == 9 ? fee*vra/100 :
|
||||||
invoice.pattern.inp == 13 ? ((tcpbs+9)/100)+((prdis*vra)/100)
|
invoice?.pattern?.inp == 13 ? ((tcpbs+9)/100)+((prdis*vra)/100)
|
||||||
: vra * adis / 100;
|
: vra * adis / 100;
|
||||||
} }
|
} }
|
||||||
//جمع کل اجرت ،حق العمل و سود
|
//جمع کل اجرت ،حق العمل و سود
|
||||||
@@ -39,33 +39,38 @@ namespace Back.Data.Models
|
|||||||
public decimal? tcpbs { get { return consfee + spro + bros; } }
|
public decimal? tcpbs { get { return consfee + spro + bros; } }
|
||||||
//سهم نقدی از پرداخت
|
//سهم نقدی از پرداخت
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? cop { get { return (tsstam * invoice.cap) / invoice.tadis; } }
|
public decimal? cop { get { return (tsstam * invoice?.cap) / invoice?.tadis; } }
|
||||||
//سهم مالیات بر ارزش افزوده از پرداخت
|
//سهم مالیات بر ارزش افزوده از پرداخت
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? vop { get { return vra == 0 ? 0 : (vam * invoice.cap) / invoice.tadis; } }
|
public decimal? vop { get { return vra == 0 ? 0 : (vam * invoice?.cap) / invoice?.tadis; } }
|
||||||
//مبلغ کل کالا/خدمت
|
//مبلغ کل کالا/خدمت
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? tsstam { get
|
public decimal? tsstam { get
|
||||||
{
|
{
|
||||||
return invoice.pattern.inp == 9 ? fee+vam :
|
if (invoice==null || invoice.pattern==null)
|
||||||
invoice.pattern.inp == 10 ? sscv + vam + odam + olam :
|
{
|
||||||
invoice.pattern.inp == 4 ? prdis + vam + odam + olam :
|
return vam + adis;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return invoice?.pattern?.inp == 9 ? fee+vam :
|
||||||
|
invoice?.pattern?.inp == 10 ? sscv + vam + odam + olam :
|
||||||
|
invoice?.pattern?.inp == 4 ? prdis + vam + odam + olam :
|
||||||
vam + adis + odam + olam;
|
vam + adis + odam + olam;
|
||||||
} }
|
} }
|
||||||
//مبلغ بعد از تخفیف
|
//مبلغ بعد از تخفیف
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? adis { get
|
public decimal? adis { get
|
||||||
{
|
{
|
||||||
return invoice.pattern.inp == 13 ? prdis+ tcpbs - dis: prdis - dis;
|
return invoice?.pattern?.inp == 13 ? prdis+ tcpbs - dis: prdis - dis;
|
||||||
} }
|
} }
|
||||||
//مبلغ قبل از تخفیف
|
//مبلغ قبل از تخفیف
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? prdis { get { return am * fee; } }
|
public decimal? prdis { get { return am * fee; } }
|
||||||
//نرخ مالیات بر ازش افزوده
|
//نرخ مالیات بر ازش افزوده
|
||||||
[MaxLength(5)]
|
[MaxLength(5)]
|
||||||
public decimal? vra { get { return cODItem.TaxRate; } }
|
public decimal? vra { get { return cODItem != null ? cODItem.TaxRate : null; } }
|
||||||
//واحد اندازه گیری عنوان
|
//واحد اندازه گیری عنوان
|
||||||
public string? unitTitle { get { return cODItem.CODUnit.Title; } }
|
public string? unitTitle { get { return cODItem!=null ? cODItem.CODUnit.Title : null; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region fild
|
#region fild
|
||||||
@@ -86,13 +91,13 @@ namespace Back.Data.Models
|
|||||||
public decimal? exr { get; set; }
|
public decimal? exr { get; set; }
|
||||||
//ارزش ریالی کالا
|
//ارزش ریالی کالا
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? ssrv { get; set; }
|
public decimal? ssrv { get; set; } = 0;
|
||||||
//ارزش ارزی کالا
|
//ارزش ارزی کالا
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? sscv { get; set; }
|
public decimal? sscv { get; set; } = 0;
|
||||||
//مبلغ تخفیف
|
//مبلغ تخفیف
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? dis { get; set; }
|
public decimal? dis { get; set; } = 0;
|
||||||
//موضوع سایر مالیات و عوارض
|
//موضوع سایر مالیات و عوارض
|
||||||
[MaxLength(255)]
|
[MaxLength(255)]
|
||||||
public string? odt { get; set; }
|
public string? odt { get; set; }
|
||||||
@@ -101,7 +106,7 @@ namespace Back.Data.Models
|
|||||||
public decimal? odr { get; set; }
|
public decimal? odr { get; set; }
|
||||||
//مبلغ سایر مالیات و عواض
|
//مبلغ سایر مالیات و عواض
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? odam { get; set; }
|
public decimal? odam { get; set; } = 0;
|
||||||
//موضوع سایر وجوه قانونی
|
//موضوع سایر وجوه قانونی
|
||||||
[MaxLength(255)]
|
[MaxLength(255)]
|
||||||
public string? olt { get; set; }
|
public string? olt { get; set; }
|
||||||
@@ -110,16 +115,16 @@ namespace Back.Data.Models
|
|||||||
public decimal? olr { get; set; }
|
public decimal? olr { get; set; }
|
||||||
//مبلغ سایر وجوه قانونی
|
//مبلغ سایر وجوه قانونی
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? olam { get; set; }
|
public decimal? olam { get; set; } = 0;
|
||||||
//اجرت دساخت
|
//اجرت دساخت
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? consfee { get; set; }
|
public decimal? consfee { get; set; } = 0;
|
||||||
//سود فروشنده
|
//سود فروشنده
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? spro { get; set; }
|
public decimal? spro { get; set; } = 0;
|
||||||
//حق العمل
|
//حق العمل
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? bros { get; set; }
|
public decimal? bros { get; set; } = 0;
|
||||||
//شناسه یکتای ثبت قرارداد حق العمل کاری
|
//شناسه یکتای ثبت قرارداد حق العمل کاری
|
||||||
[MaxLength(12)]
|
[MaxLength(12)]
|
||||||
public string? bsrn { get; set; }
|
public string? bsrn { get; set; }
|
||||||
|
@@ -24,17 +24,20 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
#region AdvancedSearch
|
#region AdvancedSearch
|
||||||
var invok = _invoiceRepo
|
var invok = _invoiceRepo
|
||||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted && w.ID==ID);
|
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted && w.ID == ID);
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
//-----------------------
|
//-----------------------
|
||||||
return await invok
|
return await invok
|
||||||
.Include(inc => inc.invoiceDetails)
|
.Include(inc => inc.invoiceDetails)
|
||||||
.Include(inc => inc.payments)
|
.ThenInclude(inc => inc.cODItem)
|
||||||
.Include(inc => inc.pattern)
|
.ThenInclude(inc => inc.CODUnit)
|
||||||
|
//.Include(inc => inc.payments)
|
||||||
|
//.Include(inc => inc.pattern)
|
||||||
.Select(s => new InvoiceDTO()
|
.Select(s => new InvoiceDTO()
|
||||||
{
|
{
|
||||||
|
|
||||||
PatternID = s.PatternID,
|
PatternID = s.PatternID,
|
||||||
PatternTitle = s.pattern.Title,
|
PatternTitle = s.pattern.Title,
|
||||||
CustomerID = s.CustomerID,
|
CustomerID = s.CustomerID,
|
||||||
@@ -56,30 +59,32 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
ID = x.ID,
|
ID = x.ID,
|
||||||
CODID = x.CODID,
|
CODID = x.CODID,
|
||||||
//adis = x.adis,
|
adis = x.adis,
|
||||||
am = x.am.Value,
|
am = x.am.Value,
|
||||||
dis = x.dis,
|
dis = x.dis,
|
||||||
fee = x.fee.Value,
|
fee = x.fee.Value,
|
||||||
mu = x.unitTitle,
|
mu = x.unitTitle,
|
||||||
sstt = x.sstt,
|
sstt = x.sstt,
|
||||||
tsstam = x.tsstam,
|
tsstam = x.tsstam,
|
||||||
vam = x.am,
|
vam = x.vam,
|
||||||
vra = x.vra
|
vra = x.vra,
|
||||||
}).ToList(),
|
prdis = x.prdis
|
||||||
payments = s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
|
||||||
{
|
|
||||||
ID = x.ID,
|
|
||||||
acn = x.acn,
|
|
||||||
iinn = x.acn,
|
|
||||||
pcn = x.acn,
|
|
||||||
pdt = x.pdt,
|
|
||||||
PaymentDateTime=x.PaymentDateTime,
|
|
||||||
pid = x.pid,
|
|
||||||
pmt = x.pmt,
|
|
||||||
pv = x.pv,
|
|
||||||
trmn = x.trmn,
|
|
||||||
trn = x.acn
|
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
payments = new List<InvoicePaymentDTO>() //s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||||
|
//{
|
||||||
|
// ID = x.ID,
|
||||||
|
// acn = x.acn,
|
||||||
|
// iinn = x.acn,
|
||||||
|
// pcn = x.acn,
|
||||||
|
// pdt = x.pdt,
|
||||||
|
// PaymentDateTime=x.PaymentDateTime,
|
||||||
|
// pid = x.pid,
|
||||||
|
// pmt = x.pmt,
|
||||||
|
// pv = x.pv,
|
||||||
|
// trmn = x.trmn,
|
||||||
|
// trn = x.acn
|
||||||
|
//}).ToList()
|
||||||
|
,
|
||||||
})
|
})
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
@@ -107,10 +112,13 @@ namespace Back.Services
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
return await invok
|
return await invok
|
||||||
.Include(inc => inc.invoiceDetails)
|
.Include(inc => inc.invoiceDetails)
|
||||||
.Include(inc => inc.payments)
|
.ThenInclude(inc => inc.cODItem)
|
||||||
.Include(inc => inc.pattern)
|
.ThenInclude(inc => inc.CODUnit)
|
||||||
|
//.Include(inc => inc.payments)
|
||||||
|
//.Include(inc => inc.pattern)
|
||||||
.Select(s => new InvoiceGridDTO()
|
.Select(s => new InvoiceGridDTO()
|
||||||
{
|
{
|
||||||
|
|
||||||
CustomerID = s.CustomerID,
|
CustomerID = s.CustomerID,
|
||||||
CustomerName = s.Customer.FullName,
|
CustomerName = s.Customer.FullName,
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
@@ -121,6 +129,7 @@ namespace Back.Services
|
|||||||
tdis = s.tdis,
|
tdis = s.tdis,
|
||||||
tvam = s.tvam,
|
tvam = s.tvam,
|
||||||
Udate = s.Udate.ShamciToFormatShamci(),
|
Udate = s.Udate.ShamciToFormatShamci(),
|
||||||
|
|
||||||
})
|
})
|
||||||
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,13 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
return await _invoiceitemRepo.Get(w => w.InvoiceID == invoiceID && w.ID == invoiceitemID && w.invoice.CompanyID == companyID).AnyAsync();
|
return await _invoiceitemRepo.Get(w => w.InvoiceID == invoiceID && w.ID == invoiceitemID && w.invoice.CompanyID == companyID).AnyAsync();
|
||||||
}
|
}
|
||||||
|
public async Task<InvoiceItem?> GetInvoiceItemByInvoiceItemID(int CompanyID, int InvoiceItemID)
|
||||||
|
{
|
||||||
|
return await _invoiceitemRepo
|
||||||
|
.Get(w => w.ID == InvoiceItemID && w.invoice.CompanyID == CompanyID && !w.invoice.IsDeleted)
|
||||||
|
.Include(s=>s.invoice)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
public async Task<InvoiceItem> Getinvoiceitem(int companyID, int invoiceID, int invoiceitemID)
|
public async Task<InvoiceItem> Getinvoiceitem(int companyID, int invoiceID, int invoiceitemID)
|
||||||
{
|
{
|
||||||
return await _invoiceitemRepo.Get(w => w.InvoiceID == invoiceID && w.ID == invoiceitemID && w.invoice.CompanyID == companyID).FirstOrDefaultAsync();
|
return await _invoiceitemRepo.Get(w => w.InvoiceID == invoiceID && w.ID == invoiceitemID && w.invoice.CompanyID == companyID).FirstOrDefaultAsync();
|
||||||
|
@@ -105,7 +105,7 @@ namespace Shared.DTOs
|
|||||||
//مبلغ قبل از تخفیف
|
//مبلغ قبل از تخفیف
|
||||||
public decimal? prdis { get; set; }
|
public decimal? prdis { get; set; }
|
||||||
//مبلغ بعد از تخفیف
|
//مبلغ بعد از تخفیف
|
||||||
[MaxLength(18)]
|
|
||||||
public decimal? adis { get; set; }
|
public decimal? adis { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
Shared/DTOs/InvoiceItemAction.cs
Normal file
14
Shared/DTOs/InvoiceItemAction.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Shared.DTOs
|
||||||
|
{
|
||||||
|
public class InvoiceItemAction<T>
|
||||||
|
{
|
||||||
|
public int invoiceID { get; set; }
|
||||||
|
public T item { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -3,6 +3,7 @@
|
|||||||
@inject HttpClientController hc;
|
@inject HttpClientController hc;
|
||||||
@inject Fixedvalues fv;
|
@inject Fixedvalues fv;
|
||||||
<ConfirmDialog @ref="dialog" />
|
<ConfirmDialog @ref="dialog" />
|
||||||
|
<Toasts class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
@* alert *@
|
@* alert *@
|
||||||
@@ -116,7 +117,7 @@ else
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Inject] ToastService ToastService { get; set; } = default!;
|
List<ToastMessage> messages = new List<ToastMessage>();
|
||||||
private ConfirmDialog dialog = default!;
|
private ConfirmDialog dialog = default!;
|
||||||
// alert
|
// alert
|
||||||
AlertColor alertColor = AlertColor.Primary;
|
AlertColor alertColor = AlertColor.Primary;
|
||||||
@@ -147,6 +148,14 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@functions {
|
@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,
|
||||||
|
};
|
||||||
private void ShowSuccessAlert(string msg)
|
private void ShowSuccessAlert(string msg)
|
||||||
{
|
{
|
||||||
Hidealert = false;
|
Hidealert = false;
|
||||||
@@ -164,25 +173,25 @@ else
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
private async Task prdisAsync()
|
private async Task prdisAsync()
|
||||||
{
|
{
|
||||||
if (itemDTO.ID == null)
|
// if (itemDTO.ID == null)
|
||||||
itemDTO.prdis = itemDTO.fee * itemDTO.am;
|
itemDTO.prdis = itemDTO.fee * itemDTO.am;
|
||||||
}
|
}
|
||||||
private async Task adisAsync()
|
private async Task adisAsync()
|
||||||
{
|
{
|
||||||
if (itemDTO.ID == null)
|
// if (itemDTO.ID == null)
|
||||||
itemDTO.adis = itemDTO.prdis - itemDTO.dis;
|
itemDTO.adis = itemDTO.prdis - itemDTO.dis;
|
||||||
|
|
||||||
// await AftervamAsync();
|
// await AftervamAsync();
|
||||||
}
|
}
|
||||||
private async Task vamAsync()
|
private async Task vamAsync()
|
||||||
{
|
{
|
||||||
if (itemDTO.ID == null)
|
// if (itemDTO.ID == null)
|
||||||
itemDTO.vam = itemDTO.vra * itemDTO.adis / 100;
|
itemDTO.vam = itemDTO.vra * itemDTO.adis / 100;
|
||||||
}
|
}
|
||||||
private async Task tsstamAsync()
|
private async Task tsstamAsync()
|
||||||
{
|
{
|
||||||
if (itemDTO.ID == null)
|
// if (itemDTO.ID == null)
|
||||||
itemDTO.tsstam = itemDTO.vam + itemDTO.adis;
|
itemDTO.tsstam = itemDTO.vam + itemDTO.adis;
|
||||||
}
|
}
|
||||||
private async Task AfterAsync()
|
private async Task AfterAsync()
|
||||||
{
|
{
|
||||||
@@ -195,7 +204,7 @@ else
|
|||||||
public async Task OnClickDelete()
|
public async Task OnClickDelete()
|
||||||
{
|
{
|
||||||
|
|
||||||
var rsp = await hc.Delete($"InvoiceItem/DeleteItem/{InvoiceID}/{itemDTO.ID}");
|
var rsp = await hc.Delete($"InvoiceItem/DeleteItem/{itemDTO.ID}");
|
||||||
if (rsp.IsSuccessStatusCode)
|
if (rsp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||||
@@ -243,7 +252,12 @@ else
|
|||||||
ShowDangerAlert("مبلغ تخفیف درست نیست");
|
ShowDangerAlert("مبلغ تخفیف درست نیست");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var rsp = await hc.Put<InvoiceItemDTO>($"InvoiceItem/UpdateItem/{InvoiceID}", itemDTO);
|
var rsp = await hc.Put<InvoiceItemAction<InvoiceItemDTO>>($"InvoiceItem/UpdateItem"
|
||||||
|
, new InvoiceItemAction<InvoiceItemDTO>
|
||||||
|
{
|
||||||
|
invoiceID=InvoiceID,
|
||||||
|
item = itemDTO
|
||||||
|
});
|
||||||
if (rsp.IsSuccessStatusCode)
|
if (rsp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||||
@@ -287,7 +301,11 @@ else
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var rsp = await hc.Post<InvoiceItemDTO>($"InvoiceItem/AddItem/{InvoiceID}", itemDTO);
|
var rsp = await hc.Post<InvoiceItemAction<InvoiceItemDTO>>($"InvoiceItem/AddItem", new InvoiceItemAction<InvoiceItemDTO>
|
||||||
|
{
|
||||||
|
invoiceID = InvoiceID,
|
||||||
|
item = itemDTO
|
||||||
|
});
|
||||||
if (rsp.IsSuccessStatusCode)
|
if (rsp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||||
@@ -313,7 +331,7 @@ else
|
|||||||
{
|
{
|
||||||
var confirmation = await dialog.ShowAsync(
|
var confirmation = await dialog.ShowAsync(
|
||||||
title: "عملیات حذف آیتم صورتحساب",
|
title: "عملیات حذف آیتم صورتحساب",
|
||||||
message1: $"از حذف آیتم {itemDTO.ID} از صورتحساب {InvoiceID}",
|
message1: $"از حذف کالای {itemDTO.sstt} از صورتحساب {InvoiceID}",
|
||||||
message2: "اطمینان دارید?");
|
message2: "اطمینان دارید?");
|
||||||
|
|
||||||
if (confirmation)
|
if (confirmation)
|
||||||
@@ -322,7 +340,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ToastService.Notify(new ToastMessage(ToastType.Secondary, $"عملیات حذف متوقف شد"));
|
ShowMessage(ToastType.Secondary, "عملیات حذف متوقف شد");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,9 @@
|
|||||||
<Modal @ref="modal" />
|
<Modal @ref="modal" />
|
||||||
|
|
||||||
<Grid TItem="InvoiceItemDTO"
|
<Grid TItem="InvoiceItemDTO"
|
||||||
Class="table table-hover table-bordered table-striped"
|
AllowRowClick="true"
|
||||||
|
AllowSorting="true"
|
||||||
|
Class="table table-hover"
|
||||||
DataProvider="DataProvider"
|
DataProvider="DataProvider"
|
||||||
AllowPaging="true"
|
AllowPaging="true"
|
||||||
PageSize="10"
|
PageSize="10"
|
||||||
@@ -12,35 +14,35 @@
|
|||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="شناسه">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="شناسه">
|
||||||
@context.ID
|
@context.ID
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="کد">
|
@* <GridColumn TItem="InvoiceItemDTO" HeaderText="کد">
|
||||||
@context.CODID
|
@context.CODID
|
||||||
</GridColumn>
|
</GridColumn> *@
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="کالا">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="کالا">
|
||||||
@context.sstt
|
@context.sstt
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="واحد">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="واحد">
|
||||||
@context.mu
|
@context.mu
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="تعداد/مقدار">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="تعداد">
|
||||||
@context.am
|
@context.am.ToString().Split('٫')[0]
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ واحد">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ واحد">
|
||||||
@context.fee
|
@context.fee.ToString("N0")
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="نرخ مالیات">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="نرخ مالیات">
|
||||||
@context.vra
|
@context.vra
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ مالیات">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ مالیات">
|
||||||
@context.vam
|
@context.vam?.ToString("N0")
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="تخفیف">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="تخفیف">
|
||||||
@context.dis
|
@context.dis?.ToString("N0")
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
@* <GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ بعد از تخفیف">
|
@* <GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ بعد از تخفیف">
|
||||||
@context.adis
|
@context.adis
|
||||||
</GridColumn> *@
|
</GridColumn> *@
|
||||||
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ کل">
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ کل">
|
||||||
@context.tsstam
|
@context.tsstam?.ToString("N0")
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -88,11 +90,11 @@
|
|||||||
if (result.Status == ComponentStatus.success)
|
if (result.Status == ComponentStatus.success)
|
||||||
msg="آیتم با موفقیت حذف شد";
|
msg="آیتم با موفقیت حذف شد";
|
||||||
}
|
}
|
||||||
|
await OnMultipleOfThree.InvokeAsync(msg);
|
||||||
// if (result.Status == ComponentStatus.success)
|
// if (result.Status == ComponentStatus.success)
|
||||||
// await LoadCod(1);
|
// await LoadCod(1);
|
||||||
|
|
||||||
await modal.HideAsync();
|
// await modal.HideAsync();
|
||||||
}
|
}
|
||||||
private IEnumerable<InvoiceItemDTO> GetInvoiceItems()
|
private IEnumerable<InvoiceItemDTO> GetInvoiceItems()
|
||||||
{
|
{
|
||||||
|
@@ -44,7 +44,17 @@
|
|||||||
|
|
||||||
if (property.CustomAttributes.Any(w => w.AttributeType.Name == "DisplayAttribute"))
|
if (property.CustomAttributes.Any(w => w.AttributeType.Name == "DisplayAttribute"))
|
||||||
{
|
{
|
||||||
<td>@property.GetValue(item, null)</td>
|
if (property.PropertyType == typeof(Nullable<System.Decimal>) || property.PropertyType == typeof(System.Decimal))
|
||||||
|
{
|
||||||
|
<td>
|
||||||
|
@decimal.Parse(property.GetValue(item, null).ToString()).ToString("N0") ريال
|
||||||
|
</td>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<td>@property.GetValue(item, null)</td>
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -122,17 +122,21 @@
|
|||||||
<InputText style=" text-align: center;" @bind-Value="invoice.InvoiceDate" type="text" class="form-control" id="inputInvoiceDate" placeholder="تاریخ" />
|
<InputText style=" text-align: center;" @bind-Value="invoice.InvoiceDate" type="text" class="form-control" id="inputInvoiceDate" placeholder="تاریخ" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
||||||
{
|
{
|
||||||
|
|
||||||
<br /> <hr class="hr" />
|
<br /> <hr class="hr" />
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<Tabs NavStyle="NavStyle.VerticalUnderline">
|
<Tabs NavStyle="NavStyle.VerticalUnderline">
|
||||||
<Tab Title="آیتم ها" IsActive="InvoiceID==0 || InvoiceID==null ? false : true">
|
<Tab Title="آیتم ها" IsActive="true">
|
||||||
<Content>
|
<Content>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="form-group col-md-11">
|
<div class="form-group col-md-11">
|
||||||
<LGridInvoiceItem InvoiceID="InvoiceID??0" OnMultipleOfThree="EventCallback.Factory.Create<string>(this, CallBack)" InvoiceItems="invoice.items" />
|
@if (InvoiceID.HasValue && invoice.items.Count > 0)
|
||||||
|
{
|
||||||
|
<LGridInvoiceItem InvoiceID="InvoiceID.Value" OnMultipleOfThree="EventCallback.Factory.Create<string>(this, CallBack)" InvoiceItems="invoice.items" />
|
||||||
|
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-1">
|
<div class="form-group col-md-1">
|
||||||
|
|
||||||
@@ -229,7 +233,7 @@
|
|||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
PreloadService.Show(SpinnerColor.Dark);
|
|
||||||
Cus = await fv.GetCustomers();
|
Cus = await fv.GetCustomers();
|
||||||
Patterns = await fv.GetPatterns();
|
Patterns = await fv.GetPatterns();
|
||||||
if (InvoiceID != null && InvoiceID > 0)
|
if (InvoiceID != null && InvoiceID > 0)
|
||||||
@@ -252,7 +256,7 @@
|
|||||||
|
|
||||||
Hidealert = true;
|
Hidealert = true;
|
||||||
alertMessage = "";
|
alertMessage = "";
|
||||||
PreloadService.Hide();
|
|
||||||
await base.OnParametersSetAsync();
|
await base.OnParametersSetAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,6 +277,7 @@
|
|||||||
}
|
}
|
||||||
private async Task LoadData()
|
private async Task LoadData()
|
||||||
{
|
{
|
||||||
|
PreloadService.Show(SpinnerColor.Dark);
|
||||||
var rsp = await hc.Get($"Invoice/Get/{InvoiceID}");
|
var rsp = await hc.Get($"Invoice/Get/{InvoiceID}");
|
||||||
if (rsp.IsSuccessStatusCode)
|
if (rsp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
@@ -280,6 +285,8 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
hc._nav.NavigateTo("/Panel");
|
hc._nav.NavigateTo("/Panel");
|
||||||
|
|
||||||
|
PreloadService.Hide();
|
||||||
}
|
}
|
||||||
public async Task CallBack(ActionInResultComponent result)
|
public async Task CallBack(ActionInResultComponent result)
|
||||||
{
|
{
|
||||||
|
@@ -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");
|
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user