mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: make sale invoices resource-able.
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
|||||||
} from 'lib/ViewRolesBuilder';
|
} from 'lib/ViewRolesBuilder';
|
||||||
import { flatToNestedArray } from 'utils';
|
import { flatToNestedArray } from 'utils';
|
||||||
import DependencyGraph from 'lib/DependencyGraph';
|
import DependencyGraph from 'lib/DependencyGraph';
|
||||||
import TenantManagerSubscriber from 'subscribers/tenantManager';
|
|
||||||
|
|
||||||
export default class Account extends TenantModel {
|
export default class Account extends TenantModel {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ export default class PaymentReceive extends TenantModel {
|
|||||||
return ['created_at', 'updated_at'];
|
return ['created_at', 'updated_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get resourceable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relationship mapping.
|
* Relationship mapping.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
return ['created_at', 'updated_at'];
|
return ['created_at', 'updated_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get resourceable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model modifiers.
|
* Model modifiers.
|
||||||
*/
|
*/
|
||||||
@@ -123,4 +127,17 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
.where('id', invoiceId)
|
.where('id', invoiceId)
|
||||||
[changeMethod]('payment_amount', Math.abs(amount));
|
[changeMethod]('payment_amount', Math.abs(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model defined fields.
|
||||||
|
*/
|
||||||
|
static get fields() {
|
||||||
|
return {
|
||||||
|
created_at: {
|
||||||
|
label: 'Created at',
|
||||||
|
column: 'created_at',
|
||||||
|
columnType: 'date',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user