43 #define GNC_ID_OWNER "gncOwner" 89 gncOwnerRegister(
void);
105 GncEmployee * employee;
115 void gncOwnerInitUndefined (
GncOwner *owner, gpointer obj);
117 void gncOwnerInitJob (
GncOwner *owner, GncJob *job);
118 void gncOwnerInitVendor (
GncOwner *owner, GncVendor *vendor);
119 void gncOwnerInitEmployee (
GncOwner *owner, GncEmployee *employee);
146 const char * gncOwnerGetID (
const GncOwner *owner);
147 const char * gncOwnerGetName (
const GncOwner *owner);
149 gboolean gncOwnerGetActive (
const GncOwner *owner);
150 gnc_commodity * gncOwnerGetCurrency (
const GncOwner *owner);
156 void 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" 342 void gncOwnerFree (
GncOwner *owner);
351 void gncOwnerCommitEdit (
GncOwner *owner);
352 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.
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.
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 *lot, gnc_numeric target_amount)
Helper function to find a split in lot that best offsets target_amount Obviously it should be of oppo...
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...
union _gncOwner::@21 owner
holds the pointer to the owner 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
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
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.
gboolean gncOwnerReduceSplitTo(Split *split, gnc_numeric target_amount)
Helper function to reduce the amount of a split to target_amount.