using System; using System.Collections.Generic; using System.Text; using Swarmops.Basic.Types; using Swarmops.Database; using Swarmops.Logic.Structure; using Swarmops.Logic.Support; namespace Swarmops.Logic.Financial { public class Payroll: PluralBase { /// /// Returns all open payroll items for an organization. /// /// The organization. /// The payroll. public static Payroll ForOrganization (Organization organization) { return ForOrganization(organization, false); } /// /// Returns all payroll items for an organization, optionally including closed ones. /// /// The organization to filter for. /// True to include closed records. /// The payroll. public static Payroll ForOrganization (Organization organization, bool includeClosed) { return FromArray(SwarmDb.GetDatabaseForReading().GetPayroll(organization, includeClosed? DatabaseCondition.None : DatabaseCondition.OpenTrue)); } /// /// Returns all open payroll for all organizations. /// /// The payroll. public static Payroll GetAll() { return GetAll(false); } /// /// Returns all payroll for all organizations, optionally including closed ones. /// /// True to include closed records. /// The payroll. public static Payroll GetAll(bool includeClosed) { return FromArray(SwarmDb.GetDatabaseForReading().GetPayroll(includeClosed? DatabaseCondition.None : DatabaseCondition.OpenTrue)); } } }