<?php
include("../classes/manager.class.php");

$m = new Manager();
$supplier_id = $_REQUEST['id'] ?? null;

if ($supplier_id) {
    $supplier = SupplierSetup::GetSupplierSetupById($supplier_id); // Assuming this method exists
    if ($supplier) {
        $response = [
            'wht' => $supplier->wht, // Fetch the WHT value from the supplier object
            'exemption_date' => $supplier->exemption_date ?? null, // Include exemption_date in the response
          	'category_id' => $supplier->category_id ?? null // Include category id
          	
        ];
        echo json_encode($response);
    } else {
        echo json_encode(['error' => 'Supplier not found']);
    }
} else {
    echo json_encode(['error' => 'Invalid supplier ID']);
}
