mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix: manual journal listing api.
This commit is contained in:
@@ -244,7 +244,9 @@ export default class ManualJournalsController extends BaseController {
|
||||
tenantId,
|
||||
manualJournalId
|
||||
);
|
||||
return res.status(200).send({ manualJournal });
|
||||
return res.status(200).send({
|
||||
manual_journal: manualJournal
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ export default class PaymentReceivesController extends BaseController {
|
||||
* @param {Response} res -
|
||||
*/
|
||||
async getPaymentReceive(req: Request, res: Response, next: NextFunction) {
|
||||
const { tenantId } = req;
|
||||
const { tenantId, user } = req;
|
||||
const { id: paymentReceiveId } = req.params;
|
||||
|
||||
try {
|
||||
|
||||
@@ -15,4 +15,22 @@ export default class ManualJournalEntry extends TenantModel {
|
||||
get timestamps() {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship mapping.
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const Account = require('models/Account');
|
||||
|
||||
return {
|
||||
account: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: Account.default,
|
||||
join: {
|
||||
from: 'manual_journals_entries.accountId',
|
||||
to: 'accounts.id',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
IPaymentReceiveEntryDTO,
|
||||
IPaymentReceivesFilter,
|
||||
ISaleInvoice,
|
||||
ISystemService,
|
||||
ISystemUser,
|
||||
} from 'interfaces';
|
||||
import AccountsService from 'services/Accounts/AccountsService';
|
||||
@@ -481,6 +482,7 @@ export default class PaymentReceiveService {
|
||||
public async getPaymentReceive(
|
||||
tenantId: number,
|
||||
paymentReceiveId: number,
|
||||
authorizedUser: ISystemService
|
||||
): Promise<{
|
||||
paymentReceive: IPaymentReceive;
|
||||
receivableInvoices: ISaleInvoice[];
|
||||
|
||||
Reference in New Issue
Block a user