Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:48:21+00:00 2026-05-26T20:48:21+00:00

Im am learning C# and am making a Payroll Add-On for SAP Business One.

  • 0

Im am learning C# and am making a Payroll Add-On for SAP Business One.

I have completed the payroll process that calculates netpay, gross pay, PAYE, earnings, deductions etc. These calculations for each employee are entered into a temporary process data table.

I now want to do a monthly rollover (close the current month). To do so, I have to do some validation to make sure that the calculations were done correctly before removing contents from the temp process data table to a permanent one.

I want to do this by comparing two lists.

The 1st is drawn from Employee Master Data in SAP and it contains employee IDs, names, telephones, salary units etc. I have selected employeeIDs only.

The 2nd is drawn from Process_Data_Temp and it contains employee IDs, net pay (U_PD_code = SYS001) etc.

I want to match this list by making sure that all the empIDs in 1st are contained in the 2nd (exactly) and that the net pay in the 2nd list is not null ie (U_PD_code where == SYS001 is not null or empty) etc. .

I want to do three comparisons based on salary unit ie. Monthly = M, SemiMonthly =S and Weekly = W.
Right now I’m interested in Monthly.

The field salary unit is in Employee master data but not in the process data temp table so I’m not sure how I will get distinct empIDs that are on monthly pay in the temp table in order to do the comparison. I am comparing monthly employees first.

Process_Data_Temp fields

Code Name, U_Tax_year, U_Employee_ID, U_Process_month, U_PD_code U_Amount, U_Balance, 

U_Employer_cont_amnt

How does one do this?

My Code So Far

private void DoMonthEndRollover()
{
// Get service instances needed            
var getAllEmployees = Program.Kernel.Get<IEmployeeService>().GetAllEmployees().Where(x => x.salaryUnit.ToString() == "M");
var tempProcessData = Program.Kernel.Get<IProcessDataTempService>().GetAllProcessDataTemps();

// Get all employee IDs from first list
var employeeIdList = (from el in getAllEmployees select el.empID).Distinct();

// Get information from second list
var tempList = (from tl in tempProcessData orderby tl.U_Employee_ID select tl).Distinct(); ......not finished

// Check if all Employee IDs have net pay (Contained in Process Data Temporary table)

}

NB: The Process Data Temporary table contains calculations of all employees whether monthly, semimonthly or weekly.

I hope I am clear enough

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:48:22+00:00Added an answer on May 26, 2026 at 8:48 pm

    Assuming that employeeIDList and tempList are both lists of integers you can use IEnumerable.Intersect to find elements that are in both lists.

    int[] id1 = { 44, 26, 92, 30, 71, 38 };
    int[] id2 = { 39, 59, 83, 47, 26, 4, 30 };
    
    IEnumerable<int> both = id1.Intersect(id2);
    

    If the output list is is the same length as your input list then they are identical.

    However, in the first instance check that your two lists are the same length. If they aren’t then the process has failed. Only do the Intersect check if both lists are the same length.

    There is also IEnumerable.Except method that:

    Produces the set difference of two sequences by using the default equality comparer to compare values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning the C# programming language and am making a payroll application add-on
I am learning the C# programming language and am making a payroll application add-on
I am learning the C# programming language and am making a payroll application add-on
I am learning C# and am making a custom Payroll application. I have a
I am making a small calculator (just for JavaScript learning) and I have two
I have been making a matrix class (as a learning exercise) and I have
I'm learning winforms and I have set myself a simple goal of making a
I am making a simple CMS just for learning purposes and I have a
I am learning the C# programming language and am making a Payroll program addon
I have been making huge strides in learning Flex and I am very much

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.