Replace gncInvoiceDateExists to gncInvoiceIsPosted

This commit partially reverts commit 862956a760 which exported
gncInvoiceDateExists. Remove this API and use gncInvoiceIsPosted
instead.
This commit is contained in:
Christopher Lam 2018-03-31 05:26:36 +08:00
parent 4601cfcbc3
commit b99dee1736
5 changed files with 12 additions and 12 deletions

View File

@ -191,10 +191,9 @@
(addto! row-contents (qof-print-date date)))
(if (date-due-col column-vector)
(addto! row-contents
(if (and due-date
(gncInvoiceDateExists due-date))
(qof-print-date due-date)
"")))
(if due-date
(qof-print-date due-date)
"")))
(if (num-col column-vector)
(addto! row-contents num))
(if (type-col column-vector)
@ -264,8 +263,9 @@
(set! printed? (add-balance-row table column-vector txn odd-row? printed? start-date total))
; Now print out the invoice row
(if (not (null? invoice))
(set! due-date (gncInvoiceGetDateDue invoice)))
(if (and (not (null? invoice))
(gncInvoiceIsPosted invoice))
(set! due-date (gncInvoiceGetDateDue invoice)))
(let ((row (make-row column-vector date due-date (gnc-get-num-action txn split)
type-str (xaccSplitGetMemo split)

View File

@ -290,8 +290,7 @@
(addto! row-contents (qof-print-date date)))
(if (date-due-col column-vector)
(addto! row-contents
(if (and due-date
(gncInvoiceDateExists due-date))
(if due-date
(qof-print-date due-date)
"")))
(if (num-col column-vector)
@ -382,7 +381,8 @@
; Now print out the invoice row
(if (not (null? invoice))
(begin
(set! due-date (gncInvoiceGetDateDue invoice))
(set! due-date (and (gncInvoiceIsPosted invoice)
(gncInvoiceGetDateDue invoice)))
(set! sale (gncInvoiceGetTotalSubtotal invoice))
(set! tax (gncInvoiceGetTotalTax invoice))))

View File

@ -36,6 +36,7 @@
(invoiceid (gncInvoiceGetID opt-invoice))
(credit-note? (gncInvoiceGetIsCreditNote opt-invoice))
(book (gncInvoiceGetBook opt-invoice))
(isposted (gncInvoiceIsPosted opt-invoice))
(postdate (gncInvoiceGetDatePosted opt-invoice))
(duedate (gncInvoiceGetDateDue opt-invoice))
(billingid (gncInvoiceGetBillingID opt-invoice))
@ -246,7 +247,7 @@
<td align="right" class="invnum"><big><strong><?scm:d invoiceid ?></strong></big></td>
</tr>
<?scm )) ?>
<?scm (if (not (gncInvoiceDateExists postdate)) (begin ?>
<?scm (if (not isposted) (begin ?>
<tr>
<td colspan="2" align="right"><?scm:d (_ "Invoice in progress...") ?></td>
</tr>

View File

@ -1856,7 +1856,7 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn,
gncOwnerAutoApplyPaymentsWithLots (owner, selected_lots);
}
gboolean gncInvoiceDateExists (time64 date)
static gboolean gncInvoiceDateExists (time64 date)
{
/* Going forward we want to use INT64_MAX to indicate "no date", but for
* backward compatibility we need to treat 0 as no date as well.

View File

@ -275,7 +275,6 @@ static inline GncInvoice * gncInvoiceLookup (const QofBook *book, const GncGUID
void gncInvoiceBeginEdit (GncInvoice *invoice);
void gncInvoiceCommitEdit (GncInvoice *invoice);
int gncInvoiceCompare (const GncInvoice *a, const GncInvoice *b);
gboolean gncInvoiceDateExists (time64 date);
gboolean gncInvoiceIsPosted (const GncInvoice *invoice);
gboolean gncInvoiceIsPaid (const GncInvoice *invoice);