mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-23 00:00:31 +00:00
feat: wip UI upload attachments
This commit is contained in:
@@ -2,6 +2,7 @@ import { IBillPayment } from '@/interfaces';
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { formatNumber } from 'utils';
|
||||
import { BillPaymentEntryTransformer } from './BillPaymentEntryTransformer';
|
||||
import { AttachmentTransformer } from '@/services/Attachments/AttachmentTransformer';
|
||||
|
||||
export class BillPaymentTransformer extends Transformer {
|
||||
/**
|
||||
@@ -9,7 +10,12 @@ export class BillPaymentTransformer extends Transformer {
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return ['formattedPaymentDate', 'formattedAmount', 'entries'];
|
||||
return [
|
||||
'formattedPaymentDate',
|
||||
'formattedAmount',
|
||||
'entries',
|
||||
'attachments',
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -38,4 +44,13 @@ export class BillPaymentTransformer extends Transformer {
|
||||
protected entries = (billPayment) => {
|
||||
return this.item(billPayment.entries, new BillPaymentEntryTransformer());
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the bill attachments.
|
||||
* @param {ISaleInvoice} invoice
|
||||
* @returns
|
||||
*/
|
||||
protected attachments = (billPayment) => {
|
||||
return this.item(billPayment.attachments, new AttachmentTransformer());
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user