mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
add server to monorepo.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { formatNumber } from 'utils';
|
||||
|
||||
export class CreditNoteAppliedInvoiceTransformer extends Transformer {
|
||||
/**
|
||||
* Includeded attributes.
|
||||
* @returns {string[]}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return [
|
||||
'formttedAmount',
|
||||
'creditNoteNumber',
|
||||
'creditNoteDate',
|
||||
'invoiceNumber',
|
||||
'invoiceReferenceNo',
|
||||
'formattedCreditNoteDate',
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
* Exclude attributes.
|
||||
* @returns {string[]}
|
||||
*/
|
||||
public excludeAttributes = (): string[] => {
|
||||
return ['saleInvoice', 'creditNote'];
|
||||
};
|
||||
|
||||
formttedAmount = (item) => {
|
||||
return formatNumber(item.amount, {
|
||||
currencyCode: item.creditNote.currencyCode,
|
||||
});
|
||||
};
|
||||
|
||||
creditNoteNumber = (item) => {
|
||||
return item.creditNote.creditNoteNumber;
|
||||
};
|
||||
|
||||
creditNoteDate = (item) => {
|
||||
return item.creditNote.creditNoteDate;
|
||||
};
|
||||
|
||||
invoiceNumber = (item) => {
|
||||
return item.saleInvoice.invoiceNo;
|
||||
};
|
||||
|
||||
invoiceReferenceNo = (item) => {
|
||||
return item.saleInvoice.referenceNo;
|
||||
};
|
||||
|
||||
formattedCreditNoteDate = (item) => {
|
||||
return this.formatDate(item.creditNote.creditNoteDate);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user