View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001670 | Зарплата | General | public | 2021-03-14 22:47 | 2021-03-14 22:47 |
Reporter | ruslan | Assigned To | |||
Priority | urgent | Severity | feature | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | КСАП Гранит | OS | Windows | ||
Summary | 0001670: +Зарплата - новый порядок расчета средней ЗП для отпуска | ||||
Description | В принципе вроде у нас все нормально, НО расчетный период для сотрудника приятого в первый рабочий день месяца берется полный календарный(см. пример в файле за март.) | ||||
Additional Information | Я внес изменения в процедуру добавь их в БД create or alter procedure ZPLT_CALCSLVO ( SIID integer) returns ( SUMMA double precision, BDATE timestamp, EDATE timestamp, BCDATE timestamp, ECDATE timestamp, MCNT integer, ISUMMA double precision, SUMMA1 double precision, DAYS integer, HLDDAYS integer, HLDDAYSWOSALE integer) as /* расчет отпускных */ declare variable CALCINCRID integer; declare variable PRSNID integer; declare variable DAYWTIME double precision; declare variable WTIME double precision; declare variable SLVID integer; declare variable BPDATE date; /* дата приема на работу */ declare variable XDATE date; declare variable HDAYS integer; declare variable MROUND integer; declare variable DATE1 date; declare variable DATE2 date; declare variable XDAYS integer; begin Summa = 0.0; hlddayswosale = 0; Select ID, BLDATE, ELDATE, (ELDATE-BLDATE)+1.0, MonthCnt, CoalEsce(MRound, 0), SlvID from ZpltCalcIncr where ID=:SIID into :CalcIncrID, :BDATE, :EDATE, :Days, :MCnt, :MRound, :SlvID; if (:CalcIncrID is Null) then begin Suspend; Exit; end Select xDate-1 from F_MonthFirstDay(:BDATE) into :ECDATE; Select xDate from F_AddMonth(:ECDATE,-:MCnt+1) into :BCDATE; Select xDate from F_MonthFirstDay(:BCDATE) into :BCDATE; Select PrsnID from ZpltCalcSlv where ID=:SlvID into :PrsnID; Select Inp_Date, DayWTime from Personal where ID=:PrsnID into :BPDATE, :DayWTime; if (:DayWTime is Null or :DayWTime = 0) then DayWTime = 8.0; if ((:BPDATE is Not Null) and (:BPDATE > :BCDATE)) then begin -- если сотрудник работает менее 12 мес. - берем от приема на работу Select xDate from F_MonthFirstWorkDay(:SlvID, :BPDATE) into :xDate; if (:BPDATE <> (:xDate)) then begin Select xDate+1.0 from F_MonthLastDay(:BPDATE) into :BCDATE; end else --BCDATE = :xDate; --исправление 31.08.2015 Select xDate from F_MonthFirstDay(:xDate) into BCDATE; -- исправление 19.12.2020 по новому порядку 100 end mCnt = 0; /* фактическое количество расчетных месяцев */ xDate = :BCDATE; while (:xDate < :ecDate) do begin mCnt = :MCnt+1; Select xDate+1 from F_MonthLastDay(:xDate) into :xDate; end -- начислено за расчетный период Select Sum(CI.cSumma) from ZpltCalcMst M, ZpltCalcSlv S, ZpltCalcIncr CI, ZpltIncr I where M.DAT_ >= :BCDATE and M.DAT_ <= :ECDATE and S.MstID=M.ID and S.PrsnID = :PrsnID and CI.SlvID=S.ID and I.ID=CI.IncrID -- исключая аванс, материальную помощь, разница между мин. з/п. and I.System_Flag not in (2, 4, 16) into :iSumma; if (:iSumma is Null) then iSumma = 0.0; Select Sum(S.wTime) from ZpltCalcMst M, ZpltCalcSlv S where M.DAT_ >= :BCDATE and M.DAT_ <= :ECDATE and S.MstID=M.ID and S.PrsnID = :PrsnID into :wTime; /* праздничные дни за расчетный период */ select Days from Zplt_HldDays(:bcDate, :ecDate) into :HldDays; /* праздничные дни за период отпуска */ select Days from Zplt_HldDays(:bDate, :eDate) into :HDays; /* дни отпуска без сохранениея з/п за расчетный период. Исправления 12.08.2016*/ for select V.bDate, V.eDate from ZpltSertVacat V where V.PrsnID=:PrsnID and V.Typ=1 and V.bDate <= :ECDATE and V.eDate >= :BCDATE and V.bDate is not Null and V.eDate is not Null into :Date1, :Date2 do begin if (:Date1 < :BCDATE) then Date1 = :BCDATE; if (:Date2 > :ECDATE) then Date2 = :ECDATE; select Result + 1 from F_ElapsedDays(:Date1, :Date2) into :xDays; hlddayswosale = hlddayswosale + :xDays; end Summa1 = 0.0; /* среднедневная зарплата */ if (:wTime <> 0.0 and :wTime is not Null and :DayWTime <> 0.0) then begin Summa1 = :iSumma / (:ECDATE-:BCDATE+1.0 - :HldDays - :hlddayswosale); end if (:MRound = 1) then Summa1 = Cast((Summa1 * 100.00) as integer) / 100.00; Summa = Cast(Cast((:Summa1 * (:Days-:HDays))*100.0 as Integer) as double precision) / 100.0; Suspend; end | ||||
Tags | No tags attached. | ||||