43#define GNC_ID_OWNER "gncOwner"
89gncOwnerRegister(
void);
105 GncEmployee * employee;
115void gncOwnerInitUndefined (
GncOwner *owner, gpointer obj);
117void gncOwnerInitJob (
GncOwner *owner, GncJob *job);
118void gncOwnerInitVendor (
GncOwner *owner, GncVendor *vendor);
119void gncOwnerInitEmployee (
GncOwner *owner, GncEmployee *employee);
146const char * gncOwnerGetID (
const GncOwner *owner);
147const char * gncOwnerGetName (
const GncOwner *owner);
149gboolean gncOwnerGetActive (
const GncOwner *owner);
150gnc_commodity * gncOwnerGetCurrency (
const GncOwner *owner);
156void gncOwnerSetActive (
const GncOwner *owner, gboolean active);
226 gnc_numeric amount, gnc_numeric exch,
time64 date,
227 const char *memo,
const char *num);
279 gnc_numeric amount, gnc_numeric exch,
time64 date,
280 const char *memo,
const char *num, gboolean auto_pay);
322 const gnc_commodity *report_currency);
324#define OWNER_TYPE "type"
325#define OWNER_TYPE_STRING "type-string"
326#define OWNER_CUSTOMER "customer"
327#define OWNER_JOB "job"
328#define OWNER_VENDOR "vendor"
329#define OWNER_EMPLOYEE "employee"
330#define OWNER_PARENT "parent"
331#define OWNER_PARENTG "parent-guid"
332#define OWNER_NAME "name"
334#define OWNER_FROM_LOT "owner-from-lot"
351void gncOwnerCommitEdit (
GncOwner *owner);
352void gncOwnerDestroy (
GncOwner *owner);
Account handling public routines.
Business Invoice Interface.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
const gchar * QofIdType
QofIdType declaration.
const gchar * QofIdTypeConst
QofIdTypeConst declaration.
GncCustomer * gncOwnerGetCustomer(const GncOwner *owner)
If the given owner is of type GNC_OWNER_CUSTOMER, returns the pointer to the customer object.
void gncOwnerAutoApplyPaymentsWithLots(const GncOwner *owner, GList *lots)
Given a list of lots, try to balance as many of them as possible by creating balancing transactions b...
gboolean GNC_IS_OWNER(QofInstance *ent)
Check if entity is an owner kind.
gboolean gncOwnerIsValid(const GncOwner *owner)
Returns TRUE if the given owner is one of the valid objects.
gboolean gncOwnerGetOwnerFromLot(GNCLot *lot, GncOwner *owner)
Get the owner from the lot.
void gncOwnerAttachToLot(const GncOwner *owner, GNCLot *lot)
Attach an owner to a lot.
GList * gncOwnerGetCommoditiesList(const GncOwner *owner)
Returns a GList of currencies associated with the owner.
void gncOwnerBeginEdit(GncOwner *owner)
These are convenience wrappers around gnc{Vendor,Customer,Job,Employee}* functions.
GncEmployee * gncOwnerGetEmployee(const GncOwner *owner)
If the given owner is of type GNC_OWNER_EMPLOYEE, returns the pointer to the employee object.
QofIdTypeConst qofOwnerGetType(const GncOwner *owner)
return the type for the collection.
GList * gncOwnerGetAccountTypesList(const GncOwner *owner)
Returns a GList of account-types based on the owner type.
GncJob * gncOwnerGetJob(const GncOwner *owner)
If the given owner is of type GNC_OWNER_JOB, returns the pointer to the job object.
GNCLot * gncOwnerCreatePaymentLotSecs(const GncOwner *owner, Transaction **preset_txn, Account *posted_acc, Account *xfer_acc, gnc_numeric amount, gnc_numeric exch, time64 date, const char *memo, const char *num)
Create a lot for a payment to the owner using the other parameters passed in.
Split * gncOwnerFindOffsettingSplit(GNCLot *lot, gnc_numeric target_amount)
Helper function to find a split in lot that best offsets target_amount Obviously it should be of oppo...
void gncOwnerApplyPaymentSecs(const GncOwner *owner, Transaction **preset_txn, GList *lots, Account *posted_acc, Account *xfer_acc, gnc_numeric amount, gnc_numeric exch, time64 date, const char *memo, const char *num, gboolean auto_pay)
A convenience function to apply a payment to the owner.
gboolean gncOwnerReduceSplitTo(Split *split, gnc_numeric target_amount)
Helper function to reduce the amount of a split to target_amount.
void gncOwnerSetLotLinkMemo(Transaction *ll_txn)
To help a user understand what a lot link transaction does, we set the memo to name all documents inv...
int gncOwnerCompare(const GncOwner *a, const GncOwner *b)
Sort on name.
gint gncOwnerLotsSortFunc(GNCLot *lotA, GNCLot *lotB)
Helper function used to sort lots by date.
GncVendor * gncOwnerGetVendor(const GncOwner *owner)
If the given owner is of type GNC_OWNER_VENDOR, returns the pointer to the vendor object.
const GncOwner * gncOwnerGetEndOwner(const GncOwner *owner)
Get the "parent" Owner or GncGUID thereof.
int gncOwnerGCompareFunc(const GncOwner *a, const GncOwner *b)
Same as gncOwnerEqual, but returns 0 if equal to be used as a GList custom compare function.
gboolean gncOwnerEqual(const GncOwner *a, const GncOwner *b)
Assess equality by checking.
gboolean gncOwnerLotMatchOwnerFunc(GNCLot *lot, gpointer user_data)
Helper function used to filter a list of lots by owner.
gpointer gncOwnerGetUndefined(const GncOwner *owner)
If the given owner is of type GNC_OWNER_UNDEFINED, returns the undefined pointer, which is usually NU...
const GncGUID * gncOwnerGetGUID(const GncOwner *owner)
Get the GncGUID of the immediate owner.
GncOwner * gncOwnerNew(void)
These two functions are mainly for the convenience of scheme code.
GncOwnerType gncOwnerGetType(const GncOwner *owner)
Returns the GncOwnerType of this owner.
const char * gncOwnerGetTypeString(const GncOwner *owner)
return the type for the owner as an untranslated string.
QofInstance * qofOwnerGetOwner(const GncOwner *owner)
return the owner itself as an entity.
QofIdTypeConst gncOwnerTypeToQofIdType(GncOwnerType t)
Returns the QofIdType of the given GncOwnerType, or NULL if no suitable one exists.
void qofOwnerSetEntity(GncOwner *owner, QofInstance *ent)
set the owner from the entity.
gboolean gncOwnerGetOwnerFromTxn(Transaction *txn, GncOwner *owner)
Convenience function to get the owner from a transaction.
gnc_numeric gncOwnerGetBalanceInCurrency(const GncOwner *owner, const gnc_commodity *report_currency)
Given an owner, extract the open balance from the owner and then convert it to the desired currency.
credit, discount and shipaddr are unique to GncCustomer id, name, notes, terms, addr,...
The type used to store guids in C.
gpointer qof_temp
Set type independently of the owner.
GncOwnerType type
Customer, Job, Vendor, Employee or Undefined.
union _gncOwner::@21 owner
holds the pointer to the owner object.