init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
118
scripts/ajax/lohnausfall.php
Normal file
118
scripts/ajax/lohnausfall.php
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
error_reporting(E_ALL); ini_set('display_errors',0);
|
||||
// echo "<pre>"; print_r($tarifi); echo "</pre>";
|
||||
$tagp = strtotime("+0 day");
|
||||
$tag = date("d",$tagp);
|
||||
$monat = date("m",$tagp);
|
||||
$jahr = date("Y",$tagp);
|
||||
$datum=$tag.".".$monat.".".$jahr;
|
||||
|
||||
|
||||
$fahrer = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$_GET['ma']."'");
|
||||
$tarifi = $GLOBALS['mysql']->query_single("SELECT * FROM tariftyp WHERE id='".$fahrer['tarifgtyp']."'");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------
|
||||
//--------------- Lohn
|
||||
//-----------------------
|
||||
$fahrer = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$_GET['ma']."'");
|
||||
$tarifi = $GLOBALS['mysql']->query_single("SELECT * FROM tariftyp WHERE id='".$fahrer['tarifgtyp']."'");
|
||||
//-------- Grundlohn
|
||||
if ($fahrer['einmonat']==$_GET['monat'] && $fahrer['einjahr']==$_GET['jahr']) {
|
||||
$gtage=27-$fahrer['eintag']; $glohn=($fahrer['tarifg']/26); $glohn=$glohn*$gtage; $glohn=round($glohn,0);
|
||||
//$glohn
|
||||
} else {
|
||||
$glohn=$fahrer['tarifg'];
|
||||
}
|
||||
$template->assign('grundgehalt', $glohn);
|
||||
//----------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//------------- Zählerausrechnung
|
||||
$zz=0;
|
||||
$temp2 = $GLOBALS['mysql']->query("SELECT * FROM tourentyp");
|
||||
while($row = $temp2->fetch_assoc()) {
|
||||
$tl=$GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE fahrer='".$_GET['ma']."' AND monat='".$_GET['monat']."' AND jahr='".$_GET['jahr']."' AND typ='".$row['tid']."' AND utyp!=9");
|
||||
if($tl['num_rows']>0) { $tmpl=0;
|
||||
$ldaten = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE fahrer='".$_GET['ma']."' AND monat='".$_GET['monat']."' AND jahr='".$_GET['jahr']."' AND typ='".$row['tid']."' AND utyp!=9 ORDER BY tag");
|
||||
while($rowl = $ldaten->fetch_assoc()) { $tmpl=$tmpl+$rowl['tarif']; } $glohn=$glohn+$tmpl; $zz++;
|
||||
$tml[$zz]['a']=$row['tname'];
|
||||
$tml[$zz]['b']=$tl['num_rows']." Touren";
|
||||
$tml[$zz]['c']=number_format($tmpl, 2, '.', '')." EUR";
|
||||
}
|
||||
$tl=$GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE fahrer='".$_GET['ma']."' AND monat='".$_GET['monat']."' AND jahr='".$_GET['jahr']."' AND typ='".$row['tid']."' AND utyp=9");
|
||||
if($tl['num_rows']>0) { $tmpl=0;
|
||||
$ldaten = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE fahrer='".$_GET['ma']."' AND monat='".$_GET['monat']."' AND jahr='".$_GET['jahr']."' AND typ='".$row['tid']."' AND utyp=9 ORDER BY tag");
|
||||
while($rowl = $ldaten->fetch_assoc()) { $tmpl=$tmpl+$rowl['tarif']; } $glohn=$glohn+$tmpl; $zz++;
|
||||
$tml[$zz]['a']=$row['tname']." -Abn.";
|
||||
$tml[$zz]['b']=$tl['num_rows']." Touren";
|
||||
$tml[$zz]['c']=number_format($tmpl, 2, ',', '')." EUR";
|
||||
}
|
||||
}
|
||||
$zb=1;
|
||||
$template->assign('tml', $tml);
|
||||
//----------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------
|
||||
//$pdf->Cell(70,5,("Zwischenumme: "),'0','0','R','0'); $pdf->Cell(30,5,($glohn." EUR"),'0','1','R','0');
|
||||
|
||||
//lohnabzug
|
||||
$ma_minus = $GLOBALS['mysql']->query_single("SELECT * FROM ma_abzahlung WHERE mid='".$_GET['ma']."' AND monat='".$_GET['monat']."' AND jahr='".$_GET['jahr']."'");
|
||||
if($ma_minus['num_rows']>0) { $zv=0;
|
||||
$temp8 = $GLOBALS['mysql']->query("SELECT * FROM ma_abzahlung WHERE mid='".$_GET['ma']."' AND monat='".$_GET['monat']."' AND jahr='".$_GET['jahr']."'");
|
||||
while($row = $temp8->fetch_assoc()) {
|
||||
$temp8[$zv]['a']=$row['summe'];
|
||||
$temp8[$zv]['b']=$row['grund'];
|
||||
$minuslohn=number_format($row['summe'], 2, ',', ''); // 2 nachkommastellen
|
||||
$glohn=$glohn-$minuslohn;
|
||||
}
|
||||
$template->assign('temp8', $temp8);
|
||||
|
||||
|
||||
$glohn=number_format($glohn, 2, ',', ''); // 2 nachkommastellen
|
||||
}
|
||||
// $glohn=number_format($glohn, 2, ',', ''); // 2 nachkommastellen
|
||||
/*
|
||||
if($tarifi['netto']>0) {
|
||||
$pdf->Cell(70,5,("NETTO-Summe: "),'0','0','R','0'); $pdf->Cell(30,5,($glohn." EUR"),'0','0','R','0');
|
||||
} else {
|
||||
$pdf->Cell(70,5,("Brutto-Summe: "),'0','0','R','0'); $pdf->Cell(30,5,($glohn." EUR"),'0','0','R','0');
|
||||
}
|
||||
|
||||
$pdf->Cell(10,4,(" "),'0','0','R','0'); $za++;
|
||||
$pdf->Cell(10,4,(" "),'0','0','R','0');
|
||||
$pdf->Cell(50,4,(" "),'0','0','L','0'); $pdf->Cell(20,4,(" "),'0','1','R','0'); $pdf->SetFont('Helvetica','',9);
|
||||
$fahrer = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$_GET['ma']."'");
|
||||
$pdf->Output('Lohnvorschlag_'.($fahrer['name']).'.pdf','I');
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$template->assign('datum', $datum);
|
||||
$template->assign('kal', $maf1);
|
||||
$template->assign('content', 'tpl/ajax/lohnausfall.tpl');
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue