NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

public async Task<InvoiceMasterModelForHourlyEmployee> GetHourlyEmployeeListForInvoice(string startDate, string endDate)
{
try
{
InvoiceMasterModelForHourlyEmployee invoiceMasterModelForHourlyEmployee = new();
List<InvoiceModelForHourlyEmployee> invoiceModelListForHourlyEmployee = new();
DateTime.TryParseExact(startDate, AppConstants.DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime parsedStartDate);
DateTime.TryParseExact(endDate, AppConstants.DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime parsedEndDate);
var invoiceHoursHelper = await helperRepository.GetInvoiceHoursHelperAsync();
var empForms = await helperRepository.GetDivisionCodesAsync();
var externalConsultingHoursHelper = await helperRepository.GetExternalConsultingHoursHelperAsync();
var w2HoursHelperAsync = await helperRepository.GetW2HoursHelperAsync();
var usa1099HoursHelperAsync = await helperRepository.Get1099USAHoursHelperAsync();
var pr480PayrollHelperAsync = await helperRepository.Get480PRPayrollHelperAsync();
var employeeTimesheets = await helperRepository.GetApprovedEmployeeTimesheetsAsync(parsedStartDate, parsedEndDate);
var getRegularHoursDate = helperRepository.GetRegularHoursDate(startDate, endDate);
var getExternalConsultingSalaryList = await helperRepository.GetCandidatesRecordModelForInvoices(startDate, endDate);
var getHRDetailsAsync = await helperRepository.GetHRDetailsAsync();

if (parsedStartDate != DateTime.MinValue && parsedEndDate != DateTime.MinValue)
{
foreach (var item in getExternalConsultingSalaryList.DistinctBy(x => new { x.CandidateId, x.BillingStartId, x.BillingRecId }))
{
if (string.IsNullOrEmpty(item.SalaryEndDate) || (DateTime.TryParseExact(item.SalaryEndDate, AppConstants.SalaryEndDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime salaryEndDate) && salaryEndDate >= parsedStartDate))
{
if (item.EffectiveDate <= parsedEndDate)
{
if (item.SalaryApproved == AppConstants.One)
{
if (item.CompanyId != InvoiceConstants.SMX && item.CompanyId != InvoiceConstants.SMXServicesConsultingInc && item.CompanyId != InvoiceConstants.SMXUSA && item.CompanyId != InvoiceConstants.SMXUSAFL && item.CompanyId != InvoiceConstants.InfolasticSMXSalesforce)
{
if (item.Division == AppConstants.ECHoursDivisionCode || item.Division == AppConstants.W2HoursDivisionCode || item.Division == AppConstants.USA1099DivisionCode || item.Division == AppConstants.PR480DivisionCode)
{
if (item.Division == AppConstants.USA1099DivisionCode)
{
if (item.SalaryPer == AppConstants.Hourly)
{
InvoiceModelForHourlyEmployee invoiceModelForHourlyEmployee = CreateInvoiceForHourlyEmployee(item, startDate, endDate, parsedStartDate, parsedEndDate, empForms, externalConsultingHoursHelper, w2HoursHelperAsync, usa1099HoursHelperAsync, pr480PayrollHelperAsync, employeeTimesheets, getRegularHoursDate, invoiceHoursHelper, getHRDetailsAsync);
invoiceModelListForHourlyEmployee.Add(invoiceModelForHourlyEmployee);
}
}
else
{
InvoiceModelForHourlyEmployee invoiceModelForHourlyEmployee = CreateInvoiceForHourlyEmployee(item, startDate, endDate, parsedStartDate, parsedEndDate, empForms, externalConsultingHoursHelper, w2HoursHelperAsync, usa1099HoursHelperAsync, pr480PayrollHelperAsync, employeeTimesheets, getRegularHoursDate, invoiceHoursHelper, getHRDetailsAsync);
invoiceModelListForHourlyEmployee.Add(invoiceModelForHourlyEmployee);
}
}
}
}
}
}
}
}
invoiceMasterModelForHourlyEmployee.InvoiceModelListForHourlyEmployee = invoiceModelListForHourlyEmployee;
return invoiceMasterModelForHourlyEmployee;
}
catch (Exception exception)
{
Log.Error($"Error in GetHourlyEmployeeListForInvoice: {exception.Message}");
throw;
}
}

