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