law-common 11.3.23-beta.0 → 11.3.23-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/entities/model/vendor_advance.entity.model.d.ts +1 -0
- package/dist/src/entities/model/vendor_advance.entity.model.js +4 -0
- package/dist/src/entities/model/vendor_invoice_advance.entity.model.d.ts +4 -0
- package/dist/src/entities/model/vendor_invoice_advance.entity.model.js +6 -0
- package/package.json +1 -1
|
@@ -215,6 +215,10 @@ class VendorAdvanceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
215
215
|
getUpdateActionVisibility(currentUser) {
|
|
216
216
|
return {};
|
|
217
217
|
}
|
|
218
|
+
getBalanceAmount() {
|
|
219
|
+
var _a;
|
|
220
|
+
return this.netAmount - ((_a = this.appliedAmount) !== null && _a !== void 0 ? _a : 0);
|
|
221
|
+
}
|
|
218
222
|
}
|
|
219
223
|
exports.VendorAdvanceEntityModel = VendorAdvanceEntityModel;
|
|
220
224
|
// vendorInvoiceAdvances?: VendorInvoiceAdvanceEntityModel[];
|
|
@@ -66,4 +66,8 @@ export declare class VendorInvoiceAdvanceEntityModel extends BaseEntityModel<Ent
|
|
|
66
66
|
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
67
67
|
[key: string]: () => boolean;
|
|
68
68
|
};
|
|
69
|
+
static getMaxAmount({ vendorInvoiceModel, vendorAdvanceModel, }: {
|
|
70
|
+
vendorInvoiceModel: VendorInvoiceEntityModel;
|
|
71
|
+
vendorAdvanceModel: VendorAdvanceEntityModel;
|
|
72
|
+
}): number;
|
|
69
73
|
}
|
|
@@ -204,6 +204,12 @@ class VendorInvoiceAdvanceEntityModel extends base_entity_model_1.BaseEntityMode
|
|
|
204
204
|
getUpdateActionVisibility(currentUser) {
|
|
205
205
|
return {};
|
|
206
206
|
}
|
|
207
|
+
static getMaxAmount({ vendorInvoiceModel, vendorAdvanceModel, }) {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
const vendorInvoiceBalance = (_a = vendorInvoiceModel === null || vendorInvoiceModel === void 0 ? void 0 : vendorInvoiceModel.getBalanceAmount()) !== null && _a !== void 0 ? _a : 0;
|
|
210
|
+
const vendorAdvanceBalance = (_b = vendorAdvanceModel === null || vendorAdvanceModel === void 0 ? void 0 : vendorAdvanceModel.getBalanceAmount()) !== null && _b !== void 0 ? _b : 0;
|
|
211
|
+
return Math.min(vendorInvoiceBalance, vendorAdvanceBalance);
|
|
212
|
+
}
|
|
207
213
|
}
|
|
208
214
|
exports.VendorInvoiceAdvanceEntityModel = VendorInvoiceAdvanceEntityModel;
|
|
209
215
|
VendorInvoiceAdvanceEntityModel.relationConfigs = [
|