Dynamic cursors in SplitLedger?

Dave Peticolas dave@krondo.com
27 Nov 2001 16:20:40 -0800


--=-7Kkzc+PKb1PesNz2kTes
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2001-11-27 at 14:22, Derek Atkins wrote:
> Is there some way to dynamically change the current cursor "on the
> fly"?  For instance, what I'd like to do is setup the A/R,A/P ledgers
> to look something like this:
>=20
> <Date> <type> <Due Date> <Number> <Desc> <Account> <Paid> <Deb> <Cred> <B=
al>
>=20
> The <type> is limited to a choice of "invoice" or "payment".  If the
> type is set to "invoice", then all of the fields are active except the
> appropriate Deb/Cred field for the type of account (payable or
> receivable).
>=20
> If the type is set to "payment", then the due date is inactive and
> cleared, 'paid' is automatically set to 'y', and only the appropriate
> Deb/Cred field is active.  (The rest should remain active as usual).
>=20
> So the question is, how can I easily make this dynamic cursor based on
> the <type> entry?  Can the ledger code handle something like this?  Or
> do I have to live with the possibility of someone entering fields
> improperly and just let them shoot themselves in the foot?

You can do this easily. Check out split-register-model.c:1250
where the debit/credit fields are made editable/non-editable
based on whether you are editing a stock split transaction
or not.

dave


--=-7Kkzc+PKb1PesNz2kTes
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8BC3Y5effKKCmfpIRAg5dAKDaK/INApy+tsXLmVfsdLP92uXwjwCgwZkg
gbwmtcmv3YVlhmwf4KRhykM=
=hgEG
-----END PGP SIGNATURE-----

--=-7Kkzc+PKb1PesNz2kTes--