delete_cust_allocation($alloc['id']);
if ($unalloc < $alloc['amt'])
add_cust_allocation($alloc['amt']-$unalloc, $alloc['trans_type_from'],
$alloc['trans_no_from'], ST_SALESINVOICE, $invoice_no);
delete_cust_allocation($alloc['id']);
if ($unalloc < $alloc['amt'])
add_cust_allocation($alloc['amt']-$unalloc, $alloc['trans_type_from'],
$alloc['trans_no_from'], ST_SALESINVOICE, $invoice_no);