38 #define GNC_ID_OWNER "gncOwner" 84 gncOwnerRegister(
void);
100 GncEmployee * employee;
110 void gncOwnerInitUndefined (
GncOwner *owner, gpointer obj);
112 void gncOwnerInitJob (
GncOwner *owner, GncJob *job);
113 void gncOwnerInitVendor (
GncOwner *owner, GncVendor *vendor);
114 void gncOwnerInitEmployee (
GncOwner *owner, GncEmployee *employee);
141 const char * gncOwnerGetID (
const GncOwner *owner);
142 const char * gncOwnerGetName (
const GncOwner *owner);
144 gboolean gncOwnerGetActive (
const GncOwner *owner);
145 gnc_commodity * gncOwnerGetCurrency (
const GncOwner *owner);
151 void gncOwnerSetActive (
const GncOwner *owner, gboolean active);
221 gnc_numeric amount, gnc_numeric exch,
time64 date,
222 const char *memo,
const char *num);
274 gnc_numeric amount, gnc_numeric exch,
time64 date,
275 const char *memo,
const char *num, gboolean auto_pay);
317 const gnc_commodity *report_currency);
319 #define OWNER_TYPE "type" 320 #define OWNER_TYPE_STRING "type-string" 321 #define OWNER_CUSTOMER "customer" 322 #define OWNER_JOB "job" 323 #define OWNER_VENDOR "vendor" 324 #define OWNER_EMPLOYEE "employee" 325 #define OWNER_PARENT "parent" 326 #define OWNER_PARENTG "parent-guid" 327 #define OWNER_NAME "name" 329 #define OWNER_FROM_LOT "owner-from-lot" 337 void gncOwnerFree (
GncOwner *owner);
346 void gncOwnerCommitEdit (
GncOwner *owner);
347 void gncOwnerDestroy (
GncOwner *owner);
GList * gncOwnerGetCommoditiesList(const GncOwner *owner)
Returns a GList of currencies associated with the owner.
const GncGUID * gncOwnerGetGUID(const GncOwner *owner)
Get the GncGUID of the immediate owner.
union _gncOwner::@20 owner
holds the pointer to the owner object.
gboolean gncOwnerGetOwnerFromTxn(Transaction *txn, GncOwner *owner)
Convenience function to get the owner from a transaction.
GList * gncOwnerGetAccountTypesList(const GncOwner *owner)
Returns a GList of account-types based on the owner type.
const gchar * QofIdTypeConst
QofIdTypeConst declaration.
GncOwnerType type
Customer, Job, Vendor, Employee or Undefined.
gpointer qof_temp
Set type independently of the owner.
gboolean gncOwnerEqual(const GncOwner *a, const GncOwner *b)
Assess equality by checking.
const char * gncOwnerGetTypeString(const GncOwner *owner)
return the type for the owner as an untranslated string.
void gncOwnerBeginEdit(GncOwner *owner)
These are convenience wrappers around gnc{Vendor,Customer,Job,Employee}* functions.
gboolean gncOwnerIsValid(const GncOwner *owner)
Returns TRUE if the given owner is one of the valid objects.
QofInstance * qofOwnerGetOwner(const GncOwner *owner)
return the owner itself as an entity.
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...
const gchar * QofIdType
QofIdType declaration.
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...
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.
Account handling public routines.
gint gncOwnerLotsSortFunc(GNCLot *lotA, GNCLot *lotB)
Helper function used to sort lots by date.
gboolean gncOwnerReduceSplitTo(Split *split, gnc_numeric target_value)
Helper function to reduce the value of a split to target_value.
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...
QofIdTypeConst qofOwnerGetType(const GncOwner *owner)
return the type for the collection.
int gncOwnerCompare(const GncOwner *a, const GncOwner *b)
Sort on name.
void qofOwnerSetEntity(GncOwner *owner, QofInstance *ent)
set the owner from the entity.
void gncOwnerAttachToLot(const GncOwner *owner, GNCLot *lot)
Attach an owner to a lot.
QofIdTypeConst gncOwnerTypeToQofIdType(GncOwnerType t)
Returns the QofIdType of the given GncOwnerType, or NULL if no suitable one exists.
gpointer gncOwnerGetUndefined(const GncOwner *owner)
If the given owner is of type GNC_OWNER_UNDEFINED, returns the undefined pointer, which is usually NU...
gboolean gncOwnerGetOwnerFromLot(GNCLot *lot, GncOwner *owner)
Get the owner from the lot.
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.
credit, discount and shipaddr are unique to GncCustomer id, name, notes, terms, addr, currency, taxtable, taxtable_override taxincluded, active and jobs are identical to ::GncVendor.
gboolean GNC_IS_OWNER(QofInstance *ent)
Check if entity is an owner kind.
GncOwnerType gncOwnerGetType(const GncOwner *owner)
Returns the GncOwnerType of this owner.
const GncOwner * gncOwnerGetEndOwner(const GncOwner *owner)
Get the "parent" Owner or GncGUID thereof.
Business Invoice Interface.
GncJob * gncOwnerGetJob(const GncOwner *owner)
If the given owner is of type GNC_OWNER_JOB, returns the pointer to the job object.
gboolean gncOwnerLotMatchOwnerFunc(GNCLot *lot, gpointer user_data)
Helper function used to filter a list of lots by owner.
Split * gncOwnerFindOffsettingSplit(GNCLot *pay_lot, gnc_numeric target_value)
Helper function to find a split in lot that best offsets target_value Obviously it should be of oppos...
GncVendor * gncOwnerGetVendor(const GncOwner *owner)
If the given owner is of type GNC_OWNER_VENDOR, returns the pointer to the vendor object...
GncCustomer * gncOwnerGetCustomer(const GncOwner *owner)
If the given owner is of type GNC_OWNER_CUSTOMER, returns the pointer to the customer object...
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...
gint64 time64
Many systems, including Microsoft Windows and BSD-derived Unixes like Darwin, are retaining the int-3...
GncEmployee * gncOwnerGetEmployee(const GncOwner *owner)
If the given owner is of type GNC_OWNER_EMPLOYEE, returns the pointer to the employee object...
The type used to store guids in C.
GncOwner * gncOwnerNew(void)
These two functions are mainly for the convenience of scheme code.