/// <summary>
/// Create Invoice For Hourly Employee
/// </summary>
/// <param name="item"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="parsedStartDate"></param>
/// <param name="parsedEndDate"></param>
/// <param name="empForms"></param>
/// <param name="externalConsultingHoursHelper"></param>
/// <param name="w2HoursHelperAsync"></param>
/// <param name="usa1099HoursHelperAsync"></param>
/// <param name="pr480PayrollHelperAsync"></param>
/// <param name="employeeTimesheets"></param>
/// <param name="getRegularHoursDate"></param>
/// <returns></returns>
private InvoiceModelForHourlyEmployee CreateInvoiceForHourlyEmployee(CandidatesRecordModel item, string startDate, string endDate,
DateTime parsedStartDate, DateTime parsedEndDate, List<DivisionCode> empForms, List<ECHoursHelper> externalConsultingHoursHelper, List<W2HoursHelper> w2HoursHelperAsync,
List<USA1099HoursHelper> usa1099HoursHelperAsync, List<PR480PayrollHelper> pr480PayrollHelperAsync, List<EmployeeTimesheet> employeeTimesheets, SendData getRegularHoursDate,
List<InvoiceHoursHelper> invoiceHoursHelper, List<HRTable> getHRDetailsAsync)
{
try
{
InvoiceModelForHourlyEmployee invoiceModelForHourlyEmployee = new();
if (item.Division != null)
{
var empForm = empForms.Where(d => d.DivisionCodes == item.Division).Select(s => s.DivisionName).FirstOrDefault();
if (empForm != null)
{
invoiceModelForHourlyEmployee.Form = empForm;
}
}

var hrDetails = getHRDetailsAsync.FirstOrDefault(x => x.EmployeeId == item.CandidateId);
if (!String.IsNullOrEmpty(hrDetails?.FirstName) && !String.IsNullOrEmpty(hrDetails?.LastName) && hrDetails.FirstName != hrDetails.LastName)
{
invoiceModelForHourlyEmployee.LastName = hrDetails.LastName;
invoiceModelForHourlyEmployee.FirstName = hrDetails.FirstName;
invoiceModelForHourlyEmployee.ITEM = $"{hrDetails.FirstName} {hrDetails.LastName}";
}
else
{
invoiceModelForHourlyEmployee.LastName = item.LastName;
invoiceModelForHourlyEmployee.FirstName = item.FirstName;
invoiceModelForHourlyEmployee.ITEM = $"{item.FirstName} {item.LastName}";
}
invoiceModelForHourlyEmployee.Status = "";
invoiceModelForHourlyEmployee.Customer = item.CompanyName;

if (item.BillRatePer != null && item.BillRate != null)
{
decimal billRate = Convert.ToDecimal(objectCalculation.GetBillRate(item.BillRatePer, item.BillRate));
if (billRate != 0)
{
invoiceModelForHourlyEmployee.PriceBillRate = $"${billRate.ToString(AppConstants.DefaultFiveDigits)}";
invoiceModelForHourlyEmployee.BillRate = billRate.ToString();
}
}
invoiceModelForHourlyEmployee.ClientContact = item.ClientContact;
var invoiceHrsHelper = invoiceHoursHelper.Where(x => x.StartId == item.BillingStartId).FirstOrDefault();
invoiceModelForHourlyEmployee.InvoiceHourlyHelperTableId = invoiceHrsHelper?.Id;
invoiceModelForHourlyEmployee.PONumber = item.PONumber;

string invoiceNumber = GenerateInvoiceNumber(item.CompanyId, item.PONumber, item.ClientContact);

invoiceModelForHourlyEmployee.InvoiceNumber = invoiceNumber;
invoiceModelForHourlyEmployee.EmailCC = "";
invoiceModelForHourlyEmployee.Email = item.Email;

invoiceModelForHourlyEmployee.EmployeeId = item.CandidateId;
invoiceModelForHourlyEmployee.StartId = item.BillingStartId;
invoiceModelForHourlyEmployee.RecId = item.BillingRecId;


if (startDate != AppConstants.RepositoryDefaultDate && endDate != AppConstants.RepositoryDefaultDate)
{
if (parsedStartDate != DateTime.MinValue && parsedEndDate != DateTime.MinValue)
{
invoiceModelForHourlyEmployee.InvoiceDate = parsedEndDate.ToString(InvoiceConstants.DateFormat);
invoiceModelForHourlyEmployee.ServiceDate = parsedEndDate.ToString(InvoiceConstants.DateFormat);
invoiceModelForHourlyEmployee.Terms = InvoiceConstants.Net30;

var month = parsedEndDate.ToString(InvoiceConstants.MYDateFormat);
string lineDescription = $"{month} {InvoiceConstants.ConsultingServices}";

if (invoiceHrsHelper != null)
{
invoiceModelForHourlyEmployee.PONumber = invoiceHrsHelper.PONumber;
invoiceModelForHourlyEmployee.AcceptanceCode = invoiceHrsHelper.AcceptanceCode;
}
if (invoiceHrsHelper?.LineDescription != null)
{
invoiceModelForHourlyEmployee.LineDescription = invoiceHrsHelper.LineDescription;
}
else
{
invoiceModelForHourlyEmployee.LineDescription = lineDescription;
}

var ecHoursHelper = externalConsultingHoursHelper.Where(x => x.StartId == item.BillingStartId).FirstOrDefault();
decimal ecVariableHours = Convert.ToDecimal(ecHoursHelper?.VariableHours);

var w2HoursHelper = w2HoursHelperAsync.Where(x => x.StartId == item.BillingStartId).FirstOrDefault();
decimal w2VariableHours = Convert.ToDecimal(w2HoursHelper?.VariableHours);

var usa1099HoursHelper = usa1099HoursHelperAsync.Where(x => x.StartId == item.BillingStartId).FirstOrDefault();
decimal usa1099VariableHours = Convert.ToDecimal(usa1099HoursHelper?.VariableHours);

var pr480HoursHelper = pr480PayrollHelperAsync.Where(x => x.StartId == item.BillingStartId).FirstOrDefault();
decimal pr480VariableHours = Convert.ToDecimal(pr480HoursHelper?.VariableHours);

switch (item.Division)
{
case AppConstants.ECHoursDivisionCode:
if (invoiceHrsHelper?.VariableHours != null)
{
decimal variableHours = Convert.ToDecimal(invoiceHrsHelper?.VariableHours);
invoiceModelForHourlyEmployee.VariableHours = variableHours.ToString(AppConstants.DefaultTwoDigits);
}
else if(ecVariableHours != 0)
{
invoiceModelForHourlyEmployee.VariableHours = ecVariableHours.ToString(AppConstants.DefaultTwoDigits);
}
break;
case AppConstants.W2HoursDivisionCode:
if (invoiceHrsHelper?.VariableHours != null)
{
decimal variableHours = Convert.ToDecimal(invoiceHrsHelper?.VariableHours);
invoiceModelForHourlyEmployee.VariableHours = variableHours.ToString(AppConstants.DefaultTwoDigits);
}
else if(w2VariableHours != 0)
{
invoiceModelForHourlyEmployee.VariableHours = w2VariableHours.ToString(AppConstants.DefaultTwoDigits);
}
break;
case AppConstants.USA1099DivisionCode:
if (invoiceHrsHelper?.VariableHours != null)
{
invoiceModelForHourlyEmployee.VariableHours = invoiceHrsHelper.VariableHours;
}
else if (usa1099VariableHours != 0)
{
decimal variableHours = Convert.ToDecimal(invoiceHrsHelper?.VariableHours);
invoiceModelForHourlyEmployee.VariableHours = variableHours.ToString(AppConstants.DefaultTwoDigits);
}
break;
case AppConstants.PR480DivisionCode:
if (invoiceHrsHelper?.VariableHours != null)
{
decimal variableHours = Convert.ToDecimal(invoiceHrsHelper?.VariableHours);
invoiceModelForHourlyEmployee.VariableHours = variableHours.ToString(AppConstants.DefaultTwoDigits);
}
else if (pr480VariableHours != 0)
{
invoiceModelForHourlyEmployee.VariableHours = pr480VariableHours.ToString(AppConstants.DefaultTwoDigits);
}
break;
default:
break;
}

DateTime firstStartDate = getRegularHoursDate.Regular0hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.FirstStartDate = firstStartDate.ToString(AppConstants.DateFormatMDY);
DateTime firstEndDate = getRegularHoursDate.Regular0hrs.LastOrDefault();
invoiceModelForHourlyEmployee.FirstEndDate = firstEndDate.ToString(AppConstants.DateFormatMDY);

DateTime secondStartDate = getRegularHoursDate.Regular1hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.SecondStartDate = secondStartDate.ToString(AppConstants.DateFormatMDY);
DateTime secondEndDate = getRegularHoursDate.Regular1hrs.LastOrDefault();
invoiceModelForHourlyEmployee.SecondEndDate = secondEndDate.ToString(AppConstants.DateFormatMDY);

DateTime thirdStartDate = getRegularHoursDate.Regular2hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.ThirdStartDate = thirdStartDate.ToString(AppConstants.DateFormatMDY);
DateTime thirdEndDate = getRegularHoursDate.Regular2hrs.LastOrDefault();
invoiceModelForHourlyEmployee.ThirdEndDate = thirdEndDate.ToString(AppConstants.DateFormatMDY);

DateTime fourthStartDate = getRegularHoursDate.Regular3hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.FourthStartDate = fourthStartDate.ToString(AppConstants.DateFormatMDY);
DateTime fourthEndDate = getRegularHoursDate.Regular3hrs.LastOrDefault();
invoiceModelForHourlyEmployee.FourthEndDate = fourthEndDate.ToString(AppConstants.DateFormatMDY);

DateTime fifthStartDate = getRegularHoursDate.Regular4hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.FifthStartDate = fifthStartDate.ToString(AppConstants.DateFormatMDY);
DateTime fifthEndDate = getRegularHoursDate.Regular4hrs.LastOrDefault();
invoiceModelForHourlyEmployee.FifthEndDate = fifthEndDate.ToString(AppConstants.DateFormatMDY);

DateTime sixthStartDate = getRegularHoursDate.Regular5hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.SixthStartDate = sixthStartDate.ToString(AppConstants.DateFormatMDY);
DateTime sixthEndDate = getRegularHoursDate.Regular5hrs.LastOrDefault();
invoiceModelForHourlyEmployee.SixthEndDate = sixthEndDate.ToString(AppConstants.DateFormatMDY);

DateTime seventhStartDate = getRegularHoursDate.Regular6hrs.FirstOrDefault();
invoiceModelForHourlyEmployee.SeventhStartDate = seventhStartDate.ToString(AppConstants.DateFormatMDY);
DateTime seventhEndDate = getRegularHoursDate.Regular6hrs.LastOrDefault();
invoiceModelForHourlyEmployee.SeventhEndDate = seventhEndDate.ToString(AppConstants.DateFormatMDY);

var employeeTimesheet = employeeTimesheets.Where(x => x.StartId == item.BillingStartId && x.BillRate == invoiceModelForHourlyEmployee.BillRate).ToList();
decimal totalRegHours1 = employeeTimesheet.Where(x => x.TDATE >= firstStartDate && x.TDATE <= firstEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
decimal totalRegHours2 = employeeTimesheet.Where(x => x.TDATE >= secondStartDate && x.TDATE <= secondEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
decimal totalRegHours3 = employeeTimesheet.Where(x => x.TDATE >= thirdStartDate && x.TDATE <= thirdEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
decimal totalRegHours4 = employeeTimesheet.Where(x => x.TDATE >= fourthStartDate && x.TDATE <= fourthEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
decimal totalRegHours5 = employeeTimesheet.Where(x => x.TDATE >= fifthStartDate && x.TDATE <= fifthEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
decimal totalRegHours6 = employeeTimesheet.Where(x => x.TDATE >= sixthStartDate && x.TDATE <= sixthEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
decimal totalRegHours7 = employeeTimesheet.Where(x => x.TDATE >= seventhStartDate && x.TDATE <= seventhEndDate).Sum(x => Convert.ToDecimal(x.RegHours) + Convert.ToDecimal(x.OtHours));
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours1 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs1 = Convert.ToString(totalRegHours1.ToString(AppConstants.DefaultOneDigits));
}
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours2 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs2 = Convert.ToString(totalRegHours2.ToString(AppConstants.DefaultOneDigits));
}
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours3 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs3 = Convert.ToString(totalRegHours3.ToString(AppConstants.DefaultOneDigits));
}
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours4 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs4 = Convert.ToString(totalRegHours4.ToString(AppConstants.DefaultOneDigits));
}
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours5 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs5 = Convert.ToString(totalRegHours5.ToString(AppConstants.DefaultOneDigits));
}
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours6 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs6 = Convert.ToString(totalRegHours6.ToString(AppConstants.DefaultOneDigits));
}
if (employeeTimesheet != null && employeeTimesheet.Any() == true && totalRegHours7 != 0)
{
invoiceModelForHourlyEmployee.RegularHrs7 = Convert.ToString(totalRegHours7.ToString(AppConstants.DefaultOneDigits));
}
decimal subTotalRegularHours = totalRegHours1 + totalRegHours2 + totalRegHours3 + totalRegHours4 + totalRegHours5 + totalRegHours6 + totalRegHours7;
decimal subTotalHours = subTotalRegularHours + Convert.ToDecimal(invoiceModelForHourlyEmployee.VariableHours);

invoiceModelForHourlyEmployee.QuantityTotalHours = (subTotalHours).ToString(AppConstants.DefaultTwoDigits);

decimal billRate = Convert.ToDecimal(invoiceModelForHourlyEmployee.PriceBillRate?.Replace(@"$", string.Empty));
decimal amount = subTotalHours * billRate;
invoiceModelForHourlyEmployee.Amount = $"${amount.ToString(AppConstants.DefaultFiveDigits)}";

decimal tax = (amount) * 4 / 100;
switch (item.CompanyId)
{
case InvoiceConstants.EVERTECGroupLLC:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.MMMHoldingsLLC:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.JDWConsultingCorporation:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.JDWConsulting:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.VerticalTech:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.LatcapitalSolutionsInc:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.Florida;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARFlorida;
break;
case InvoiceConstants.GBMConsulting:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.LATAM;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARLATAM;
break;
case InvoiceConstants.PopularInc:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.DrogueriaBetances:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.BonumTechnologies:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.Texas;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARTexas;
break;
case InvoiceConstants.GLOBALONLINEPARTNERSGlobpar:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.Florida;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARFlorida;
break;
case InvoiceConstants.VSIVentivSolutionsInternational:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.LATAM;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARFlorida;
break;
case InvoiceConstants.CEMEXMonterrey:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.Texas;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARTexas;
break;
case InvoiceConstants.CEMEXBransonFL:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.Florida;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARFlorida;
break;
case InvoiceConstants.ClaroPuertoRico:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.PRTCPR:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.PuertoRico;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.TAX;
invoiceModelForHourlyEmployee.Tax = $"${tax.ToString(AppConstants.DefaultTwoDigits)}";
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARPuertoRico;
break;
case InvoiceConstants.FloridaDepartmentOfChildren:
invoiceModelForHourlyEmployee.ClassName = InvoiceConstants.Florida;
invoiceModelForHourlyEmployee.LineTaxCodeName = InvoiceConstants.NON;
invoiceModelForHourlyEmployee.ARAccount = InvoiceConstants.ARFlorida;
break;
default:
break;
}
}
}
return invoiceModelForHourlyEmployee;
}
catch (Exception exception)
{
Log.Error($"Error in CreateInvoiceForHourlyEmployee: {exception.Message}");
throw;
}
}
//API Controller
[HttpGet]
[Authorize]
public async Task<ActionResult> GetInvoiceForHourlyEmployee(string startDate, string endDate)
{
try
{
var invoiceForHourlyEmployee = await invoiceRepository.GetHourlyEmployeeListForInvoice(startDate, endDate);
if (invoiceForHourlyEmployee != null)
{
return Ok(invoiceForHourlyEmployee);
}
return BadRequest();
}
catch (Exception exceptions)
{
return BadRequest(exceptions.Message);
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.