mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gncOwner] add gncOwnerGetTypeString returns owner-type
* will have several uses
This commit is contained in:
@@ -204,6 +204,29 @@ GncOwnerType gncOwnerGetType (const GncOwner *owner)
|
||||
return owner->type;
|
||||
}
|
||||
|
||||
const char * gncOwnerGetTypeString (const GncOwner *owner)
|
||||
{
|
||||
GncOwnerType type = gncOwnerGetType(owner);
|
||||
switch (type)
|
||||
{
|
||||
case GNC_OWNER_NONE:
|
||||
return "None";
|
||||
case GNC_OWNER_UNDEFINED:
|
||||
return "Undefined";
|
||||
case GNC_OWNER_CUSTOMER:
|
||||
return "Customer";
|
||||
case GNC_OWNER_JOB:
|
||||
return "Job";
|
||||
case GNC_OWNER_VENDOR:
|
||||
return "Vendor";
|
||||
case GNC_OWNER_EMPLOYEE:
|
||||
return "Employee";
|
||||
default:
|
||||
PWARN ("Unknown owner type");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
QofIdTypeConst
|
||||
qofOwnerGetType(const GncOwner *owner)
|
||||
{
|
||||
|
||||
@@ -65,6 +65,8 @@ to QOF as they can be used by objects like GncInvoice.
|
||||
*/
|
||||
/** return the type for the collection. */
|
||||
QofIdTypeConst qofOwnerGetType(const GncOwner *owner);
|
||||
/** return the type for the owner as an untranslated string. */
|
||||
const char * gncOwnerGetTypeString (const GncOwner *owner);
|
||||
/** return the owner itself as an entity. */
|
||||
QofInstance* qofOwnerGetOwner (const GncOwner *owner);
|
||||
/** set the owner from the entity. */
|
||||
|
||||
Reference in New Issue
Block a user