查詢篇--老師課時(shí)工資算法詳解
2012年04月21日 06:20
點(diǎn)擊率:20996
|
培訓(xùn)機(jī)構(gòu)里常見的課時(shí)薪資算法介紹: 一、按員工課時(shí)費(fèi)計(jì)算老師課時(shí)工資:(SQL Server版)
公式:上課課時(shí)數(shù) × 每課時(shí)分鐘 ÷ 60 × 每小時(shí)薪資 = 實(shí)際課時(shí)費(fèi) 實(shí)際運(yùn)算中,由于不同班級每課時(shí)的分鐘數(shù)不一定相同,所以程序是按照每課次結(jié)算費(fèi)用,最后將所有費(fèi)用匯總得出最終數(shù)據(jù)的。 這個(gè)方法是最簡單方便的課時(shí)工資計(jì)算公式,在很多培訓(xùn)機(jī)構(gòu)里被采納。老師每小時(shí)薪資在員工詳細(xì)信息里設(shè)置:  語法: Select LessonDegree.TeacherID as 工號, Users.TrueName as 姓名, Sum(LessonDegree.Lessons) as 課時(shí), cast(Sum(LessonDegree.Lessons * Class.LessonMinute) as decimal) / 60 * Users.HourFee as 工資 from LessonDegree,Class,Users where LessonDegree.ClassID = Class.ClassID and LessonDegree.TeacherID = Users.UserID and LessonDegree.LeStateID = 1 and LessonDegree.StartDate >= {@StartDate:開始日期} and LessonDegree.StartDate <= {@EndDate:結(jié)束日期} group by LessonDegree.TeacherID,Users.TrueName,Users.HourFee order by LessonDegree.TeacherID
如果是ACCESS版本,只要將cast(Sum(LessonDegree.Lessons * Class.LessonMinute) as decimal)修改為Sum(LessonDegree.Lessons * Class.LessonMinute)即可。
二、按班級每課時(shí)薪資計(jì)算老師課時(shí)工資:(SQL Server版)
公式:上課課時(shí)數(shù) × 班級每課時(shí)薪金 = 實(shí)際課時(shí)費(fèi)
實(shí)際運(yùn)算中,由于不同班級每課時(shí)提成不一定相同,所以程序是按照每課次結(jié)算費(fèi)用,最后將所有費(fèi)用匯總得出最終數(shù)據(jù)的。 這個(gè)方法略有點(diǎn)繁瑣,需要每次開班時(shí)都要設(shè)置好班級每課時(shí)薪金。 課時(shí)提成設(shè)置方法:

語法: Select LessonDegree.TeacherID as 工號, Users.TrueName as 姓名, Sum(LessonDegree.Lessons) as 課時(shí), Sum(LessonDegree.Lessons * Class.LessonCommission) as 工資 from LessonDegree,Class,Users where LessonDegree.ClassID = Class.ClassID and LessonDegree.TeacherID = Users.UserID and LessonDegree.LeStateID = 1 and LessonDegree.StartDate >= {@StartDate:開始日期} and LessonDegree.StartDate <= {@EndDate:結(jié)束日期} group by LessonDegree.TeacherID,Users.TrueName order by LessonDegree.TeacherID
ACCESS版同上。
三、按上課學(xué)員實(shí)際消耗的課時(shí)產(chǎn)出計(jì)算老師提成。
公式:某時(shí)間內(nèi)老師所帶學(xué)員課時(shí)消費(fèi)總額 × 百分比例 = 老師實(shí)際課時(shí)費(fèi)
由于優(yōu)惠數(shù)據(jù)的存在、多次交費(fèi)不同單價(jià)的存在,學(xué)員的實(shí)際消費(fèi)金額與考勤消耗很難精確計(jì)算,所以這種計(jì)算方式需要付出一定的成本。麥田培訓(xùn)管理軟件默認(rèn)未開啟這種精密計(jì)算。因?yàn)樗枰加煤芏嗟馁Y源、消耗更多的性能。所以只有SQL SERVER版用戶支持,并且需要預(yù)約開啟并支付額外的服務(wù)費(fèi)用。
以上內(nèi)容介紹了培訓(xùn)機(jī)構(gòu)最基本的三種算法,實(shí)際應(yīng)用時(shí)SQL構(gòu)造可能要復(fù)雜得多。有的機(jī)構(gòu)可能是兩個(gè)模式混合使用、大班與一對一分開算法計(jì)算、加入基本工資、獎(jiǎng)罰數(shù)據(jù)運(yùn)算、兼職全職分開運(yùn)算等。但萬變不離其中,理解以上基本算法,就可以輕松實(shí)現(xiàn)更復(fù)雜的構(gòu)造。
|