...
This commit is contained in:
@@ -67,9 +67,9 @@ namespace Back.Controllers
|
|||||||
}
|
}
|
||||||
[HttpGet("GetUnits")]
|
[HttpGet("GetUnits")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<ActionResult<List<IdName<int>>>> GetUnits()
|
public async Task<ActionResult<List<IdName<int>>>> GetUnits(bool UnitTaxID=false)
|
||||||
{
|
{
|
||||||
return Ok(await _servCOD.GetUnits());
|
return Ok(await _servCOD.GetUnits(UnitTaxID));
|
||||||
}
|
}
|
||||||
[HttpPost("Add")]
|
[HttpPost("Add")]
|
||||||
public async Task<ActionResult<bool>> Add(RCOD item)
|
public async Task<ActionResult<bool>> Add(RCOD item)
|
||||||
|
@@ -466,5 +466,10 @@ namespace Back.Controllers
|
|||||||
{
|
{
|
||||||
return Ok(await _servTaxPayer.GetPatterns(true));
|
return Ok(await _servTaxPayer.GetPatterns(true));
|
||||||
}
|
}
|
||||||
|
[HttpGet("GetUnits")]
|
||||||
|
public async Task<ActionResult<List<IdName<int>>>> GetUnits()
|
||||||
|
{
|
||||||
|
return Ok(await _servTaxPayer.GetUnits());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ namespace Back.Services
|
|||||||
}
|
}
|
||||||
public string GenerateTaxid(string FactorNo, string InvoiceDate)
|
public string GenerateTaxid(string FactorNo, string InvoiceDate)
|
||||||
{
|
{
|
||||||
// return "testTaxid";
|
return "testTaxid";
|
||||||
return TaxApiService.Instance.TaxIdGenerator.GenerateTaxId(_UniqueMemory,
|
return TaxApiService.Instance.TaxIdGenerator.GenerateTaxId(_UniqueMemory,
|
||||||
Convert.ToInt64(FactorNo), InvoiceDate.ToMiladi());
|
Convert.ToInt64(FactorNo), InvoiceDate.ToMiladi());
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,7 @@ namespace Back.Services
|
|||||||
//-------------------internal
|
//-------------------internal
|
||||||
public async Task<bool> login(int CompanyID)
|
public async Task<bool> login(int CompanyID)
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#region TokenTax
|
#region TokenTax
|
||||||
|
@@ -71,9 +71,12 @@ namespace Back.Services
|
|||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
public async Task<List<IdName<int>>> GetUnits()
|
public async Task<List<IdName<int>>> GetUnits(bool byUnitTaxID)
|
||||||
{
|
{
|
||||||
return await _UnitRepo.GetAll().Select(s => new IdName<int> { ID = s.ID, Title = s.Title }).ToListAsync();
|
if(byUnitTaxID)
|
||||||
|
return await _UnitRepo.GetAll().Select(s => new IdName<int> { ID =Convert.ToInt32( s.UnitTaxID.Trim()), Title = s.Title }).ToListAsync();
|
||||||
|
else
|
||||||
|
return await _UnitRepo.GetAll().Select(s => new IdName<int> { ID = s.ID, Title = s.Title }).ToListAsync();
|
||||||
}
|
}
|
||||||
public async Task<CODItem?> GetCodByCodID(int CodID, int CompanyID)
|
public async Task<CODItem?> GetCodByCodID(int CodID, int CompanyID)
|
||||||
{
|
{
|
||||||
|
@@ -60,6 +60,11 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
return await _repoBillType.GetAll().Select(s => new IdName<int> { ID = s.inty, Title = s.Title }).ToListAsync();
|
return await _repoBillType.GetAll().Select(s => new IdName<int> { ID = s.inty, Title = s.Title }).ToListAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
public async Task<List<IdName<int>>> GetUnits()
|
||||||
|
{
|
||||||
|
return await _repoBillType.GetAll().Select(s => new IdName<int> { ID = s.inty, Title = s.Title }).ToListAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
public async Task<bool> UpdateInvoice(Invoice invoice)
|
public async Task<bool> UpdateInvoice(Invoice invoice)
|
||||||
{
|
{
|
||||||
|
@@ -14,6 +14,7 @@ namespace Front
|
|||||||
private List<IdName<int>>? Patterns = null;
|
private List<IdName<int>>? Patterns = null;
|
||||||
private List<IdName<int>>? Patternsbyinp = null;
|
private List<IdName<int>>? Patternsbyinp = null;
|
||||||
private List<IdName<int>>? BillTypes = null;
|
private List<IdName<int>>? BillTypes = null;
|
||||||
|
private List<IdName<int>>? UnitsbyUnitTaxID = null;
|
||||||
private List<IdName<int>>? Units = null;
|
private List<IdName<int>>? Units = null;
|
||||||
private List<CODIdName<int>>? Cods = null;
|
private List<CODIdName<int>>? Cods = null;
|
||||||
private CompanyDTO? InfoCompany = null;
|
private CompanyDTO? InfoCompany = null;
|
||||||
@@ -84,6 +85,20 @@ namespace Front
|
|||||||
|
|
||||||
return Patternsbyinp;
|
return Patternsbyinp;
|
||||||
}
|
}
|
||||||
|
public async Task<List<IdName<int>>?> GetUnitsbyUnitTaxID()
|
||||||
|
{
|
||||||
|
if (UnitsbyUnitTaxID == null)
|
||||||
|
{
|
||||||
|
var request = await _hc.Get($"COD/GetUnits?UnitTaxID=true");
|
||||||
|
if (request.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
UnitsbyUnitTaxID = await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return UnitsbyUnitTaxID;
|
||||||
|
}
|
||||||
public async Task<List<IdName<int>>?> GetBillTypes()
|
public async Task<List<IdName<int>>?> GetBillTypes()
|
||||||
{
|
{
|
||||||
if (BillTypes == null)
|
if (BillTypes == null)
|
||||||
|
@@ -133,7 +133,7 @@ else
|
|||||||
}
|
}
|
||||||
else if (item.eName.ToLower() == "inp")
|
else if (item.eName.ToLower() == "inp")
|
||||||
{
|
{
|
||||||
patt=item.Value;
|
patt = item.Value;
|
||||||
var _patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
var _patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
||||||
<input value="@_patt" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
<input value="@_patt" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (item.eName.ToLower() == "tob")
|
else if (item.eName.ToLower() == "tob")
|
||||||
{
|
{
|
||||||
CustomerType foo = (CustomerType)Enum.Parse(typeof(CustomerType), item.Value);
|
CustomerType foo = (CustomerType)Enum.Parse(typeof(CustomerType), item.Value);
|
||||||
<input value="@foo.GetEnumDisplayName()" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
<input value="@foo.GetEnumDisplayName()" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
@@ -249,7 +249,20 @@ else
|
|||||||
}
|
}
|
||||||
else if (itemB.InputBox == "autofild" || (itemB.eName.ToLower() == "_cfee" && patt != "2"))
|
else if (itemB.InputBox == "autofild" || (itemB.eName.ToLower() == "_cfee" && patt != "2"))
|
||||||
{
|
{
|
||||||
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
@if (itemB.eName.ToLower() == "mu")
|
||||||
|
{
|
||||||
|
|
||||||
|
var mu = units.Where(w => w.ID == Convert.ToInt32(itemB.Value)).Select(s => s.Title).FirstOrDefault();
|
||||||
|
|
||||||
|
<input value="@mu" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -258,6 +271,8 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -310,6 +325,7 @@ else
|
|||||||
string patt = "";
|
string patt = "";
|
||||||
private List<IdName<int>>? Patterns = new List<IdName<int>>();
|
private List<IdName<int>>? Patterns = new List<IdName<int>>();
|
||||||
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
|
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
|
||||||
|
private List<IdName<int>>? units = new List<IdName<int>>();
|
||||||
private Modal modal = default!;
|
private Modal modal = default!;
|
||||||
private ConfirmDialog dialog = default!;
|
private ConfirmDialog dialog = default!;
|
||||||
[Parameter] public int? InvoiceID { get; set; }
|
[Parameter] public int? InvoiceID { get; set; }
|
||||||
@@ -328,7 +344,7 @@ else
|
|||||||
PreloadService.Show(SpinnerColor.Dark);
|
PreloadService.Show(SpinnerColor.Dark);
|
||||||
Patterns = await fv.GetPatternsbyinp();
|
Patterns = await fv.GetPatternsbyinp();
|
||||||
BillTypes = await fv.GetBillTypes();
|
BillTypes = await fv.GetBillTypes();
|
||||||
|
units = await fv.GetUnitsbyUnitTaxID();
|
||||||
await LoadData();
|
await LoadData();
|
||||||
PreloadService.Hide();
|
PreloadService.Hide();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user