[RM-33557]: <SPU> ตรวจสอบค่าปรับ

Viewed 2

Problem Summary

From Redmine:

  • ค่าปรับวันปัจจุบันไม่ถูกคำนวนใหม่ตอนที่ cron ทำงาน
  • ค่าปรับถูกคิดใหม่ตอนที่ check in กับ renew
Koha version 24.11. พบว่าค่าปรับไม่ตรง

# ลูกค้าแจ้ง case
1. item A มี due date = 24/12/2025
2. วันที่ 25/12 เวลา 6.00 (cron รัน)
3. ไม่เกิดค่าปรับ
4. พอเอา item A มาคืน ระบบแจ้งว่ามีค่าปรับ

# ข้อมูลเพิ่มเติม
pref "finesMode"=production
circ rules "Fine/suspension grace period"=0 (all rules)
calendar วันที่ 25 ไม่ใช่วันหยุด


# ตรวจสอบเพิ่มเติม
เครื่อง production: (เครื่องที่ลูกค้าใช้และเจอปัญหา)
ตรวจสอบพบว่าวันที่ 25 มีการสร้างค่าปรับ 2 รายการ ซึ่งทุกรายการมี due date=23
สร้างค่าปรับตอนประมาณ 08:32:xx ทั้ง 2 รายการ
crontab daily =25 6    * * *

เครื่อง dev:
1. checkout item A ให้มี due=5 Jan (เมื่อวาน)
2. run fines.pl
3. เกิดค่าปรับ

Root Cause Analysis

ตรวจสอบ Timezone ของเครื่อง production พบว่ามี timezone ไม่ถูกต้อง

# Production
cat /etc/timezone
US/Eastern
ls -l /etc/localtime
/etc/localtime -> /usr/share/zoneinfo/Asia/Bangkok

# Dev
cat /etc/timezone
Asia/Bangkok
ls -l /etc/localtime
/etc/localtime -> /usr/share/zoneinfo/Asia/Bangkok

ทำให้เวลา offset ไป 12 ชั่วโมง

1 Answers

Solution / Workaround

echo "Asia/Bangkok" > /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata

Verification Steps

ทดสอบเบื้องต้นเวลาถูกต้องแล้ว รอตรวจสอบค่าปรับพรุ่งนี้เวลา 7 Jan 2026 เวลา 9.00