<?php

namespace App\Libraries;

class ProfitCalculator {
    public function hitungLabaItem($harga_jual, $harga_modal, $qty) {
        return ($harga_jual - $harga_modal) * $qty;
    }
    
    public function hitungPersentaseTarget($laba_sekarang, $target) {
        if ($target == 0) return 0;
        return ($laba_sekarang / $target) * 100;
    }
}