commit melhorias1
This commit is contained in:
@@ -6,7 +6,7 @@ $host->beginTransaction();try{
|
||||
[$r1]=$command(13,$input('rules',$rk,0,$rulesData));[$r2]=$command(14,$input('rules',$rk,1,['decision'=>'approved'],'review'));$pay=['operation'=>'establish','worker_key'=>$wk,'rules_key'=>$rk,'period'=>'2026-11','gross'=>'10000.00'];[$v1,$cut,$key]=$command(13,$input('payroll',$pk,0,$pay));$c=$v1['impact']['after']['proposal']['calculation'];$ok($c['net_cents']==='890000'&&$c['employer_cost_cents']==='1040000'&&$c['deductions_cents']==='110000','exact artificial gross10000 net8900 cost10400');$ok($c['rubrics']['worker_rate']['cents']==='30000'&&$c['rubrics']['retention_rate']['cents']==='80000'&&$c['rubrics']['employer_rate']['cents']==='40000','rubrics distinguish employee and employer');$ok(!$v1['impact']['debt_created']&&$v1['impact']['journals']===0&&$v1['impact']['payments']===0,'no financial effect');$reject(fn()=>$preview(13,$input('payroll',$uuid(),0,$pay)),409,'duplicate person period refused');
|
||||
$stale=$preview(14,$input('payroll',$pk,1,['decision'=>'approved'],'review'));[$v2]=$command(13,$input('payroll',$pk,1,$pay));$reject(fn()=>$confirm(14,$stale['preview']),409,'stale review version refused');[$v3]=$command(14,$input('payroll',$pk,2,['decision'=>'approved'],'review'));$ok($v3['version']===3&&$v3['state']==='approved','current preparation reviewed distinctly');$select(17);$export=$rm->export($hrActor(17),$v3['id']);$ok(hash('sha256',$export['bytes'])===$export['sha256']&&str_contains($export['bytes'],'890000'),'frozen reviewed artifact SHA');
|
||||
$changed=array_replace($pay,['operation'=>'amend','gross'=>'10001.00']);[$v4]=$command(13,$input('payroll',$pk,3,$changed));[$v5]=$command(14,$input('payroll',$pk,4,['decision'=>'refused'],'review'));$list=$listing('payroll',['record_key'=>$pk]);$ok($list['records']['data'][0]['effective']['id']===$v3['id'],'refusal preserves effective reviewed amount');[$v6]=$command(13,$input('payroll',$pk,5,$changed));[$v7]=$command(14,$input('payroll',$pk,6,['decision'=>'approved'],'review'));$ok($v7['impact']['after']['effective']['calculation']['net_cents']==='890089','reviewed correction updates net exactly');$select(17);$ok($rm->export($hrActor(17),$v3['id'])===$export,'old reviewed export bytes immutable after correction');
|
||||
$cancel=array_replace($changed,['operation'=>'cancel']);[$v8]=$command(13,$input('payroll',$pk,7,$cancel));[$v9]=$command(14,$input('payroll',$pk,8,['decision'=>'approved'],'review'));$ok($v9['impact']['after']['effective']['status']==='cancelled','distinct cancellation preserved');$ok($listing()['page_totals']['approved_active_on_page']===0,'cancelled excluded from active page totals');$reject(fn()=>$preview(13,$input('payroll',$pk,9,$changed)),409,'cancelled record cannot be silently revived');
|
||||
$cancel=array_replace($changed,['operation'=>'cancel']);[$v8]=$command(13,$input('payroll',$pk,7,$cancel));[$v9]=$command(14,$input('payroll',$pk,8,['decision'=>'approved'],'review'));$ok($v9['impact']['after']['effective']['status']==='cancelled','distinct cancellation preserved');$ok($listing('payroll',['search'=>'QA-COLABORADOR-01'])['page_totals']['approved_active_on_page']===0,'cancelled excluded from active page totals');$reject(fn()=>$preview(13,$input('payroll',$pk,9,$changed)),409,'cancelled record cannot be silently revived');
|
||||
$tiny=App\Modules\HumanResources\Remunerations::calculate('0.01',$rulesData);$ok($tiny['net_cents']==='1'&&$tiny['rubrics']['worker_rate']['difference']==='3/100','cent difference exact rational preserved');$missing=App\Modules\HumanResources\Remunerations::calculate('10000.00',array_replace($rulesData,['retention_rate'=>null]));$ok(!$missing['complete']&&$missing['net_cents']===null&&$missing['rubrics']['retention_rate']['cents']===null,'missing parameter not zero net unknown');
|
||||
$newRules=$uuid();$missingRules=array_replace($rulesData,['retention_rate'=>null]);[$a]=$command(13,$input('rules',$newRules,0,$missingRules));[$a]=$command(14,$input('rules',$newRules,1,['decision'=>'approved'],'review'));$p2=$uuid();$pay2=array_replace($pay,['period'=>'2026-10','rules_key'=>$newRules]);[$a]=$command(13,$input('payroll',$p2,0,$pay2));$reject(fn()=>$preview(14,$input('payroll',$p2,1,['decision'=>'approved'],'review')),409,'incomplete payroll cannot be approved complete');
|
||||
$suspended=array_replace($workerData,['operation'=>'amend','status'=>'suspended']);[$a]=$command(13,$input('worker',$wk,2,$suspended));[$a]=$command(14,$input('worker',$wk,3,['decision'=>'approved'],'review'));$reject(fn()=>$preview(13,$input('payroll',$uuid(),0,array_replace($pay,['period'=>'2026-09']))),409,'suspended worker processing refused');
|
||||
|
||||
Reference in New Issue
Block a user