ExternalAccessCode
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user