mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-16 18:25:11 -06:00
Add generic owner setter function for the active property
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20618 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
50313596b4
commit
c39a9a4c59
@ -419,6 +419,31 @@ const GncGUID * gncOwnerGetGUID (const GncOwner *owner)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gncOwnerSetActive (const GncOwner *owner, gboolean active)
|
||||
{
|
||||
if (!owner) return;
|
||||
switch (owner->type)
|
||||
{
|
||||
case GNC_OWNER_CUSTOMER:
|
||||
gncCustomerSetActive (owner->owner.customer, active);
|
||||
break;
|
||||
case GNC_OWNER_VENDOR:
|
||||
gncVendorSetActive (owner->owner.vendor, active);
|
||||
break;
|
||||
case GNC_OWNER_EMPLOYEE:
|
||||
gncEmployeeSetActive (owner->owner.employee, active);
|
||||
break;
|
||||
case GNC_OWNER_JOB:
|
||||
gncJobSetActive (owner->owner.job, active);
|
||||
break;
|
||||
case GNC_OWNER_NONE:
|
||||
case GNC_OWNER_UNDEFINED:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GncGUID gncOwnerRetGUID (GncOwner *owner)
|
||||
{
|
||||
const GncGUID *guid = gncOwnerGetGUID (owner);
|
||||
|
@ -114,16 +114,23 @@ GncCustomer * gncOwnerGetCustomer (const GncOwner *owner);
|
||||
GncJob * gncOwnerGetJob (const GncOwner *owner);
|
||||
GncVendor * gncOwnerGetVendor (const GncOwner *owner);
|
||||
GncEmployee * gncOwnerGetEmployee (const GncOwner *owner);
|
||||
/** @} */
|
||||
void gncOwnerCopy (const GncOwner *src, GncOwner *dest);
|
||||
gboolean gncOwnerEqual (const GncOwner *a, const GncOwner *b);
|
||||
int gncOwnerCompare (const GncOwner *a, const GncOwner *b);
|
||||
|
||||
const char * gncOwnerGetID (const GncOwner *owner);
|
||||
const char * gncOwnerGetName (const GncOwner *owner);
|
||||
GncAddress * gncOwnerGetAddr (const GncOwner *owner);
|
||||
gboolean gncOwnerGetActive (const GncOwner *owner);
|
||||
gnc_commodity * gncOwnerGetCurrency (const GncOwner *owner);
|
||||
/** @} */
|
||||
|
||||
/** \name Set routines.
|
||||
@{
|
||||
*/
|
||||
void gncOwnerSetActive (const GncOwner *owner, gboolean active);
|
||||
/** @} */
|
||||
|
||||
void gncOwnerCopy (const GncOwner *src, GncOwner *dest);
|
||||
gboolean gncOwnerEqual (const GncOwner *a, const GncOwner *b);
|
||||
int gncOwnerCompare (const GncOwner *a, const GncOwner *b);
|
||||
|
||||
/** Get the GncGUID of the immediate owner */
|
||||
const GncGUID * gncOwnerGetGUID (const GncOwner *owner);
|
||||
|
Loading…
Reference in New Issue
Block a user