Re: [CK-Ledger-users] accno
Status: Beta
Brought to you by:
ckwu
|
From: C K Wu <ck...@ch...> - 2002-05-23 04:34:20
|
Robert,
I am afraid there is some confusion over the purpose of the 'accno'
and the 'id' field within the 'chart' table.
In the 'chart' table, the two fields ,
id - internal (to ck-ledger, unique systemwise) record identifier
- type: integer.
accno - human-readable account number
- type: text (potentially free-format).
serve different purposes.
The other ' _id' ending fields in the other tables are internal pointers
pointing back to the individual 'chart' records, so they should accord
with the 'id' field type.
The "accno" field is mainly for human consumption so it could be
structured differently according different organisational settings, eg,
additional structural validation checks (check digits, etc) can be
instituted on this field.
The design of "ap.ap_accno_id, ..... " => "chart.id" (design 1), instead of,
"ap.ap_accno_id,...." => "chart.accno" (design 2) is to separate internal
pointer structure from external interface. This way, the internal
pointer does not have to concern itself with the structure of the
account number, which varies installation from installation.
SQL-Ledger, actually shifts from design 2 to design 1 back at version 1.2.x (?)
.
So, ap_accno_id....., should stay as int. Oh, and the change to
class.account.inc.php is fine.
Cheers,
CK
robert del huerto wrote:
> Okay, this is what I've changed so far...
>
> in class.account.inc.php I changed the following line:
>
> elseif (!is_numeric($a[accno])) $err='<b>[[Error: Invalid Account#, must be
> numberic]]</b>';
>
> to:
>
> elseif (!is_valid_account($a[accno])) $err='<b>[[Error: Invalid Account
> Number]]</b>';
>
> ..and I added the following function which we can improve on later.
>
> function is_valid_account($accno) {
>
> return true;
>
> }
>
> I also changed the following fields from int to char(15):
>
> gl.accno
> ap.ap_accno_id
> ar.ar_accno_id
> defaults.inventory_accno_id
> defaults.income_accno_id
> defaults.expense_accno_id
> invoice.inventory_accno_id
> invoice.income_accno_id
> invoice.expense_accno_id
> invoice.tax1_accno_id
> invoice.tax2_accno_id
> parts.inventory_accno_id
> parts.income_accno_id
> parts.expense_accno_id
> payment.dr_accno_id
> payment.cr_accno_id
> receipt.dr_accno_id
> receipt.cr_accno_id
> service.income_accno_id
> service.expense_accno_id
>
> Okay, let's see how things work now.
>
> robert
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
> _______________________________________________
> CK-Ledger-users mailing list
> CK-...@li...
> https://lists.sourceforge.net/lists/listinfo/ck-ledger-users
|