\Salary
Employee salary accounting implementation
Synopsis
class Salary
{
- // constants
- const URL_ME = '?module=salary';
- const URL_TS = '?module=taskman&edittask=';
- const URL_JOBPRICES = 'jobprices=true';
- const URL_WAGES = 'employeewages=true';
- const URL_PAYROLL = 'payroll=true';
- const URL_FACONTROL = 'factorcontrol=true';
- const URL_TWJ = 'twjreport=true';
- const URL_LTR = 'ltreport=true';
- const URL_TSHEETS = 'timesheets=true';
- const URL_YRREP = 'yearreport=true';
- const CACHE_TIMEOUT = 2592000;
- // members
- protected array $altCfg = ;
- protected array $allEmployee = ;
- protected array $allEmployeeRaw = ;
- protected array $allEmployeeTelegram = ;
- protected array $allEmployeeLogins = ;
- protected array $allJobtypes = ;
- protected array $allJobTimes = ;
- protected array $allJobPrices = ;
- protected array $allJobUnits = ;
- protected array $allWages = ;
- protected array $unitTypes = ;
- protected array $allJobs = ;
- protected array $allPaid = ;
- protected array $allTimesheets = ;
- protected array $allTimesheetDates = ;
- protected array $allAppointments = ;
- protected integer $defaultFactor = 0;
- protected array $taskJobsCache = ;
- protected $cache = '';
- protected $telegram = '';
- protected bool $telegramNotify = false;
- protected string $dateFrom = '';
- protected string $dateTo = '';
- // methods
- public void __construct()
- protected void loadAltCfg()
- protected void setOptions()
- protected void catchDateOffsets()
- protected void setDates()
- protected void loadEmployeeData()
- protected void loadJobtypes()
- protected void setUnitTypes()
- protected void loadJobprices()
- protected void loadWages()
- protected void loadPaid()
- protected void loadTimesheets()
- protected void loadAppointments()
- public string jobPricesCreateForm()
- protected void initTelegram()
- protected void initCache()
- protected void loadTaskJobsCache()
- protected string jobPricesEditForm()
- public void jobPriceCreate()
- protected void sendTelegram()
- protected void salaryCreationNotify()
- public void telegramDailyNotify()
- public string jobPricesRender()
- public void jobPriceDelete()
- public void jobPriceEdit()
- public string renderControls()
- public string taskJobCreateForm()
- protected void loadSalaryJobs()
- public void createSalaryJob()
- protected array filterTaskJobs()
- protected array filterTaskJobsCached()
- protected bool checkEmployeeWage()
- protected array jobsFilterDate()
- protected float getJobPrice()
- public array getAllJobTimes()
- protected int getJobTime()
- protected string jobEditForm()
- public void jobEdit()
- protected string renderTaskJobs()
- public float getTaskPrice()
- public void deleteJob()
- public void employeeWageCreate()
- public void employeeWageDelete()
- public string employeeWageCreateForm()
- protected string employeeWageEditForm()
- public void employeeWageEdit()
- public string employeeWagesRender()
- public string payrollRenderSearchForm()
- public string payrollRenderSearch()
- protected string renderTableViewStats()
- protected array timesheetFilterDateRange()
- public string payrollRenderSearchDate()
- protected string renderJobList()
- public string payrollStateProcessingForm()
- public void payrollStateProcessing()
- public string getEmployeeName()
- public string facontrolRenderSearchForm()
- public string facontrolRenderSearch()
- public string twjReportSearchForm()
- public string twjReportSearch()
- protected void pushPaid()
- protected array getPaidData()
- protected string renderPaidDataLed()
- public void reportPrintable()
- public string timesheetCreateForm()
- protected bool timesheetProtected()
- public int timesheetCreate()
- public string timesheetsListRender()
- protected array timesheetFilterDate()
- protected array timesheetFilterMonth()
- public string timesheetEditForm()
- public void timesheetSaveChanges()
- public string timesheetRenderPrintableForm()
- public string timesheetRenderPrintable()
- protected float percentValue()
- protected string formatTime()
- public string ltReportRenderForm()
- public string ltReportRenderResults()
- public string renderYearReport()
- public void summaryReport()
Constants
Name | Value |
---|---|
URL_ME | '?module=salary' |
URL_TS | '?module=taskman&edittask=' |
URL_JOBPRICES | 'jobprices=true' |
URL_WAGES | 'employeewages=true' |
URL_PAYROLL | 'payroll=true' |
URL_FACONTROL | 'factorcontrol=true' |
URL_TWJ | 'twjreport=true' |
URL_LTR | 'ltreport=true' |
URL_TSHEETS | 'timesheets=true' |
URL_YRREP | 'yearreport=true' |
CACHE_TIMEOUT | 2592000 |
Members
protected
- $allAppointments
—
string
Contains all employee appointments as employeeid=>appointment - $allEmployee
—
array
Available active employee as employeeid=>name - $allEmployeeLogins
—
array
Contains all available employee realnames as login=>name - $allEmployeeRaw
—
array
Available active and inactive employee - $allEmployeeTelegram
—
array
Contains available employee telegram chatid data as id=>chatid - $allJobPrices
—
array
Default jobtype pricing as jobtypeid=>price - $allJobTimes
—
array
Typical jobtypes required time in minutes as jobtypeid=>time - $allJobUnits
—
string
Available jobtype units as jobtypeid=>unit - $allJobs
—
array
All available salary jobs as id=>jobdata - $allJobtypes
—
array
Available jobtypes as jobtypeid=>name - $allPaid
—
array
Alredy paid jobs as array jobid=>paid data - $allTimesheetDates
—
array
Timesheets dates as date=>timesheet count - $allTimesheets
—
array
All available timesheets as array id=>timesheetdata - $allWages
—
string
Available employee wages, bounty and work day length - $altCfg
—
array
System alter.ini config stored as array key=>value - $cache
—
System caching object placeholder - $dateFrom
—
string
Contains start date that large data must be loaded - $dateTo
—
string
Contains end date that large data must be loaded to - $defaultFactor
—
int
Default factor value for newly created salary jobs - $taskJobsCache
—
array
Contains previously detected tasks jobs mappings - $telegram
—
System telegram object placeholder - $telegramNotify
—
bool
Telegram force notification flag - $unitTypes
—
array
Available unit types as unittype=>localized name
Methods
protected
- catchDateOffsets() — Catches some date offsets and points internal props into required values
- checkEmployeeWage() — Checks is employee active for timesheets and salary accounting or not
- employeeWageEditForm() — Returns existing employee wage editing form
- filterTaskJobs() — Filters available jobs for some task
- filterTaskJobsCached() — Filters available jobs for some task
- formatTime() — Renders time duration in seconds into formatted human-readable view
- getJobPrice() — Returns job salary by its factor/overprice
- getJobTime() — Returns time in minutes spent to perform some job
- getPaidData() — Returns paid Data for some paid job
- initCache() — Inits system cache for further usage
- initTelegram() — Inits telegram object as protected instance for further usage
- jobEditForm() — Returns existing job editing form
- jobPricesEditForm() — Renders job price editing form
- jobsFilterDate() — Filters available jobs by date
- loadAltCfg() — Loads system alter config
- loadAppointments() — Loads all employee appointments from database
- loadEmployeeData() — Loads active employees from database
- loadJobprices() — Loads existing job prices from database
- loadJobtypes() — Loads available jobtypes from database
- loadPaid() — Loads paid jobs log from database into private property
- loadSalaryJobs() — Loads all available salary jobs from database
- loadTaskJobsCache() — Loads tasks=>jobs cache
- loadTimesheets() — Loads all existing timesheets from database into protected property
- loadWages() — Loads existing employee wages from database
- percentValue() — Counts percentage between two values
- pushPaid() — Pushes payment action for some processed salary job
- renderJobList() — Renders available tasks list as human-readable table
- renderPaidDataLed() — Returns some human-readable paid indication
- renderTableViewStats() — Renders default pie-chart data as table summary
- renderTaskJobs() — Renders jobs list for some task
- salaryCreationNotify() — Sends some notificaton about salary job creation to employee
- sendTelegram() — Stores Telegram message for some employee
- setDates() — Sets start and end dates if requred.
- setOptions() — Sets some config based options
- setUnitTypes() — Sets default unit types
- timesheetFilterDate() — Returns array of timesheet records filtered by date
- timesheetFilterDateRange() — Filters available timesheets by date range
- timesheetFilterMonth() — Returns array of timesheet records filtered by Year/month in MySQL date format Y-m
- timesheetProtected() — Checks is timesheet protected?
public
- __construct() — Creates new Salary instance
- createSalaryJob() — Creates new salary job for some task
- deleteJob() — Deletes existing job from database by ID
- employeeWageCreate() — Creates new employee wage record
- employeeWageCreateForm() — Returns employee wage creation form
- employeeWageDelete() — Deletes existing employee wage from database
- employeeWageEdit() — Changes existing employee wage in database
- employeeWagesRender() — Renders available employee wages list with some controls
- facontrolRenderSearch() — Renders factor control report search results
- facontrolRenderSearchForm() — Renders factor control search form :P
- getAllJobTimes() — Returns all available job labor times in minutes as jobtypeId=>time
- getEmployeeName() — Returns existing employee name
- getTaskPrice() — Renders jobs total price for some task
- jobEdit() — Edits some existing job in database
- jobPriceCreate() — Creates job type pricing database record
- jobPriceDelete() — Deletes jobprice by jobtype id from database
- jobPriceEdit() — Edits existing job price in database
- jobPricesCreateForm() — Renders job price creation form
- jobPricesRender() — Renders job prices list with required controls
- ltReportRenderForm() — Returns labor time search form
- ltReportRenderResults() — Renders labor time report results
- payrollRenderSearch() — Renders payroll report search results
- payrollRenderSearchDate() — Renders payroll report search results for all employee
- payrollRenderSearchForm() — Renders payroll report search form
- payrollStateProcessing() — Performs job states processing
- payrollStateProcessingForm() — Performs job states processing agreement form
- renderControls() — Renders controls panel
- renderYearReport() — Renders per year salary report
- reportPrintable() — shows printable report content
- summaryReport() — Shows salary summary report
- taskJobCreateForm() — Returns job for task creation form
- telegramDailyNotify() — Sends notification for jobs created by current day
- timesheetCreate() — Creates new timesheet if date is unique
- timesheetCreateForm() — Renders timesheet create form
- timesheetEditForm() — Renders timesheet editing form
- timesheetRenderPrintable() — Renders printable timesheets by some month
- timesheetRenderPrintableForm() — Returns
- timesheetSaveChanges() — Saves timesheet editing results into database
- timesheetsListRender() — Renders list of timesheets
- twjReportSearch() — Renders tasks without jobs report
- twjReportSearchForm() — Renders tasks without jobs report search form