mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: Link sale invoice to payment receive entries.
This commit is contained in:
@@ -30,6 +30,7 @@ export default class PaymentReceiveEntry extends mixin(TenantModel, [CachableMod
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const PaymentReceive = require('@/models/PaymentReceive');
|
||||
const SaleInvoice = require('@/models/SaleInvoice');
|
||||
|
||||
return {
|
||||
entries: {
|
||||
@@ -40,6 +41,15 @@ export default class PaymentReceiveEntry extends mixin(TenantModel, [CachableMod
|
||||
to: 'payment_receives.id',
|
||||
},
|
||||
},
|
||||
|
||||
invoice: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: this.relationBindKnex(SaleInvoice.default),
|
||||
join: {
|
||||
from: 'payment_receives_entries.invoiceId',
|
||||
to: 'sales_invoices.id',
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user