void gncJobSetReference (GncJob *job, const char *desc) { if (!job) return; if (!desc) return; SET_STR(job, job->desc, desc); mark_job (job); gncJobCommitEdit (job); }
void gncJobSetName (GncJob *job, const char *name) { if (!job) return; if (!name) return; SET_STR(job, job->name, name); mark_job (job); gncJobCommitEdit (job); }
void gncJobSetID (GncJob *job, const char *id) { if (!job) return; if (!id) return; SET_STR(job, job->id, id); mark_job (job); gncJobCommitEdit (job); }
void gncJobSetActive (GncJob *job, gboolean active) { if (!job) return; if (active == job->active) return; gncJobBeginEdit (job); job->active = active; mark_job (job); gncJobCommitEdit (job); }
static void qofJobSetOwner (GncJob *job, QofInstance *ent) { if (!job || !ent) { return; } qof_begin_edit(job); qofOwnerSetEntity(&job->owner, ent); mark_job (job); qof_commit_edit(job); }
static void qofJobSetOwner (GncJob *job, QofInstance *ent) { if (!job || !ent) { return; } gncJobBeginEdit (job); qofOwnerSetEntity(&job->owner, ent); mark_job (job); gncJobCommitEdit (job); }
void gncJobSetOwner (GncJob *job, GncOwner *owner) { if (!job) return; if (!owner) return; if (gncOwnerEqual (owner, &(job->owner))) return; switch (gncOwnerGetType (owner)) { case GNC_OWNER_CUSTOMER: case GNC_OWNER_VENDOR: break; default: PERR("Unsupported Owner type: %d", gncOwnerGetType(owner)); return; } gncJobBeginEdit (job); switch (gncOwnerGetType (&(job->owner))) { case GNC_OWNER_CUSTOMER: gncCustomerRemoveJob (gncOwnerGetCustomer(&job->owner), job); break; case GNC_OWNER_VENDOR: gncVendorRemoveJob (gncOwnerGetVendor(&job->owner), job); break; default: break; } gncOwnerCopy (owner, &(job->owner)); switch (gncOwnerGetType (&(job->owner))) { case GNC_OWNER_CUSTOMER: gncCustomerAddJob (gncOwnerGetCustomer(&job->owner), job); break; case GNC_OWNER_VENDOR: gncVendorAddJob (gncOwnerGetVendor(&job->owner), job); break; default: break; } mark_job (job); gncJobCommitEdit (job); }