Created
October 23, 2019 15:47
-
-
Save mauritslamers/0e09322d05fc122f87695456e7a6f8d5 to your computer and use it in GitHub Desktop.
getter for invoice type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GncInvoiceType | |
gnc_invoice_get_type(InvoiceWindow *iw) | |
{ | |
/* uses the same approach as gnc_invoice_get_title */ | |
switch (gncOwnerGetType(&iw->owner)) | |
{ | |
case GNC_OWNER_CUSTOMER: | |
return iw->is_credit_note ? GNC_INVOICE_CUST_CREDIT_NOTE | |
: GNC_INVOICE_CUST_INVOICE; | |
break; | |
case GNC_OWNER_VENDOR: | |
return iw->is_credit_note ? GNC_INVOICE_VEND_CREDIT_NOTE | |
: GNC_INVOICE_VEND_INVOICE; | |
break; | |
case GNC_OWNER_EMPLOYEE: | |
return iw->is_credit_note ? GNC_INVOICE_EMPL_CREDIT_NOTE | |
: GNC_INVOICE_EMPL_INVOICE; | |
break; | |
default: | |
return GNC_INVOICE_UNDEFINED; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment