"David Durst" <[EMAIL PROTECTED]> writes:
> But I still think your point about the function selecting more than
> one line is valid.
> The problem is, the journal_line_id is not created until the insert
> occurs and there is no other unique ident than the journal_line_id.
Well, my standard answer
> "David Durst" <[EMAIL PROTECTED]> writes:
>> insert into journal_lines
>> (entry_id,account_id,line_type,line_amount)
>> values (eid,aid,ltype,amount);
>> select into line * from journal_lines where entry_id = eid AND
>> account_id = aid AND ltype = ltype;
>
> I bet that last should be line_t
"David Durst" <[EMAIL PROTECTED]> writes:
> insert into journal_lines (entry_id,account_id,line_type,line_amount)
> values (eid,aid,ltype,amount);
> select into line * from journal_lines where entry_id = eid AND
> account_id = aid AND ltype = ltype;
I bet that last should be line_type = ltype?
David,
> Cash - Debit 100
> A/R - Credit 100
> Cash - Credit 100
> A/R - Debit 100
> (Which should have a net affect of 0 on both accounts)
>
> But here is the resulting balance on accounts,
>
> Cash Debit Balance 200
> A/R Credit Balance 200
Here may your problem, and it's in the schema
David,
> I have a function that is to create a Accounting JOURNAL entry.
> The strange thing is the function works for simple entries such as:
> Here is the function and I can't seem to figure out what is LOGICALLY
> wrong and would produce these results.
I'm not sure the problem is with the fun
I have a function that is to create a Accounting JOURNAL entry.
The strange thing is the function works for simple entries such as:
Cash - Debit 100
A/R - Credit 100
But when I try to trick it or break it for testing purposes (IT DOES BREAK
WHEN IT SHOULDN'T) on a entry like this:
Cash - Debit