<?php

function get_fi_petty_cash_direct_payments($cutoff_date, $batch_size)
{
    $sql = "SELECT pay.id,
                pay.iou_id,
                pay.is_return,
                pay.payment_date,
                pay.amount,
                pay.paid,
                pay.expense_source,
                pcf.account_code 
            FROM ".TB_PREF."i_owe_you_payments pay 
                JOIN ".TB_PREF."petty_cash_floats pcf 
                    ON pcf.id = pay.float_id 
            WHERE pay.expense_source IN (".ST_VEHICLE_ALLOCATION.",".ST_VEHICLE_RUNNING_CHART.")
                AND pay.payment_date <= ".db_escape($cutoff_date)."  
                    AND pay.fi_batch_no = 0 
            ORDER BY pay.id 
            LIMIT ".$batch_size;

    return db_query($sql);
}

