ExternalAccessCode
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Service">
|
||||
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
||||
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -40,14 +40,14 @@ namespace Back.Controllers
|
||||
|
||||
}
|
||||
[HttpGet("Get/{ID}/{loaddelete}")]
|
||||
public async Task<ActionResult<InvoiceDTO?>> GetAll(int ID,bool loaddelete)
|
||||
public async Task<ActionResult<InvoiceDTO?>> GetAll(int ID, bool loaddelete)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
var result = await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, ID,!loaddelete);
|
||||
var result = await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, ID, !loaddelete);
|
||||
|
||||
return result==null ? BadRequest() : Ok(result);
|
||||
return result == null ? BadRequest() : Ok(result);
|
||||
|
||||
}
|
||||
[HttpPost("Add")]
|
||||
@@ -64,7 +64,7 @@ namespace Back.Controllers
|
||||
// return BadRequest(item);
|
||||
|
||||
//-----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 user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Back.Controllers
|
||||
BillReference = null,
|
||||
IsDeleted = false,
|
||||
PatternID = item.PatternID,
|
||||
setm=1
|
||||
setm = 1
|
||||
}));
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace Back.Controllers
|
||||
|
||||
//----Check TaxPayer
|
||||
if (await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(invoice))
|
||||
return BadRequest(new List<string> { "این صورتحساب به سازمان ارسال شده"});
|
||||
return BadRequest(new List<string> { "این صورتحساب به سازمان ارسال شده" });
|
||||
//else if (invoice.invoiceType != InvoiceType.Bidding
|
||||
// && invoice.invoiceType != InvoiceType.Sale)
|
||||
//{
|
||||
@@ -227,76 +227,76 @@ namespace Back.Controllers
|
||||
{
|
||||
//if (sent)
|
||||
//{
|
||||
switch (invoiceType)
|
||||
{
|
||||
//case 0:
|
||||
// return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.CANCEL));
|
||||
switch (invoiceType)
|
||||
{
|
||||
//case 0:
|
||||
// return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.CANCEL));
|
||||
|
||||
case 3:
|
||||
return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Cancellation));
|
||||
case 3:
|
||||
return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Cancellation));
|
||||
|
||||
case 2:
|
||||
await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Repair, false);
|
||||
var result = await _servInvoice.AddInvoice(new Invoice()
|
||||
case 2:
|
||||
await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Repair, false);
|
||||
var result = await _servInvoice.AddInvoice(new Invoice()
|
||||
{
|
||||
|
||||
Title = Invoice.Title,
|
||||
Des = Invoice.Des,
|
||||
invoiceType = InvoiceType.Repair,
|
||||
CustomerID = Invoice.CustomerID,
|
||||
CompanyID = Invoice.CompanyID,
|
||||
InvoicIssueDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
InvoiceDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
LastChangeUserID = Convert.ToInt32(UserID),
|
||||
BillReference = Invoice.ID,
|
||||
IsDeleted = false,
|
||||
PatternID = Invoice.PatternID,
|
||||
setm = Invoice.setm,
|
||||
invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem
|
||||
{
|
||||
CODID = s.CODID,
|
||||
am = s.am,
|
||||
fee = s.fee,
|
||||
dis = s.dis,
|
||||
|
||||
Title = Invoice.Title,
|
||||
Des = Invoice.Des,
|
||||
invoiceType = InvoiceType.Repair,
|
||||
CustomerID = Invoice.CustomerID,
|
||||
CompanyID = Invoice.CompanyID,
|
||||
InvoicIssueDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
InvoiceDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
LastChangeUserID = Convert.ToInt32(UserID),
|
||||
BillReference = Invoice.ID,
|
||||
IsDeleted = false,
|
||||
PatternID = Invoice.PatternID,
|
||||
setm=Invoice.setm,
|
||||
invoiceDetails=Invoice.invoiceDetails.Select(s=>new InvoiceItem
|
||||
{
|
||||
CODID=s.CODID,
|
||||
am=s.am,
|
||||
fee=s.fee,
|
||||
dis=s.dis,
|
||||
}).ToList()
|
||||
}, false);
|
||||
if (result > 0)
|
||||
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, result));
|
||||
break;
|
||||
case 4:
|
||||
await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.BackFrmSale, false);
|
||||
var result1 = await _servInvoice.AddInvoice(new Invoice()
|
||||
{
|
||||
|
||||
}).ToList()
|
||||
}, false);
|
||||
if (result > 0)
|
||||
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID,result));
|
||||
break;
|
||||
case 4:
|
||||
await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.BackFrmSale, false);
|
||||
var result1 = await _servInvoice.AddInvoice(new Invoice()
|
||||
Title = Invoice.Title,
|
||||
Des = Invoice.Des,
|
||||
invoiceType = InvoiceType.BackFrmSale,
|
||||
CustomerID = Invoice.CustomerID,
|
||||
CompanyID = Invoice.CompanyID,
|
||||
InvoicIssueDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
InvoiceDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
LastChangeUserID = Convert.ToInt32(UserID),
|
||||
BillReference = Invoice.ID,
|
||||
IsDeleted = false,
|
||||
PatternID = Invoice.PatternID,
|
||||
setm = Invoice.setm,
|
||||
invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem
|
||||
{
|
||||
CODID = s.CODID,
|
||||
am = s.am,
|
||||
fee = s.fee,
|
||||
dis = s.dis,
|
||||
|
||||
Title = Invoice.Title,
|
||||
Des = Invoice.Des,
|
||||
invoiceType = InvoiceType.BackFrmSale,
|
||||
CustomerID = Invoice.CustomerID,
|
||||
CompanyID = Invoice.CompanyID,
|
||||
InvoicIssueDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
InvoiceDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
LastChangeUserID = Convert.ToInt32(UserID),
|
||||
BillReference = Invoice.ID,
|
||||
IsDeleted = false,
|
||||
PatternID = Invoice.PatternID,
|
||||
setm = Invoice.setm,
|
||||
invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem
|
||||
{
|
||||
CODID = s.CODID,
|
||||
am = s.am,
|
||||
fee = s.fee,
|
||||
dis = s.dis,
|
||||
}).ToList()
|
||||
}, false);
|
||||
if (result1 > 0)
|
||||
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, result1));
|
||||
break;
|
||||
|
||||
}).ToList()
|
||||
}, false);
|
||||
if (result1 > 0)
|
||||
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, result1));
|
||||
break;
|
||||
|
||||
default:
|
||||
return BadRequest(new List<string> { $"تغییر وضعیت از {Invoice.invoiceType.GetEnumDisplayName()} به {((InvoiceType)invoiceType).GetEnumDisplayName()} امکان پذیر نیست این صورتحساب به سامانه مودیان ارسال شده" });
|
||||
}
|
||||
default:
|
||||
return BadRequest(new List<string> { $"تغییر وضعیت از {Invoice.invoiceType.GetEnumDisplayName()} به {((InvoiceType)invoiceType).GetEnumDisplayName()} امکان پذیر نیست این صورتحساب به سامانه مودیان ارسال شده" });
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
@@ -344,62 +344,62 @@ namespace Back.Controllers
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
switch (invoiceType)
|
||||
{
|
||||
case 3:
|
||||
return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Cancellation));
|
||||
switch (invoiceType)
|
||||
{
|
||||
case 3:
|
||||
return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Cancellation));
|
||||
|
||||
case 4:
|
||||
await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.BackFrmSale, false);
|
||||
var result2 = await _servInvoice.AddInvoice(new Invoice()
|
||||
case 4:
|
||||
await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.BackFrmSale, false);
|
||||
var result2 = await _servInvoice.AddInvoice(new Invoice()
|
||||
{
|
||||
|
||||
Title = Invoice.Title,
|
||||
Des = Invoice.Des,
|
||||
invoiceType = InvoiceType.BackFrmSale,
|
||||
CustomerID = Invoice.CustomerID,
|
||||
CompanyID = Invoice.CompanyID,
|
||||
InvoicIssueDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
InvoiceDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
LastChangeUserID = Convert.ToInt32(UserID),
|
||||
BillReference = Invoice.ID,
|
||||
IsDeleted = false,
|
||||
PatternID = Invoice.PatternID,
|
||||
setm = Invoice.setm,
|
||||
invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem
|
||||
{
|
||||
CODID = s.CODID,
|
||||
am = s.am,
|
||||
fee = s.fee,
|
||||
dis = s.dis,
|
||||
|
||||
Title = Invoice.Title,
|
||||
Des = Invoice.Des,
|
||||
invoiceType = InvoiceType.BackFrmSale,
|
||||
CustomerID = Invoice.CustomerID,
|
||||
CompanyID = Invoice.CompanyID,
|
||||
InvoicIssueDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
InvoiceDate = Invoice.InvoicIssueDate.Replace("/", ""),
|
||||
LastChangeUserID = Convert.ToInt32(UserID),
|
||||
BillReference = Invoice.ID,
|
||||
IsDeleted = false,
|
||||
PatternID = Invoice.PatternID,
|
||||
setm = Invoice.setm,
|
||||
invoiceDetails =Invoice.invoiceDetails.Select(s => new InvoiceItem
|
||||
{
|
||||
CODID = s.CODID,
|
||||
am = s.am,
|
||||
fee = s.fee,
|
||||
dis = s.dis,
|
||||
}).ToList()
|
||||
}, false);
|
||||
if (result2 > 0)
|
||||
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, result2));
|
||||
break;
|
||||
|
||||
}).ToList()
|
||||
}, false);
|
||||
if (result2 > 0)
|
||||
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, result2));
|
||||
break;
|
||||
default:
|
||||
return BadRequest(new List<string> { $"تغییر وضعیت از {Invoice.invoiceType.GetEnumDisplayName()} به {((InvoiceType)invoiceType).GetEnumDisplayName()} امکان پذیر نیست این صورتحساب به سامانه مودیان ارسال شده" });
|
||||
|
||||
default:
|
||||
return BadRequest(new List<string> { $"تغییر وضعیت از {Invoice.invoiceType.GetEnumDisplayName()} به {((InvoiceType)invoiceType).GetEnumDisplayName()} امکان پذیر نیست این صورتحساب به سامانه مودیان ارسال شده" });
|
||||
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
if (Invoice.invoiceType == InvoiceType.BackFrmSale)
|
||||
{
|
||||
// if (!sent)
|
||||
// {
|
||||
switch (invoiceType)
|
||||
{
|
||||
//case 0:
|
||||
// return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.CANCEL));
|
||||
// if (!sent)
|
||||
// {
|
||||
switch (invoiceType)
|
||||
{
|
||||
//case 0:
|
||||
// return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.CANCEL));
|
||||
|
||||
case 3:
|
||||
return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Cancellation));
|
||||
default:
|
||||
return BadRequest(new List<string> { $"تغییر وضعیت از {Invoice.invoiceType.GetEnumDisplayName()} به {((InvoiceType)invoiceType).GetEnumDisplayName()} امکان پذیر نیست" });
|
||||
}
|
||||
// }
|
||||
case 3:
|
||||
return Ok(await _servInvoice.ChangeInvoiceType(Invoice, InvoiceType.Cancellation));
|
||||
default:
|
||||
return BadRequest(new List<string> { $"تغییر وضعیت از {Invoice.invoiceType.GetEnumDisplayName()} به {((InvoiceType)invoiceType).GetEnumDisplayName()} امکان پذیر نیست" });
|
||||
}
|
||||
// }
|
||||
//else
|
||||
//{
|
||||
// switch (invoiceType)
|
||||
@@ -450,7 +450,7 @@ namespace Back.Controllers
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
|
||||
var CompanyID= user?.RolUsers.First().CompanyID;
|
||||
var CompanyID = user?.RolUsers.First().CompanyID;
|
||||
|
||||
if (!await _servInvoice.ExistInvoiceByInvoiceID(CompanyID.Value, InvoiceID))
|
||||
return NotFound();
|
||||
@@ -463,7 +463,52 @@ namespace Back.Controllers
|
||||
p.StartInfo.FileName = "C:\\CreateReport\\CreateReport.exe";
|
||||
p.StartInfo.Arguments = $"{CompanyID} {InvoiceID}";
|
||||
p.Start();
|
||||
output = p.StandardOutput.ReadToEnd();
|
||||
output = p.StandardOutput.ReadToEnd();
|
||||
p.WaitForExit();
|
||||
return Ok(output);
|
||||
}
|
||||
[HttpPut("SetExternalAccessCode/{InvoiceID}")]
|
||||
public async Task<ActionResult<string>> SetExternalAccessCode(int InvoiceID)
|
||||
{ //-----GetUserAndCompany
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
|
||||
var code = Convert.ToInt32(DateTime.Now.ToString($"yMMdd{InvoiceID}Hmmss{user.RolUsers.First().CompanyID}"));
|
||||
Invoice? Invoice = await _servInvoice.GetInvoiceByInvoiceID(user.RolUsers.First().CompanyID, InvoiceID);
|
||||
if (Invoice == null) return NotFound();
|
||||
if (Invoice.ExternalAccessCode.HasValue)
|
||||
return Ok(Invoice.ExternalAccessCode.Value.ToString());
|
||||
|
||||
Invoice.ExternalAccessCode = code;
|
||||
if (await _servInvoice.UpdateInvoice(Invoice))
|
||||
return Ok(code.ToString());
|
||||
|
||||
|
||||
return BadRequest(new List<string> { "خطایی سرور" });
|
||||
|
||||
}
|
||||
[HttpGet("GetReportByExternalAccessCode/{xternalAccessCode}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<string>> GetReportByExternalAccessCode(int ExternalAccessCode)
|
||||
{
|
||||
if (ExternalAccessCode == null || ExternalAccessCode <= 0)
|
||||
return NotFound();
|
||||
|
||||
string output = "";
|
||||
var invoice = await _servInvoice.GetInvoiceByExternalAccessCode(ExternalAccessCode);
|
||||
if (invoice == null)
|
||||
return NotFound();
|
||||
|
||||
// Start the child process.
|
||||
Process p = new Process();
|
||||
// Redirect the output stream of the child process.
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.FileName = "C:\\CreateReport\\CreateReport.exe";
|
||||
p.StartInfo.Arguments = $"{invoice.CompanyID} {invoice.ID}";
|
||||
p.Start();
|
||||
output = p.StandardOutput.ReadToEnd();
|
||||
p.WaitForExit();
|
||||
return Ok(output);
|
||||
}
|
||||
|
@@ -184,109 +184,111 @@ namespace Back.Controllers
|
||||
Scln = result.scln ?? null,
|
||||
Bid = result.bid ?? null,
|
||||
};
|
||||
if (header.Inty == 1 && header.Inp == 2)
|
||||
header = new InvoiceHeaderDto
|
||||
{
|
||||
//نوع شخص خریدار
|
||||
Tob = result.tob,
|
||||
// صورتحساب نوع *
|
||||
Inty = result.inty ?? 1,
|
||||
//الگوی صورتحساب *
|
||||
Inp = result.inp ?? 1,
|
||||
//موضوع صورتحساب *
|
||||
Ins = result.ins ?? 1,
|
||||
//شماره منحصر به فرد مالیاتی
|
||||
Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
//سریال صورت حساب
|
||||
Inno = result.inno ?? null,
|
||||
//شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
Tins = result.tins ?? null,
|
||||
//مجموع مبلغ قبل از کسر تخفیف
|
||||
Tprdis = result.tprdis ?? null,
|
||||
// مجموع مبلغ پس از کسر تخفیف
|
||||
Tadis = result.tadis ?? null,
|
||||
//مجموع مالیات بر ارزش افزوده
|
||||
Tvam = result.tvam ?? null,
|
||||
// مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
Todam = result.todam ?? null,
|
||||
//صورتحساب مجموع
|
||||
Tbill = result.tbill ?? null,
|
||||
// تسویه روش
|
||||
Setm = result.setm ?? null,
|
||||
//نقدی پرداختی مبلغ
|
||||
Cap = result.cap ?? null,
|
||||
//پرداختی نسیه
|
||||
Insp = result.insp ?? null,
|
||||
//مجموع تخفیفات
|
||||
Tdis = result.tdis ?? null,
|
||||
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
//شماره اقتصادی خریدار
|
||||
Tinb = result.tinb ?? null,
|
||||
//زمان صدور
|
||||
Indatim = result.indatim ?? null,
|
||||
//زمان ایجاد
|
||||
Indati2m = result.Indati2m ?? null,
|
||||
//کد شعبه خریدار
|
||||
Bbc = result.bbc ?? null,
|
||||
Tvop = result.tvop ?? null,
|
||||
Crn = result.crn ?? null,
|
||||
Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
Scc = result.scc ?? null,
|
||||
Scln = result.scln ?? null,
|
||||
Bpn = result.bpn ?? null,
|
||||
Bid = result.bid ?? null,
|
||||
};
|
||||
if (header.Inty == 1 && header.Inp == 3)
|
||||
header = new InvoiceHeaderDto
|
||||
{
|
||||
//نوع شخص خریدار
|
||||
Tob = result.tob,
|
||||
// صورتحساب نوع *
|
||||
Inty = result.inty ?? 1,
|
||||
//الگوی صورتحساب *
|
||||
Inp = result.inp ?? 1,
|
||||
//موضوع صورتحساب *
|
||||
Ins = result.ins ?? 1,
|
||||
//شماره منحصر به فرد مالیاتی
|
||||
Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
//سریال صورت حساب
|
||||
Inno = result.inno ?? null,
|
||||
//شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
Tins = result.tins ?? null,
|
||||
//مجموع مبلغ قبل از کسر تخفیف
|
||||
Tprdis = result.tprdis ?? null,
|
||||
// مجموع مبلغ پس از کسر تخفیف
|
||||
Tadis = result.tadis ?? null,
|
||||
//مجموع مالیات بر ارزش افزوده
|
||||
Tvam = result.tvam ?? null,
|
||||
// مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
Todam = result.todam ?? null,
|
||||
//صورتحساب مجموع
|
||||
Tbill = result.tbill ?? null,
|
||||
// تسویه روش
|
||||
Setm = result.setm ?? null,
|
||||
//نقدی پرداختی مبلغ
|
||||
Cap = result.cap ?? null,
|
||||
//پرداختی نسیه
|
||||
Insp = result.insp ?? null,
|
||||
//مجموع تخفیفات
|
||||
Tdis = result.tdis ?? null,
|
||||
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
//شماره اقتصادی خریدار
|
||||
Tinb = result.tinb ?? null,
|
||||
//زمان صدور
|
||||
Indatim = result.indatim ?? null,
|
||||
//زمان ایجاد
|
||||
Indati2m = result.Indati2m ?? null,
|
||||
//کد شعبه خریدار
|
||||
Bbc = result.bbc ?? null,
|
||||
Tvop = result.tvop ?? null,
|
||||
Crn = result.crn ?? null,
|
||||
Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
Bid = result.bid ?? null,
|
||||
};
|
||||
|
||||
//if (header.Inty == 1 && header.Inp == 2)
|
||||
// header = new InvoiceHeaderDto
|
||||
// {
|
||||
// //نوع شخص خریدار
|
||||
// Tob = result.tob,
|
||||
// // صورتحساب نوع *
|
||||
// Inty = result.inty ?? 1,
|
||||
// //الگوی صورتحساب *
|
||||
// Inp = result.inp ?? 1,
|
||||
// //موضوع صورتحساب *
|
||||
// Ins = result.ins ?? 1,
|
||||
// //شماره منحصر به فرد مالیاتی
|
||||
// Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
// //سریال صورت حساب
|
||||
// Inno = result.inno ?? null,
|
||||
// //شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
// Tins = result.tins ?? null,
|
||||
// //مجموع مبلغ قبل از کسر تخفیف
|
||||
// Tprdis = result.tprdis ?? null,
|
||||
// // مجموع مبلغ پس از کسر تخفیف
|
||||
// Tadis = result.tadis ?? null,
|
||||
// //مجموع مالیات بر ارزش افزوده
|
||||
// Tvam = result.tvam ?? null,
|
||||
// // مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
// Todam = result.todam ?? null,
|
||||
// //صورتحساب مجموع
|
||||
// Tbill = result.tbill ?? null,
|
||||
// // تسویه روش
|
||||
// Setm = result.setm ?? null,
|
||||
// //نقدی پرداختی مبلغ
|
||||
// Cap = result.cap ?? null,
|
||||
// //پرداختی نسیه
|
||||
// Insp = result.insp ?? null,
|
||||
// //مجموع تخفیفات
|
||||
// Tdis = result.tdis ?? null,
|
||||
// //شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
// Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
// //شماره اقتصادی خریدار
|
||||
// Tinb = result.tinb ?? null,
|
||||
// //زمان صدور
|
||||
// Indatim = result.indatim ?? null,
|
||||
// //زمان ایجاد
|
||||
// Indati2m = result.Indati2m ?? null,
|
||||
// //کد شعبه خریدار
|
||||
// Bbc = result.bbc ?? null,
|
||||
// Tvop = result.tvop ?? null,
|
||||
// Crn = result.crn ?? null,
|
||||
// Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
// Scc = result.scc ?? null,
|
||||
// Scln = result.scln ?? null,
|
||||
// Bpn = result.bpn ?? null,
|
||||
// Bid = result.bid ?? null,
|
||||
// };
|
||||
//if (header.Inty == 1 && header.Inp == 3)
|
||||
// header = new InvoiceHeaderDto
|
||||
// {
|
||||
// //نوع شخص خریدار
|
||||
// Tob = result.tob,
|
||||
// // صورتحساب نوع *
|
||||
// Inty = result.inty ?? 1,
|
||||
// //الگوی صورتحساب *
|
||||
// Inp = result.inp ?? 1,
|
||||
// //موضوع صورتحساب *
|
||||
// Ins = result.ins ?? 1,
|
||||
// //شماره منحصر به فرد مالیاتی
|
||||
// Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
// //سریال صورت حساب
|
||||
// Inno = result.inno ?? null,
|
||||
// //شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
// Tins = result.tins ?? null,
|
||||
// //مجموع مبلغ قبل از کسر تخفیف
|
||||
// Tprdis = result.tprdis ?? null,
|
||||
// // مجموع مبلغ پس از کسر تخفیف
|
||||
// Tadis = result.tadis ?? null,
|
||||
// //مجموع مالیات بر ارزش افزوده
|
||||
// Tvam = result.tvam ?? null,
|
||||
// // مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
// Todam = result.todam ?? null,
|
||||
// //صورتحساب مجموع
|
||||
// Tbill = result.tbill ?? null,
|
||||
// // تسویه روش
|
||||
// Setm = result.setm ?? null,
|
||||
// //نقدی پرداختی مبلغ
|
||||
// Cap = result.cap ?? null,
|
||||
// //پرداختی نسیه
|
||||
// Insp = result.insp ?? null,
|
||||
// //مجموع تخفیفات
|
||||
// Tdis = result.tdis ?? null,
|
||||
// //شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
// Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
// //شماره اقتصادی خریدار
|
||||
// Tinb = result.tinb ?? null,
|
||||
// //زمان صدور
|
||||
// Indatim = result.indatim ?? null,
|
||||
// //زمان ایجاد
|
||||
// Indati2m = result.Indati2m ?? null,
|
||||
// //کد شعبه خریدار
|
||||
// Bbc = result.bbc ?? null,
|
||||
// Tvop = result.tvop ?? null,
|
||||
// Crn = result.crn ?? null,
|
||||
// Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
// Bid = result.bid ?? null,
|
||||
// };
|
||||
else return BadRequest(new List<string> { "این الگو فعلا در دسترس نمی باشد" });
|
||||
#endregion header
|
||||
List<InvoiceBodyDto> InvoiceBody = new List<InvoiceBodyDto>();
|
||||
foreach (var bitem in result.invoiceDetails)
|
||||
|
@@ -97,6 +97,7 @@ namespace Back.Data.Models
|
||||
#endregion
|
||||
|
||||
#region fild
|
||||
public int? ExternalAccessCode { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string? Des { get; set; }
|
||||
public InvoiceType invoiceType { get; set; }
|
||||
|
@@ -160,6 +160,11 @@ namespace Back.Services
|
||||
{
|
||||
return await _invoiceRepo.Get(w => w.ID == InvoiceID && w.CompanyID == CompanyID && !w.IsDeleted).AnyAsync();
|
||||
|
||||
}
|
||||
public async Task<Invoice> GetInvoiceByExternalAccessCode( int ExternalAccessCode)
|
||||
{
|
||||
return await _invoiceRepo.Get(w => w.ExternalAccessCode == ExternalAccessCode && !w.IsDeleted).FirstOrDefaultAsync();
|
||||
|
||||
}
|
||||
public async Task<bool> checkFatherInvoiceByInvoiceID(int CompanyID, int InvoiceID)
|
||||
{
|
||||
|
@@ -1,186 +1,82 @@
|
||||
<PageTitle>صورتحساب</PageTitle>
|
||||
@* @using Front.Services
|
||||
@using Shared.DTOs
|
||||
@using Stimulsoft.Base
|
||||
@using Stimulsoft.Report
|
||||
@using Stimulsoft.Report.Blazor
|
||||
@inject Fixedvalues fv;
|
||||
<PageTitle>دریافت صورتحساب</PageTitle>
|
||||
@inject IJSRuntime JS
|
||||
@inject HttpClientController hc;
|
||||
@layout EmptyLayout *@
|
||||
@page "/InvoiceReport/{InvoiceID:int}"
|
||||
@* <StiBlazorViewer Report="@Report" /> *@
|
||||
<Preload LoadingText="در حال بارگذاری..." />
|
||||
<Toasts class="p-3" Messages="messages" Placement="ToastsPlacement.MiddleCenter" />
|
||||
@page "/InvoiceReport/{ExternalAccessCode:int}"
|
||||
@using Front.Services
|
||||
|
||||
@code {
|
||||
// public CompanyDTO? company { get; set; }
|
||||
// private StiReport Report;
|
||||
// [Parameter] public int InvoiceID { get; set; }
|
||||
// private int[] NoArray = default;
|
||||
// private int[] ItemArray = new int[] { 1011, 1012 };
|
||||
// private string[] ItemNArray = new string[] { "کالا 1", "کالا 2" };
|
||||
// private int[] amArray = new int[] { 1, 2 };
|
||||
// private string[] UnitNArray = new string[] { "1011", "1012" };
|
||||
// private string[] feeArray = new string[] { "کالا 1", "کالا 2" };
|
||||
// private string[] prdisArray = new string[] { "", "" };
|
||||
// private string[] disArray = new string[] { "1011", "1012" };
|
||||
// private string[] adisArray = new string[] { "کالا 1", "کالا 2" };
|
||||
// private string[] vamArray = new string[] { " 1, 2" };
|
||||
// private string[] tsstamArray = new string[] { "1011", "1012" };
|
||||
// private string[] vraArray = new string[] { "کالا 1", "کالا 2" };
|
||||
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||
List<ToastMessage> messages = new List<ToastMessage>();
|
||||
[Parameter] public int ExternalAccessCode { get; set; }
|
||||
protected async override Task OnParametersSetAsync()
|
||||
{
|
||||
if (ExternalAccessCode == null || ExternalAccessCode <= 0)
|
||||
ShowReport();
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
|
||||
// protected async override Task OnParametersSetAsync()
|
||||
// {
|
||||
// if (fv.invoice==null)
|
||||
// {
|
||||
// hc._nav.NavigateTo($"InvoiceDetails/{InvoiceID}");
|
||||
// }
|
||||
// string CustomerName = "";
|
||||
// string CustomerEconomicCode = "";
|
||||
// string CustomerPhone = "";
|
||||
// string CompanyName = "";
|
||||
// string CompanyEconomicCode = "";
|
||||
// string CompanyPhone = "";
|
||||
// var cus =await GetCus();
|
||||
// if (cus!=null)
|
||||
// {
|
||||
// CustomerName = cus?.FullName;
|
||||
// CustomerEconomicCode = cus?.EconomicCode;
|
||||
// CustomerPhone = cus?.Phone;
|
||||
// }
|
||||
// var company =await GetCompany();
|
||||
// if (company != null)
|
||||
// {
|
||||
// CompanyName = company?.Name;
|
||||
// CompanyEconomicCode = company?.EconomicCode;
|
||||
// CompanyPhone = company?.Phone;
|
||||
// }
|
||||
// //datasource
|
||||
// NoArray = Enumerable
|
||||
// .Repeat(1, (int)((fv.invoice.items.Count() - 1) / 1) + 1)
|
||||
// .Select((tr, ti) => Convert.ToInt32(tr + (1 * ti)))
|
||||
// .ToArray();
|
||||
// ItemArray = fv.invoice.items.Select(s => s.CODID).ToArray();
|
||||
// ItemNArray = fv.invoice.items.Select(s => s.sstt).ToArray();
|
||||
// amArray = fv.invoice.items.Select(s => Convert.ToInt32(s.am)).ToArray();
|
||||
// UnitNArray= fv.invoice.items.Select(s => s.mu).ToArray();
|
||||
// feeArray = fv.invoice.items.Select(s => s.fee.ToString("N0")).ToArray();
|
||||
// prdisArray = fv.invoice.items.Select(s => s.prdis?.ToString("N0")).ToArray();
|
||||
// disArray = fv.invoice.items.Select(s => s.dis?.ToString("N0")).ToArray();
|
||||
// adisArray = fv.invoice.items.Select(s => s.adis?.ToString("N0")).ToArray();
|
||||
// vamArray = fv.invoice.items.Select(s => s.vam?.ToString("N0")).ToArray();
|
||||
// tsstamArray = fv.invoice.items.Select(s => s.tsstam?.ToString("N0")).ToArray();
|
||||
// vraArray = fv.invoice.items.Select(s => s.vra?.ToString("N0")).ToArray();
|
||||
|
||||
|
||||
// // //How to activate
|
||||
// // Stimulsoft.Base.StiLicense.Key =
|
||||
// // "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k" +
|
||||
// // "4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Ux" +
|
||||
// // "a30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1" +
|
||||
// // "xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/C" +
|
||||
// // "jX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLr" +
|
||||
// // "pU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0" +
|
||||
// // "Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dw" +
|
||||
// // "Ms2fQ0yOUG/xornE";
|
||||
// //var licenseStream = await Http.GetStreamAsync("Secret/license.key");
|
||||
// //Stimulsoft.Base.StiLicense.LoadFromStream(licenseStream);
|
||||
|
||||
// //Create empty report object
|
||||
// this.Report = new StiReport();
|
||||
|
||||
// //Load report template
|
||||
// var reportBytes = await hc._hc.GetByteArrayAsync($"Invoice/GetReport/{InvoiceID}");
|
||||
|
||||
|
||||
// //Set value
|
||||
// Report["InvoiceID"] = fv.invoice?.ID;
|
||||
// Report["invoicedate"] = fv.invoice?.InvoiceDate;
|
||||
// Report["CusName"] = CustomerName;
|
||||
// Report["CusEconomicCode"] = CustomerEconomicCode;
|
||||
// Report["CusPhone"] = CustomerPhone;
|
||||
// Report["CompanyName"] = CompanyName;
|
||||
// Report["CompanyEconomicCode"] = CompanyEconomicCode;
|
||||
// Report["CompanyPhone"] = CompanyPhone;
|
||||
|
||||
// // var rspCustomer = await hc.Get($"Customer/GetCustomer/{fv.invoice?.CustomerID}");
|
||||
// // if (rspCustomer.IsSuccessStatusCode)
|
||||
// // Cus = await rspCustomer.Content.ReadFromJsonAsync<RCustomer>();
|
||||
|
||||
// // var rspCompany = await hc.Get($"Company/GetCompany");
|
||||
// // if (rspCompany.IsSuccessStatusCode)
|
||||
// // company = await rspCompany.Content.ReadFromJsonAsync<CompanyDTO>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// // Report["cusname"] = CustomerName;
|
||||
|
||||
|
||||
|
||||
// this.Report.Load(reportBytes);
|
||||
|
||||
// //Create User Data
|
||||
// var stiUserData1 = new Stimulsoft.Report.Dictionary.StiUserData();
|
||||
// stiUserData1.Columns.AddRange(new Stimulsoft.Report.Dictionary.StiDataColumn[] {
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("No", "No", "No", typeof(int), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("Item", "Item", "Item", typeof(int), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("ItemN", "ItemN", "ItemN", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("am", "am", "am", typeof(int), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("UnitN", "UnitN", "UnitN", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("fee", "fee", "fee", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("prdis", "prdis", "prdis", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("dis", "dis", "dis", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("adis", "adis", "adis", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("vam", "vam", "vam", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("tsstam", "tsstam", "tsstam", typeof(string), null),
|
||||
// new Stimulsoft.Report.Dictionary.StiDataColumn("vra", "vra", "vra", typeof(string), null)
|
||||
|
||||
// });
|
||||
// stiUserData1.Count = fv.invoice.items.Count();
|
||||
// stiUserData1.GetData += new Stimulsoft.Report.Dictionary.StiUserGetDataEventHandler(stiUserData1_GetData);
|
||||
|
||||
// //Register new data in the report template
|
||||
// this.Report.RegData("Items", stiUserData1);
|
||||
|
||||
|
||||
// await base.OnParametersSetAsync();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// private void stiUserData1_GetData(object sender, Stimulsoft.Report.Dictionary.StiUserGetDataEventArgs e)
|
||||
// {
|
||||
// if (e.ColumnName == "No") e.Data = NoArray[e.Position];
|
||||
// if (e.ColumnName == "Item") e.Data = ItemArray[e.Position];
|
||||
// if (e.ColumnName == "ItemN") e.Data = ItemNArray[e.Position];
|
||||
// if (e.ColumnName == "am") e.Data = amArray[e.Position];
|
||||
// if (e.ColumnName == "UnitN") e.Data = UnitNArray[e.Position];
|
||||
// if (e.ColumnName == "fee") e.Data = feeArray[e.Position];
|
||||
// if (e.ColumnName == "prdis") e.Data = prdisArray[e.Position];
|
||||
// if (e.ColumnName == "dis") e.Data = disArray[e.Position];
|
||||
// if (e.ColumnName == "adis") e.Data = adisArray[e.Position];
|
||||
// if (e.ColumnName == "vam") e.Data = vamArray[e.Position];
|
||||
// if (e.ColumnName == "tsstam") e.Data = tsstamArray[e.Position];
|
||||
// if (e.ColumnName == "vra") e.Data = vraArray[e.Position];
|
||||
// }
|
||||
|
||||
}
|
||||
@functions{
|
||||
// private async Task<RCustomer?> GetCus()
|
||||
// {
|
||||
// var rspCustomer = await hc.Get($"Customer/GetCustomer/{fv.invoice?.CustomerID}");
|
||||
// if (rspCustomer.IsSuccessStatusCode)
|
||||
// return await rspCustomer.Content.ReadFromJsonAsync<RCustomer>();
|
||||
// else return null;
|
||||
// }
|
||||
// private async Task<CompanyDTO?> GetCompany()
|
||||
// {
|
||||
// var rspCompany = await hc.Get($"Company/GetCompany");
|
||||
// if (rspCompany.IsSuccessStatusCode)
|
||||
// return await rspCompany.Content.ReadFromJsonAsync<CompanyDTO>();
|
||||
// else return null;
|
||||
// }
|
||||
@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 async Task ShowReport()
|
||||
{
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
var rsp = await hc.Get($"Invoice/GetReportByExternalAccessCode/{ExternalAccessCode}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var str = await rsp.Content.ReadAsStringAsync();
|
||||
if (string.IsNullOrEmpty(str))
|
||||
ShowMessage(ToastType.Warning, "مشکلی در ساخت فایل رخ داده لطفا مجدد تلاش کنید");
|
||||
else
|
||||
await DownloadFileFromStream(str, $"{ExternalAccessCode}.pdf");
|
||||
}
|
||||
else if (rsp.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
ShowMessage(ToastType.Warning, "فاکتوری یافت نشد");
|
||||
|
||||
else ShowMessage(ToastType.Warning, "خطایی در چاپ فاکتور");
|
||||
|
||||
PreloadService.Hide();
|
||||
}
|
||||
//for download
|
||||
private Stream GetFileStream(byte[] bytes)
|
||||
{
|
||||
var fileStream = new MemoryStream(bytes);
|
||||
|
||||
return fileStream;
|
||||
}
|
||||
private async Task DownloadFileFromStream(string Base64, string FileName)
|
||||
{
|
||||
byte[] bytes = System.Convert.FromBase64String(Base64);
|
||||
|
||||
var fileStream = GetFileStream(bytes);
|
||||
// var fileName = "log.bin";
|
||||
|
||||
using var streamRef = new DotNetStreamReference(stream: fileStream);
|
||||
|
||||
await JS.InvokeVoidAsync("downloadFileFromStream", FileName, streamRef);
|
||||
}
|
||||
|
||||
}
|
||||
<script>
|
||||
window.downloadFileFromStream = async (fileName, contentStreamReference) => {
|
||||
const arrayBuffer = await contentStreamReference.arrayBuffer();
|
||||
const blob = new Blob([arrayBuffer]);
|
||||
const url = URL.createObjectURL(blob);
|
||||
const anchorElement = document.createElement('a');
|
||||
anchorElement.href = url;
|
||||
anchorElement.download = fileName ?? '';
|
||||
anchorElement.click();
|
||||
anchorElement.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
</script>
|
@@ -14,6 +14,14 @@
|
||||
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||
<PageTitle>جزئیات صورتحساب</PageTitle>
|
||||
|
||||
<Modal @ref="Codemodal" title="لینک برای دانلود" IsVerticallyCentered="true">
|
||||
<BodyTemplate>
|
||||
@ExUrl
|
||||
</BodyTemplate>
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
||||
</FooterTemplate>
|
||||
</Modal>
|
||||
|
||||
@if (invoice.IsDeleted)
|
||||
{
|
||||
@@ -334,7 +342,9 @@
|
||||
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="ShowReport" Type="ButtonType.Button">
|
||||
pdf
|
||||
</Button>
|
||||
|
||||
<Button class="mt-3" Color="ButtonColor.Secondary" @onclick="onClickExternalAccessCode" Type="ButtonType.Button">
|
||||
لینک
|
||||
</Button>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,6 +379,8 @@
|
||||
|
||||
|
||||
@code {
|
||||
private Modal Codemodal = default!;
|
||||
|
||||
public bool SendInvoice { get; set; } = false;
|
||||
List<ToastMessage> messages = new List<ToastMessage>();
|
||||
private ConfirmDialog dialog = default!;
|
||||
@@ -383,7 +395,7 @@
|
||||
public List<ForCustomerSearch>? Cus { get; set; }
|
||||
public List<IdName<int>>? Patterns { get; set; }
|
||||
public InvoiceDTO? invoice { get; set; }
|
||||
|
||||
public string ExUrl { get; set; } = "";
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
fv.invoice = null;
|
||||
@@ -421,6 +433,12 @@
|
||||
}
|
||||
}
|
||||
@functions {
|
||||
|
||||
|
||||
private async Task OnHideModalClick()
|
||||
{
|
||||
await Codemodal.HideAsync();
|
||||
}
|
||||
private void ShowMessage(ToastType toastType, string msg) => messages.Add(CreateToastMessage(toastType, msg));
|
||||
|
||||
private ToastMessage CreateToastMessage(ToastType toastType, string msg)
|
||||
@@ -474,6 +492,31 @@
|
||||
hc._nav.NavigateTo($"TaxPayerInvoiceItem/{InvoiceID}");
|
||||
}
|
||||
}
|
||||
private async Task onClickExternalAccessCode()
|
||||
{
|
||||
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
var rsp = await hc.Put($"Invoice/SetExternalAccessCode/{InvoiceID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var str = await rsp.Content.ReadAsStringAsync();
|
||||
if (string.IsNullOrEmpty(str))
|
||||
ShowDangerAlert("مشکلی در ساخت فایل رخ داده لطفا مجدد تلاش کنید");
|
||||
else
|
||||
{
|
||||
ExUrl = "http://195.88.208.142/InvoiceReport/"+ str;
|
||||
await Codemodal.ShowAsync();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
|
||||
PreloadService.Hide();
|
||||
}
|
||||
private async Task ShowReport()
|
||||
{
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
|
@@ -37,10 +37,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
||||
|
||||
//Home
|
||||
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/") });
|
||||
|
||||
//farzan
|
||||
//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");
|
||||
|
||||
|
Reference in New Issue
Block a user