Merge branch 'maint'

This commit is contained in:
Christopher Lam
2019-10-31 23:30:13 +08:00
16 changed files with 484 additions and 1035 deletions

View File

@@ -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)
{

View File

@@ -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. */