proflores-db-model 0.2.52 → 0.2.53
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/entities/ExpenseDetail.d.ts +6 -0
- package/dist/entities/ExpenseDetail.js +19 -1
- package/dist/entities/ExpenseTransaction.d.ts +2 -0
- package/dist/entities/ExpenseTransaction.js +11 -1
- package/dist/entities/Income.d.ts +29 -0
- package/dist/entities/Income.js +121 -0
- package/dist/entities/InventoryMovement.d.ts +2 -0
- package/dist/entities/InventoryMovement.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -1
- package/dist/models/apu/Budget.d.ts +4 -0
- package/dist/models/apu/Budget.js +10 -0
- package/dist/models/production/CropActivity.d.ts +20 -0
- package/dist/models/production/CropActivity.js +85 -0
- package/dist/models/production/CropExpense.d.ts +22 -0
- package/dist/models/production/CropExpense.js +93 -0
- package/dist/models/production/CropLot.d.ts +33 -0
- package/dist/models/production/CropLot.js +132 -0
- package/dist/models/production/CropStage.d.ts +13 -0
- package/dist/models/production/CropStage.js +58 -0
- package/dist/models/production/CropStageImage.d.ts +9 -0
- package/dist/models/production/CropStageImage.js +44 -0
- package/dist/models/production/GrowthArea.d.ts +13 -0
- package/dist/models/production/GrowthArea.js +55 -0
- package/dist/models/production/Harvest.d.ts +16 -0
- package/dist/models/production/Harvest.js +70 -0
- package/dist/models/production/ProductionSeason.d.ts +11 -0
- package/dist/models/production/ProductionSeason.js +49 -0
- package/dist/models/production/index.d.ts +8 -0
- package/dist/models/production/index.js +20 -0
- package/dist/types/CropActivityType.d.ts +12 -0
- package/dist/types/CropActivityType.js +16 -0
- package/dist/types/CropLotStatus.d.ts +10 -0
- package/dist/types/CropLotStatus.js +14 -0
- package/dist/types/GrowthStage.d.ts +10 -0
- package/dist/types/GrowthStage.js +14 -0
- package/dist/types/IncomeStatus.d.ts +5 -0
- package/dist/types/IncomeStatus.js +9 -0
- package/dist/types/IncomeType.d.ts +6 -0
- package/dist/types/IncomeType.js +10 -0
- package/dist/types/MovementType.d.ts +2 -1
- package/dist/types/MovementType.js +1 -0
- package/dist/types/QualityGrade.d.ts +6 -0
- package/dist/types/QualityGrade.js +10 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +15 -1
- package/package.json +1 -1
- package/src/entities/ExpenseDetail.ts +16 -1
- package/src/entities/ExpenseTransaction.ts +12 -2
- package/src/entities/Income.ts +99 -0
- package/src/entities/InventoryMovement.ts +7 -1
- package/src/index.ts +2 -0
- package/src/models/apu/Budget.ts +8 -0
- package/src/models/production/CropActivity.ts +68 -0
- package/src/models/production/CropExpense.ts +74 -0
- package/src/models/production/CropLot.ts +106 -0
- package/src/models/production/CropStage.ts +45 -0
- package/src/models/production/CropStageImage.ts +32 -0
- package/src/models/production/GrowthArea.ts +41 -0
- package/src/models/production/Harvest.ts +56 -0
- package/src/models/production/ProductionSeason.ts +34 -0
- package/src/models/production/index.ts +9 -0
- package/src/types/CropActivityType.ts +12 -0
- package/src/types/CropLotStatus.ts +10 -0
- package/src/types/GrowthStage.ts +10 -0
- package/src/types/IncomeStatus.ts +5 -0
- package/src/types/IncomeType.ts +6 -0
- package/src/types/MovementType.ts +5 -4
- package/src/types/QualityGrade.ts +6 -0
- package/src/types/index.ts +11 -1
|
@@ -2,6 +2,9 @@ import { ObjectLiteral } from "typeorm";
|
|
|
2
2
|
import { ExpenseTransaction } from "./ExpenseTransaction";
|
|
3
3
|
import { Inventory } from "./Inventory";
|
|
4
4
|
import { ProjectOrder } from "./ProjectOrder";
|
|
5
|
+
import { Budget } from "../models/apu/Budget";
|
|
6
|
+
import { CropLot } from "../models/production/CropLot";
|
|
7
|
+
import { CropActivity } from "../models/production/CropActivity";
|
|
5
8
|
export declare class ExpenseDetail implements ObjectLiteral {
|
|
6
9
|
expenseDetailId: number;
|
|
7
10
|
expenseTransaction: ExpenseTransaction;
|
|
@@ -12,4 +15,7 @@ export declare class ExpenseDetail implements ObjectLiteral {
|
|
|
12
15
|
purchaseDate: Date;
|
|
13
16
|
isActive: boolean;
|
|
14
17
|
projectOrder?: ProjectOrder;
|
|
18
|
+
budget?: Budget | null;
|
|
19
|
+
cropLot?: CropLot | null;
|
|
20
|
+
cropActivity?: CropActivity | null;
|
|
15
21
|
}
|
|
@@ -14,6 +14,9 @@ const typeorm_1 = require("typeorm");
|
|
|
14
14
|
const ExpenseTransaction_1 = require("./ExpenseTransaction");
|
|
15
15
|
const Inventory_1 = require("./Inventory");
|
|
16
16
|
const ProjectOrder_1 = require("./ProjectOrder");
|
|
17
|
+
const Budget_1 = require("../models/apu/Budget");
|
|
18
|
+
const CropLot_1 = require("../models/production/CropLot");
|
|
19
|
+
const CropActivity_1 = require("../models/production/CropActivity");
|
|
17
20
|
let ExpenseDetail = class ExpenseDetail {
|
|
18
21
|
};
|
|
19
22
|
exports.ExpenseDetail = ExpenseDetail;
|
|
@@ -55,10 +58,25 @@ __decorate([
|
|
|
55
58
|
__metadata("design:type", Boolean)
|
|
56
59
|
], ExpenseDetail.prototype, "isActive", void 0);
|
|
57
60
|
__decorate([
|
|
58
|
-
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable:
|
|
61
|
+
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable: true }),
|
|
59
62
|
(0, typeorm_1.JoinColumn)({ name: "projectId" }),
|
|
60
63
|
__metadata("design:type", ProjectOrder_1.ProjectOrder)
|
|
61
64
|
], ExpenseDetail.prototype, "projectOrder", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.ManyToOne)(() => Budget_1.Budget, { nullable: true, onDelete: "SET NULL" }),
|
|
67
|
+
(0, typeorm_1.JoinColumn)({ name: "idBudget" }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], ExpenseDetail.prototype, "budget", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToOne)(() => CropLot_1.CropLot, { nullable: true, onDelete: "SET NULL" }),
|
|
72
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropLot" }),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], ExpenseDetail.prototype, "cropLot", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.ManyToOne)(() => CropActivity_1.CropActivity, { nullable: true, onDelete: "SET NULL" }),
|
|
77
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropActivity" }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], ExpenseDetail.prototype, "cropActivity", void 0);
|
|
62
80
|
exports.ExpenseDetail = ExpenseDetail = __decorate([
|
|
63
81
|
(0, typeorm_1.Entity)()
|
|
64
82
|
], ExpenseDetail);
|
|
@@ -2,6 +2,7 @@ import { ObjectLiteral } from "typeorm";
|
|
|
2
2
|
import { ExpenseType } from "./ExpenseType";
|
|
3
3
|
import { ExpenseDetail } from "./ExpenseDetail";
|
|
4
4
|
import { TransactionBank } from "./Bank/TransactionBank";
|
|
5
|
+
import { Budget } from "../models/apu/Budget";
|
|
5
6
|
export declare class ExpenseTransaction implements ObjectLiteral {
|
|
6
7
|
expenseTransactionId: number;
|
|
7
8
|
bankId: string;
|
|
@@ -13,4 +14,5 @@ export declare class ExpenseTransaction implements ObjectLiteral {
|
|
|
13
14
|
expenseType: ExpenseType;
|
|
14
15
|
expenseDetails?: ExpenseDetail[];
|
|
15
16
|
transactionBank?: TransactionBank;
|
|
17
|
+
budget?: Budget | null;
|
|
16
18
|
}
|
|
@@ -15,6 +15,7 @@ const typeorm_1 = require("typeorm");
|
|
|
15
15
|
const ExpenseType_1 = require("./ExpenseType");
|
|
16
16
|
const ExpenseDetail_1 = require("./ExpenseDetail");
|
|
17
17
|
const TransactionBank_1 = require("./Bank/TransactionBank");
|
|
18
|
+
const Budget_1 = require("../models/apu/Budget");
|
|
18
19
|
let ExpenseTransaction = class ExpenseTransaction {
|
|
19
20
|
};
|
|
20
21
|
exports.ExpenseTransaction = ExpenseTransaction;
|
|
@@ -63,6 +64,15 @@ __decorate([
|
|
|
63
64
|
}),
|
|
64
65
|
__metadata("design:type", TransactionBank_1.TransactionBank)
|
|
65
66
|
], ExpenseTransaction.prototype, "transactionBank", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.ManyToOne)(() => Budget_1.Budget, (budget) => budget.expenses, {
|
|
69
|
+
nullable: true,
|
|
70
|
+
onDelete: "SET NULL",
|
|
71
|
+
}),
|
|
72
|
+
(0, typeorm_1.JoinColumn)({ name: "idBudget" }),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], ExpenseTransaction.prototype, "budget", void 0);
|
|
66
75
|
exports.ExpenseTransaction = ExpenseTransaction = __decorate([
|
|
67
|
-
(0, typeorm_1.Entity)()
|
|
76
|
+
(0, typeorm_1.Entity)(),
|
|
77
|
+
(0, typeorm_1.Index)(["budget"])
|
|
68
78
|
], ExpenseTransaction);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Budget } from "../models/apu/Budget";
|
|
3
|
+
import { Payment } from "./Payment";
|
|
4
|
+
import { CropLot } from "../models/production/CropLot";
|
|
5
|
+
import { Client } from "../models/apu/Client";
|
|
6
|
+
import { Inventory } from "./Inventory";
|
|
7
|
+
import { TransactionBank } from "./Bank/TransactionBank";
|
|
8
|
+
import { IncomeType } from "../types/IncomeType";
|
|
9
|
+
import { IncomeStatus } from "../types/IncomeStatus";
|
|
10
|
+
export declare class Income implements ObjectLiteral {
|
|
11
|
+
idIncome: number;
|
|
12
|
+
incomeType: IncomeType;
|
|
13
|
+
amount: number;
|
|
14
|
+
incomeDate: Date;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
status: IncomeStatus;
|
|
17
|
+
budget?: Budget | null;
|
|
18
|
+
payment?: Payment | null;
|
|
19
|
+
cropLot?: CropLot | null;
|
|
20
|
+
client?: Client | null;
|
|
21
|
+
inventory?: Inventory | null;
|
|
22
|
+
quantity?: number | null;
|
|
23
|
+
unitPrice?: number | null;
|
|
24
|
+
invoiceUuid?: string | null;
|
|
25
|
+
transactionBank?: TransactionBank | null;
|
|
26
|
+
notes?: string | null;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Income = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Budget_1 = require("../models/apu/Budget");
|
|
15
|
+
const Payment_1 = require("./Payment");
|
|
16
|
+
const CropLot_1 = require("../models/production/CropLot");
|
|
17
|
+
const Client_1 = require("../models/apu/Client");
|
|
18
|
+
const Inventory_1 = require("./Inventory");
|
|
19
|
+
const TransactionBank_1 = require("./Bank/TransactionBank");
|
|
20
|
+
const IncomeType_1 = require("../types/IncomeType");
|
|
21
|
+
const IncomeStatus_1 = require("../types/IncomeStatus");
|
|
22
|
+
let Income = class Income {
|
|
23
|
+
};
|
|
24
|
+
exports.Income = Income;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], Income.prototype, "idIncome", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({
|
|
31
|
+
type: "enum",
|
|
32
|
+
enum: IncomeType_1.IncomeType,
|
|
33
|
+
default: IncomeType_1.IncomeType.OTHER,
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], Income.prototype, "incomeType", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 2, nullable: false }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], Income.prototype, "amount", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
43
|
+
__metadata("design:type", Date)
|
|
44
|
+
], Income.prototype, "incomeDate", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], Income.prototype, "description", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({
|
|
51
|
+
type: "enum",
|
|
52
|
+
enum: IncomeStatus_1.IncomeStatus,
|
|
53
|
+
default: IncomeStatus_1.IncomeStatus.PENDING,
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], Income.prototype, "status", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.ManyToOne)(() => Budget_1.Budget, (budget) => budget.incomes, {
|
|
59
|
+
nullable: true,
|
|
60
|
+
onDelete: "SET NULL",
|
|
61
|
+
}),
|
|
62
|
+
(0, typeorm_1.JoinColumn)({ name: "idBudget" }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], Income.prototype, "budget", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.ManyToOne)(() => Payment_1.Payment, { nullable: true, onDelete: "SET NULL" }),
|
|
67
|
+
(0, typeorm_1.JoinColumn)({ name: "idPayment" }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], Income.prototype, "payment", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToOne)(() => CropLot_1.CropLot, { nullable: true, onDelete: "SET NULL" }),
|
|
72
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropLot" }),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], Income.prototype, "cropLot", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.ManyToOne)(() => Client_1.Client, { nullable: true, onDelete: "SET NULL" }),
|
|
77
|
+
(0, typeorm_1.JoinColumn)({ name: "idClient" }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], Income.prototype, "client", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.ManyToOne)(() => Inventory_1.Inventory, { nullable: true, onDelete: "SET NULL" }),
|
|
82
|
+
(0, typeorm_1.JoinColumn)({ name: "idInventory" }),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], Income.prototype, "inventory", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 4, nullable: true }),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], Income.prototype, "quantity", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 4, nullable: true }),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], Income.prototype, "unitPrice", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], Income.prototype, "invoiceUuid", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.OneToOne)(() => TransactionBank_1.TransactionBank, { nullable: true, cascade: true }),
|
|
99
|
+
(0, typeorm_1.JoinColumn)({ name: "idTransactionBank" }),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], Income.prototype, "transactionBank", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
104
|
+
__metadata("design:type", Object)
|
|
105
|
+
], Income.prototype, "notes", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
108
|
+
__metadata("design:type", Date)
|
|
109
|
+
], Income.prototype, "createdAt", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.UpdateDateColumn)({ type: "timestamp" }),
|
|
112
|
+
__metadata("design:type", Date)
|
|
113
|
+
], Income.prototype, "updatedAt", void 0);
|
|
114
|
+
exports.Income = Income = __decorate([
|
|
115
|
+
(0, typeorm_1.Entity)("incomes"),
|
|
116
|
+
(0, typeorm_1.Index)(["incomeDate"]),
|
|
117
|
+
(0, typeorm_1.Index)(["incomeType"]),
|
|
118
|
+
(0, typeorm_1.Index)(["status"]),
|
|
119
|
+
(0, typeorm_1.Index)(["budget"]),
|
|
120
|
+
(0, typeorm_1.Index)(["cropLot"])
|
|
121
|
+
], Income);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ObjectLiteral } from "typeorm";
|
|
2
2
|
import { Inventory } from "./Inventory";
|
|
3
3
|
import { MovementType } from "../types/MovementType";
|
|
4
|
+
import { Harvest } from "../models/production/Harvest";
|
|
4
5
|
export declare class InventoryMovement implements ObjectLiteral {
|
|
5
6
|
idMovement: number;
|
|
6
7
|
inventory: Inventory;
|
|
@@ -12,4 +13,5 @@ export declare class InventoryMovement implements ObjectLiteral {
|
|
|
12
13
|
description?: string;
|
|
13
14
|
referenceId?: number;
|
|
14
15
|
referenceModule?: string;
|
|
16
|
+
harvest?: Harvest | null;
|
|
15
17
|
}
|
|
@@ -13,6 +13,7 @@ exports.InventoryMovement = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const Inventory_1 = require("./Inventory");
|
|
15
15
|
const MovementType_1 = require("../types/MovementType");
|
|
16
|
+
const Harvest_1 = require("../models/production/Harvest");
|
|
16
17
|
let InventoryMovement = class InventoryMovement {
|
|
17
18
|
};
|
|
18
19
|
exports.InventoryMovement = InventoryMovement;
|
|
@@ -62,6 +63,12 @@ __decorate([
|
|
|
62
63
|
(0, typeorm_1.Column)("varchar", { length: 50, nullable: true }),
|
|
63
64
|
__metadata("design:type", String)
|
|
64
65
|
], InventoryMovement.prototype, "referenceModule", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.OneToOne)(() => Harvest_1.Harvest, (harvest) => harvest.inventoryMovement, {
|
|
68
|
+
nullable: true,
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], InventoryMovement.prototype, "harvest", void 0);
|
|
65
72
|
exports.InventoryMovement = InventoryMovement = __decorate([
|
|
66
73
|
(0, typeorm_1.Entity)("inventory_movement")
|
|
67
74
|
], InventoryMovement);
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export { SupplierImage } from "./entities/SupplierImage";
|
|
|
21
21
|
export { InventoryImage } from "./entities/InventoryImage";
|
|
22
22
|
export { Payment } from "./entities/Payment";
|
|
23
23
|
export { PaymentCfdi } from "./entities/PaymentCfdi";
|
|
24
|
+
export { Income } from "./entities/Income";
|
|
24
25
|
export * from "./types";
|
|
25
26
|
export * from "./models/technical-sheet";
|
|
26
27
|
export * from "./models/apu";
|
|
28
|
+
export * from "./models/production";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PaymentCfdi = exports.Payment = exports.InventoryImage = exports.SupplierImage = exports.BranchImage = exports.Branch = exports.InventoryMovement = exports.Inventory = exports.Product = exports.ProductImage = exports.TransactionBank = exports.BankAccount = exports.UnitOfMeasure = exports.CategoryForPlantType = exports.CategoryForCosting = exports.Supplier = exports.ContainerType = exports.InventoryItem = exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
17
|
+
exports.Income = exports.PaymentCfdi = exports.Payment = exports.InventoryImage = exports.SupplierImage = exports.BranchImage = exports.Branch = exports.InventoryMovement = exports.Inventory = exports.Product = exports.ProductImage = exports.TransactionBank = exports.BankAccount = exports.UnitOfMeasure = exports.CategoryForPlantType = exports.CategoryForCosting = exports.Supplier = exports.ContainerType = exports.InventoryItem = exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
18
18
|
var ExpenseDetail_1 = require("./entities/ExpenseDetail");
|
|
19
19
|
Object.defineProperty(exports, "ExpenseDetail", { enumerable: true, get: function () { return ExpenseDetail_1.ExpenseDetail; } });
|
|
20
20
|
var ExpenseType_1 = require("./entities/ExpenseType");
|
|
@@ -61,6 +61,9 @@ var Payment_1 = require("./entities/Payment");
|
|
|
61
61
|
Object.defineProperty(exports, "Payment", { enumerable: true, get: function () { return Payment_1.Payment; } });
|
|
62
62
|
var PaymentCfdi_1 = require("./entities/PaymentCfdi");
|
|
63
63
|
Object.defineProperty(exports, "PaymentCfdi", { enumerable: true, get: function () { return PaymentCfdi_1.PaymentCfdi; } });
|
|
64
|
+
var Income_1 = require("./entities/Income");
|
|
65
|
+
Object.defineProperty(exports, "Income", { enumerable: true, get: function () { return Income_1.Income; } });
|
|
64
66
|
__exportStar(require("./types"), exports);
|
|
65
67
|
__exportStar(require("./models/technical-sheet"), exports);
|
|
66
68
|
__exportStar(require("./models/apu"), exports);
|
|
69
|
+
__exportStar(require("./models/production"), exports);
|
|
@@ -3,6 +3,8 @@ import { Project } from "./Project";
|
|
|
3
3
|
import { BudgetItem } from "./BudgetItem";
|
|
4
4
|
import { BudgetCancellationFolio } from "./BudgetCancellationFolio";
|
|
5
5
|
import { Payment } from "../../entities/Payment";
|
|
6
|
+
import { ExpenseTransaction } from "../../entities/ExpenseTransaction";
|
|
7
|
+
import { Income } from "../../entities/Income";
|
|
6
8
|
export declare class Budget implements ObjectLiteral {
|
|
7
9
|
idBudget: number;
|
|
8
10
|
project: Project;
|
|
@@ -19,4 +21,6 @@ export declare class Budget implements ObjectLiteral {
|
|
|
19
21
|
items?: BudgetItem[];
|
|
20
22
|
cancellationFolios?: BudgetCancellationFolio[];
|
|
21
23
|
payments?: Payment[];
|
|
24
|
+
expenses?: ExpenseTransaction[];
|
|
25
|
+
incomes?: Income[];
|
|
22
26
|
}
|
|
@@ -16,6 +16,8 @@ const Project_1 = require("./Project");
|
|
|
16
16
|
const BudgetItem_1 = require("./BudgetItem");
|
|
17
17
|
const BudgetCancellationFolio_1 = require("./BudgetCancellationFolio");
|
|
18
18
|
const Payment_1 = require("../../entities/Payment");
|
|
19
|
+
const ExpenseTransaction_1 = require("../../entities/ExpenseTransaction");
|
|
20
|
+
const Income_1 = require("../../entities/Income");
|
|
19
21
|
let Budget = class Budget {
|
|
20
22
|
};
|
|
21
23
|
exports.Budget = Budget;
|
|
@@ -80,6 +82,14 @@ __decorate([
|
|
|
80
82
|
(0, typeorm_1.OneToMany)(() => Payment_1.Payment, (payment) => payment.budget),
|
|
81
83
|
__metadata("design:type", Array)
|
|
82
84
|
], Budget.prototype, "payments", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.OneToMany)(() => ExpenseTransaction_1.ExpenseTransaction, (expense) => expense.budget),
|
|
87
|
+
__metadata("design:type", Array)
|
|
88
|
+
], Budget.prototype, "expenses", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.OneToMany)(() => Income_1.Income, (income) => income.budget),
|
|
91
|
+
__metadata("design:type", Array)
|
|
92
|
+
], Budget.prototype, "incomes", void 0);
|
|
83
93
|
exports.Budget = Budget = __decorate([
|
|
84
94
|
(0, typeorm_1.Entity)("budgets"),
|
|
85
95
|
(0, typeorm_1.Index)(["project"])
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { CropLot } from "./CropLot";
|
|
3
|
+
import { CropActivityType } from "../../types/CropActivityType";
|
|
4
|
+
import { UnitOfMeasure } from "../../entities/UnitOfMesure";
|
|
5
|
+
import { CropExpense } from "./CropExpense";
|
|
6
|
+
export declare class CropActivity implements ObjectLiteral {
|
|
7
|
+
idCropActivity: number;
|
|
8
|
+
cropLot: CropLot;
|
|
9
|
+
activityType: CropActivityType;
|
|
10
|
+
description: string;
|
|
11
|
+
activityDate: Date;
|
|
12
|
+
quantity?: number | null;
|
|
13
|
+
unitOfMeasure?: UnitOfMeasure | null;
|
|
14
|
+
laborHours?: number | null;
|
|
15
|
+
notes?: string | null;
|
|
16
|
+
performedBy?: string | null;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
expenses?: CropExpense[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CropActivity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CropLot_1 = require("./CropLot");
|
|
15
|
+
const CropActivityType_1 = require("../../types/CropActivityType");
|
|
16
|
+
const UnitOfMesure_1 = require("../../entities/UnitOfMesure");
|
|
17
|
+
const CropExpense_1 = require("./CropExpense");
|
|
18
|
+
let CropActivity = class CropActivity {
|
|
19
|
+
};
|
|
20
|
+
exports.CropActivity = CropActivity;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], CropActivity.prototype, "idCropActivity", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => CropLot_1.CropLot, (cropLot) => cropLot.activities, {
|
|
27
|
+
nullable: false,
|
|
28
|
+
onDelete: "CASCADE",
|
|
29
|
+
}),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropLot" }),
|
|
31
|
+
__metadata("design:type", CropLot_1.CropLot)
|
|
32
|
+
], CropActivity.prototype, "cropLot", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({
|
|
35
|
+
type: "enum",
|
|
36
|
+
enum: CropActivityType_1.CropActivityType,
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CropActivity.prototype, "activityType", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)("text", { nullable: false }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], CropActivity.prototype, "description", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], CropActivity.prototype, "activityDate", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 4, nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], CropActivity.prototype, "quantity", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.ManyToOne)(() => UnitOfMesure_1.UnitOfMeasure, { nullable: true, onDelete: "SET NULL" }),
|
|
54
|
+
(0, typeorm_1.JoinColumn)({ name: "idUnitOfMeasure" }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], CropActivity.prototype, "unitOfMeasure", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)("decimal", { precision: 8, scale: 2, nullable: true }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], CropActivity.prototype, "laborHours", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], CropActivity.prototype, "notes", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], CropActivity.prototype, "performedBy", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], CropActivity.prototype, "createdAt", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.UpdateDateColumn)({ type: "timestamp" }),
|
|
75
|
+
__metadata("design:type", Date)
|
|
76
|
+
], CropActivity.prototype, "updatedAt", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.OneToMany)(() => CropExpense_1.CropExpense, (expense) => expense.cropActivity, { cascade: true }),
|
|
79
|
+
__metadata("design:type", Array)
|
|
80
|
+
], CropActivity.prototype, "expenses", void 0);
|
|
81
|
+
exports.CropActivity = CropActivity = __decorate([
|
|
82
|
+
(0, typeorm_1.Entity)("crop_activities"),
|
|
83
|
+
(0, typeorm_1.Index)(["cropLot", "activityDate"]),
|
|
84
|
+
(0, typeorm_1.Index)(["activityType"])
|
|
85
|
+
], CropActivity);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { CropLot } from "./CropLot";
|
|
3
|
+
import { CropActivity } from "./CropActivity";
|
|
4
|
+
import { ExpenseType } from "../../entities/ExpenseType";
|
|
5
|
+
import { Resource } from "../apu/Resource";
|
|
6
|
+
import { Inventory } from "../../entities/Inventory";
|
|
7
|
+
export declare class CropExpense implements ObjectLiteral {
|
|
8
|
+
idCropExpense: number;
|
|
9
|
+
cropLot: CropLot;
|
|
10
|
+
cropActivity?: CropActivity | null;
|
|
11
|
+
expenseType?: ExpenseType | null;
|
|
12
|
+
concept: string;
|
|
13
|
+
amount: number;
|
|
14
|
+
quantity: number;
|
|
15
|
+
unitPrice: number;
|
|
16
|
+
expenseDate: Date;
|
|
17
|
+
resource?: Resource | null;
|
|
18
|
+
inventory?: Inventory | null;
|
|
19
|
+
notes?: string | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CropExpense = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CropLot_1 = require("./CropLot");
|
|
15
|
+
const CropActivity_1 = require("./CropActivity");
|
|
16
|
+
const ExpenseType_1 = require("../../entities/ExpenseType");
|
|
17
|
+
const Resource_1 = require("../apu/Resource");
|
|
18
|
+
const Inventory_1 = require("../../entities/Inventory");
|
|
19
|
+
let CropExpense = class CropExpense {
|
|
20
|
+
};
|
|
21
|
+
exports.CropExpense = CropExpense;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], CropExpense.prototype, "idCropExpense", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => CropLot_1.CropLot, (cropLot) => cropLot.expenses, {
|
|
28
|
+
nullable: false,
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
}),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropLot" }),
|
|
32
|
+
__metadata("design:type", CropLot_1.CropLot)
|
|
33
|
+
], CropExpense.prototype, "cropLot", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(() => CropActivity_1.CropActivity, (activity) => activity.expenses, {
|
|
36
|
+
nullable: true,
|
|
37
|
+
onDelete: "SET NULL",
|
|
38
|
+
}),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: "idCropActivity" }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], CropExpense.prototype, "cropActivity", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.ManyToOne)(() => ExpenseType_1.ExpenseType, { nullable: true, onDelete: "SET NULL" }),
|
|
44
|
+
(0, typeorm_1.JoinColumn)({ name: "idExpenseType" }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], CropExpense.prototype, "expenseType", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: false }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], CropExpense.prototype, "concept", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 2, nullable: false }),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], CropExpense.prototype, "amount", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)("decimal", { precision: 12, scale: 4, nullable: false, default: 1 }),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], CropExpense.prototype, "quantity", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 4, nullable: false }),
|
|
61
|
+
__metadata("design:type", Number)
|
|
62
|
+
], CropExpense.prototype, "unitPrice", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
65
|
+
__metadata("design:type", Date)
|
|
66
|
+
], CropExpense.prototype, "expenseDate", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.ManyToOne)(() => Resource_1.Resource, { nullable: true, onDelete: "SET NULL" }),
|
|
69
|
+
(0, typeorm_1.JoinColumn)({ name: "idResource" }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], CropExpense.prototype, "resource", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.ManyToOne)(() => Inventory_1.Inventory, { nullable: true, onDelete: "SET NULL" }),
|
|
74
|
+
(0, typeorm_1.JoinColumn)({ name: "idInventory" }),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], CropExpense.prototype, "inventory", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], CropExpense.prototype, "notes", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
83
|
+
__metadata("design:type", Date)
|
|
84
|
+
], CropExpense.prototype, "createdAt", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.UpdateDateColumn)({ type: "timestamp" }),
|
|
87
|
+
__metadata("design:type", Date)
|
|
88
|
+
], CropExpense.prototype, "updatedAt", void 0);
|
|
89
|
+
exports.CropExpense = CropExpense = __decorate([
|
|
90
|
+
(0, typeorm_1.Entity)("crop_expenses"),
|
|
91
|
+
(0, typeorm_1.Index)(["cropLot", "expenseDate"]),
|
|
92
|
+
(0, typeorm_1.Index)(["cropActivity"])
|
|
93
|
+
], CropExpense);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { GrowthArea } from "./GrowthArea";
|
|
3
|
+
import { ProductionSeason } from "./ProductionSeason";
|
|
4
|
+
import { PlantTechnicalSheet } from "../technical-sheet/PlantTechnicalSheet";
|
|
5
|
+
import { CropLotStatus } from "../../types/CropLotStatus";
|
|
6
|
+
import { CropStage } from "./CropStage";
|
|
7
|
+
import { CropActivity } from "./CropActivity";
|
|
8
|
+
import { CropExpense } from "./CropExpense";
|
|
9
|
+
import { Harvest } from "./Harvest";
|
|
10
|
+
export declare class CropLot implements ObjectLiteral {
|
|
11
|
+
idCropLot: number;
|
|
12
|
+
code: string;
|
|
13
|
+
name: string;
|
|
14
|
+
growthArea: GrowthArea;
|
|
15
|
+
season: ProductionSeason;
|
|
16
|
+
plantTechnicalSheet?: PlantTechnicalSheet | null;
|
|
17
|
+
quantity: number;
|
|
18
|
+
expectedYield?: number | null;
|
|
19
|
+
actualYield?: number | null;
|
|
20
|
+
unitCost?: number | null;
|
|
21
|
+
totalCost?: number | null;
|
|
22
|
+
status: CropLotStatus;
|
|
23
|
+
sowingDate: Date;
|
|
24
|
+
expectedHarvestDate?: Date | null;
|
|
25
|
+
actualHarvestDate?: Date | null;
|
|
26
|
+
notes?: string | null;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
stages?: CropStage[];
|
|
30
|
+
activities?: CropActivity[];
|
|
31
|
+
expenses?: CropExpense[];
|
|
32
|
+
harvests?: Harvest[];
|
|
33
|
+
}
|