//
function write_credit_note($credit_note, $write_off_acc)
{
- $credit_invoice = count($credit_note->src_docs) ? key($credit_note->src_docs) : 0;
+ $credit_invoice = count($credit_note->src_docs) ? reset($credit_note->src_docs) : 0;
$credit_date = $credit_note->document_date;
if (count($cart->src_docs) == 1) {
// if this child document has only one parent - update child link
- $del_no = key($cart->src_docs);
+ $del_no = reset($cart->src_docs);
$sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no .
' WHERE type='.$cart->trans_type.' AND trans_no='. $inv_no ;