mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: wip UI upload attachments
This commit is contained in:
@@ -64,7 +64,7 @@ export default class BaseVendorCredit {
|
||||
autoNextNumber;
|
||||
|
||||
const initialDTO = {
|
||||
...omit(vendorCreditDTO, ['open']),
|
||||
...omit(vendorCreditDTO, ['open', 'attachments']),
|
||||
amount,
|
||||
currencyCode: vendorCurrencyCode,
|
||||
exchangeRate: vendorCreditDTO.exchangeRate || 1,
|
||||
|
||||
@@ -26,7 +26,8 @@ export default class GetVendorCredit {
|
||||
.findById(vendorCreditId)
|
||||
.withGraphFetched('entries.item')
|
||||
.withGraphFetched('vendor')
|
||||
.withGraphFetched('branch');
|
||||
.withGraphFetched('branch')
|
||||
.withGraphFetched('attachments');
|
||||
|
||||
if (!vendorCredit) {
|
||||
throw new ServiceError(ERRORS.VENDOR_CREDIT_NOT_FOUND);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { IVendorCredit } from '@/interfaces';
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { AttachmentTransformer } from '@/services/Attachments/AttachmentTransformer';
|
||||
import { ItemEntryTransformer } from '@/services/Sales/Invoices/ItemEntryTransformer';
|
||||
import { formatNumber } from 'utils';
|
||||
|
||||
@@ -16,6 +17,7 @@ export class VendorCreditTransformer extends Transformer {
|
||||
'formattedCreditsRemaining',
|
||||
'formattedInvoicedAmount',
|
||||
'entries',
|
||||
'attachments',
|
||||
];
|
||||
};
|
||||
|
||||
@@ -80,4 +82,13 @@ export class VendorCreditTransformer extends Transformer {
|
||||
currencyCode: vendorCredit.currencyCode,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the vendor credit attachments.
|
||||
* @param {IVendorCredit} invoice
|
||||
* @returns
|
||||
*/
|
||||
protected attachments = (vendorCredit) => {
|
||||
return this.item(vendorCredit.attachments, new AttachmentTransformer());
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user