class Employee: def init(self, name, position, salary): self.name = name self.position = position self.salary = salary
def calculate_allowance(self):
# Basic allowance logic based on position
if self.position in ['ASM', 'AGM', 'BM']:
return self.salary * 0.5 # Example allowance
return 0
def handle_resignation(self, notice_period=True):
if notice_period:
print(f"{self.name} served 1 month notice.")
else:
print(f"{self.name} terminated without notice.")
# Handle last salary slip
print(f"Finance department processing last salary slip for {self.name}.")
# Handle PF and Albraka
print(f"PF and Albraka remaining salary for {self.name} going to HMB.")
asm = Employee('John Doe', 'ASM', 100000) print(f"Allowance for {asm.name}: {asm.calculate_allowance()}") asm.handle_resignation(notice_period=False)