<?php

function get_fi_petty_cash_float_adjustments($cutoff_date, $batch_size)
{
    $sql = "SELECT fa.id,
                fa.tran_date,
                fa.float_id,
                fa.is_return,
                fa.amount,
                pcf.account_code 
            FROM ".TB_PREF."petty_cash_float_adjustments fa 
                JOIN ".TB_PREF."petty_cash_floats pcf 
                    ON pcf.id = fa.float_id 
            WHERE fa.tran_date <= ".db_escape($cutoff_date)."  
                    AND fa.fi_batch_no = 0 
            ORDER BY fa.id 
            LIMIT ".$batch_size;
    
    return db_query($sql);
}

