'มกราคม', '02' => 'กุมภาพันธ์', '03' => 'มีนาคม', '04' => 'เมษายน', '05' => 'พฤษภาคม', '06' => 'มิถุนายน', '07' => 'กรกฎาคม', '08' => 'สิงหาคม', '09' => 'กันยายน', '10' => 'ตุลาคม', '11' => 'พฤศจิกายน', '12' => 'ธันวาคม' ]; $thaiYear = $year + 543; $monthName = $thaiMonths[$month] ?? ''; // Grouping by Fund Source $cgdIncomes = []; $hospIncomes = []; foreach($incomes as $inc) { if ($inc['amount'] > 0) { if (($inc['fund_source'] ?? '') === 'CGD') $cgdIncomes[] = $inc; else $hospIncomes[] = $inc; } } $cgdDeductions = []; $hospDeductions = []; foreach($deductions as $ded) { if ($ded['amount'] > 0) { if (($ded['fund_source'] ?? '') === 'CGD') $cgdDeductions[] = $ded; else $hospDeductions[] = $ded; } } $cgdTotalIncome = array_sum(array_column($cgdIncomes, 'amount')); $cgdTotalDeduction = array_sum(array_column($cgdDeductions, 'amount')); $hospTotalIncome = array_sum(array_column($hospIncomes, 'amount')); $hospTotalDeduction = array_sum(array_column($hospDeductions, 'amount')); $netSalary = ($cgdTotalIncome + $hospTotalIncome) - ($cgdTotalDeduction + $hospTotalDeduction); ?>
โรงพยาบาลเกาะสมุย |
|||
| ชื่อ - สกุล | = htmlspecialchars($hrData['HR_FNAME'] ?? $salary['first_name']) ?> = htmlspecialchars($hrData['HR_LNAME'] ?? $salary['last_name']) ?> | ตำแหน่ง | = htmlspecialchars($hrData['HR_POSITION_NAME'] ?? '-') ?> |
| กรม | สำนักงานปลัดกระทรวงสาธารณสุข | ระดับ | = htmlspecialchars($hrData['HR_LEVEL_NAME'] ?? 'ชำนาญการ') ?> |
| สำนัก/กอง/ศูนย์ | โรงพยาบาลทั่วไปเกาะสมุย | เลขที่ตำแหน่ง | = htmlspecialchars($hrData['HR_POSITION_NUM'] ?? '-') ?> |
| รอบจ่าย | เดือน = $monthName ?> ปี = $thaiYear ?> | แผนก | = htmlspecialchars($hrData['HR_DEPARTMENT_SUB_SUB_NAME'] ?? '-') ?> |
| โอนเงินเข้า | = htmlspecialchars($bankProfile['bank_name'] ?? 'ธนาคารกรุงไทย จำกัด(มหาชน)') ?> | เลขที่บัญชี | = htmlspecialchars($bankProfile['bank_account'] ?? '-') ?> |
| รายการจากกรมบัญชีกลาง | |||
| รายรับ | จำนวน (บาท) | รายจ่าย | จำนวน (บาท) |
| = $inc ? htmlspecialchars($inc['name']) : ' ' ?> | = $inc ? number_format($inc['amount'], 2) : '' ?> | = $ded ? htmlspecialchars($ded['name']) : '' ?> | = $ded ? number_format($ded['amount'], 2) : '' ?> |
| รวมรับ | = number_format($cgdTotalIncome, 2) ?> | รวมจ่าย | = number_format($cgdTotalDeduction, 2) ?> |
| รับสุทธิจากกรมบัญชีกลาง | = number_format($cgdTotalIncome - $cgdTotalDeduction, 2) ?> | ||
| รายการจากโรงพยาบาล | |||
| รายรับ | จำนวน (บาท) | รายจ่าย | จำนวน (บาท) |
| = $inc ? htmlspecialchars($inc['name']) : ' ' ?> | = $inc ? number_format($inc['amount'], 2) : '' ?> | = $ded ? htmlspecialchars($ded['name']) : '' ?> | = $ded ? number_format($ded['amount'], 2) : '' ?> |
| รวมรับ | = number_format($hospTotalIncome, 2) ?> | รวมจ่าย | = number_format($hospTotalDeduction, 2) ?> |
| รับสุทธิจากโรงพยาบาล | = number_format($hospTotalIncome - $hospTotalDeduction, 2) ?> | ||
| รวมรับสุทธิทั้งสิ้น | = number_format($netSalary, 2) ?> |
| ลงชื่อ |
|
| = htmlspecialchars($signatureName ?? '( นางณัฐฐิณี เรืองทอง )') ?> | |
| = htmlspecialchars($signaturePosition ?? 'นักวิชาการเงินและบัญชี') ?> |