- Prefijo v2: MCH - TRACEABILITY-MASTER.yml creado - Listo para integracion como submodulo Workspace: v2.0.0 | SIMCO: v4.0.0
185 lines
7.9 KiB
JavaScript
185 lines
7.9 KiB
JavaScript
"use strict";
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Invoice = exports.InvoiceStatus = exports.InvoiceType = void 0;
|
|
const typeorm_1 = require("typeorm");
|
|
const invoice_item_entity_1 = require("./invoice-item.entity");
|
|
var InvoiceType;
|
|
(function (InvoiceType) {
|
|
InvoiceType["INGRESO"] = "I";
|
|
InvoiceType["EGRESO"] = "E";
|
|
InvoiceType["TRASLADO"] = "T";
|
|
InvoiceType["PAGO"] = "P";
|
|
InvoiceType["NOMINA"] = "N";
|
|
})(InvoiceType || (exports.InvoiceType = InvoiceType = {}));
|
|
var InvoiceStatus;
|
|
(function (InvoiceStatus) {
|
|
InvoiceStatus["DRAFT"] = "draft";
|
|
InvoiceStatus["PENDING"] = "pending";
|
|
InvoiceStatus["STAMPED"] = "stamped";
|
|
InvoiceStatus["SENT"] = "sent";
|
|
InvoiceStatus["CANCELLED"] = "cancelled";
|
|
})(InvoiceStatus || (exports.InvoiceStatus = InvoiceStatus = {}));
|
|
let Invoice = class Invoice {
|
|
};
|
|
exports.Invoice = Invoice;
|
|
__decorate([
|
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tenant_id' }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "tenantId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'sale_id', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "saleId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tipo_comprobante', length: 1, default: InvoiceType.INGRESO }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "tipoComprobante", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ length: 36, unique: true, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "uuid", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ length: 10, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "serie", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "folio", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'receptor_rfc', length: 13 }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "receptorRfc", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'receptor_nombre', length: 200 }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "receptorNombre", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'receptor_regimen_fiscal', length: 3, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "receptorRegimenFiscal", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'receptor_codigo_postal', length: 5 }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "receptorCodigoPostal", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'receptor_uso_cfdi', length: 4 }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "receptorUsoCfdi", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'receptor_email', length: 200, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "receptorEmail", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2 }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "subtotal", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2, default: 0 }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "descuento", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'total_impuestos_trasladados', type: 'decimal', precision: 12, scale: 2, default: 0 }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "totalImpuestosTrasladados", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'total_impuestos_retenidos', type: 'decimal', precision: 12, scale: 2, default: 0 }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "totalImpuestosRetenidos", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2 }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "total", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'forma_pago', length: 2 }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "formaPago", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'metodo_pago', length: 3 }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "metodoPago", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'condiciones_pago', length: 100, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "condicionesPago", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ length: 3, default: 'MXN' }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "moneda", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tipo_cambio', type: 'decimal', precision: 10, scale: 6, default: 1 }),
|
|
__metadata("design:type", Number)
|
|
], Invoice.prototype, "tipoCambio", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'xml_url', type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "xmlUrl", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'pdf_url', type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "pdfUrl", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'qr_url', type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "qrUrl", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({
|
|
type: 'varchar',
|
|
length: 20,
|
|
default: InvoiceStatus.DRAFT,
|
|
}),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "status", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'cancelled_at', type: 'timestamptz', nullable: true }),
|
|
__metadata("design:type", Date)
|
|
], Invoice.prototype, "cancelledAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'cancel_reason', length: 2, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "cancelReason", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'cancel_uuid_replacement', length: 36, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "cancelUuidReplacement", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'stamped_at', type: 'timestamptz', nullable: true }),
|
|
__metadata("design:type", Date)
|
|
], Invoice.prototype, "stampedAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'pac_response', type: 'jsonb', nullable: true }),
|
|
__metadata("design:type", Object)
|
|
], Invoice.prototype, "pacResponse", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Invoice.prototype, "notes", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
__metadata("design:type", Date)
|
|
], Invoice.prototype, "createdAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
__metadata("design:type", Date)
|
|
], Invoice.prototype, "updatedAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.OneToMany)(() => invoice_item_entity_1.InvoiceItem, (item) => item.invoice),
|
|
__metadata("design:type", Array)
|
|
], Invoice.prototype, "items", void 0);
|
|
exports.Invoice = Invoice = __decorate([
|
|
(0, typeorm_1.Entity)({ schema: 'billing', name: 'invoices' })
|
|
], Invoice);
|
|
//# sourceMappingURL=invoice.entity.js.map
|