update asset
This commit is contained in:
57
src/entity/asset_inventory_depreciation_logs.ts
Normal file
57
src/entity/asset_inventory_depreciation_logs.ts
Normal file
@ -0,0 +1,57 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { AssetInventory } from "./asset_inventories";
|
||||
|
||||
@Entity("asset_inventory_depreciation_logs")
|
||||
export class AssetInventoryDepreciationLog {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => AssetInventory, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
inventory: AssetInventory;
|
||||
|
||||
@Column({ type: "float8" })
|
||||
purchase_value: number;
|
||||
|
||||
@Column({ type: "int2" })
|
||||
month: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
period: Date;
|
||||
|
||||
@Column({ type: "float8" })
|
||||
percent: number;
|
||||
|
||||
@Column({ type: "float8" })
|
||||
initial_value: number;
|
||||
|
||||
@Column({ type: "float8" })
|
||||
depreciation_value: number;
|
||||
|
||||
@Column({ type: "float8" })
|
||||
loss_value: number;
|
||||
|
||||
@Column({ type: "float8" })
|
||||
current_value: number;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,109 +1,39 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, JoinTable, ManyToOne, DeleteDateColumn } from "typeorm";
|
||||
import { AssetSupplier } from "./asset_supplier";
|
||||
import { AssetInventoryCondition } from "../types/asset"
|
||||
import { AssetPurchaseGoodsReceipt } from "./asset_purchase_goods_receipt";
|
||||
import { AssetPurchase } from "./asset_purchase";
|
||||
import { AssetRequestOrder } from "./asset_request_order";
|
||||
import { AssetGood } from "./asset_good";
|
||||
import { Branch } from "./branchs";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { AssetInventory } from "./asset_inventories";
|
||||
|
||||
@Entity("asset_inventories")
|
||||
export class AssetInventory {
|
||||
@Entity("asset_inventory_depreciations")
|
||||
export class AssetInventoryDepreciation {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
code: string;
|
||||
|
||||
@ManyToOne(() => AssetPurchaseGoodsReceipt, { onDelete: 'RESTRICT' })
|
||||
@ManyToOne(() => AssetInventory, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
purchase_goods_receipt: AssetPurchaseGoodsReceipt;
|
||||
inventory: AssetInventory;
|
||||
|
||||
@ManyToOne(() => AssetPurchase, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
purchase: AssetPurchase;
|
||||
@Column({ type: "float8" })
|
||||
purchase_value: number;
|
||||
|
||||
@ManyToOne(() => AssetRequestOrder, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
request_order: AssetRequestOrder;
|
||||
@Column({ type: "int2" })
|
||||
month: number;
|
||||
|
||||
@ManyToOne(() => AssetGood, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
good: AssetGood;
|
||||
@Column({ nullable: true })
|
||||
period: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
description: string;
|
||||
@Column({ type: "float8" })
|
||||
percent: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
serial: string;
|
||||
@Column({ type: "float8" })
|
||||
initial_value: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
notes: string;
|
||||
@Column({ type: "float8" })
|
||||
depreciation_value: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
acquired_at: Date;
|
||||
@Column({ type: "float8" })
|
||||
loss_value: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
acquired_price: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
book_value: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
insured_value: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
@Column({ type: "float8" })
|
||||
current_value: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
premi_value: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
condition: AssetInventoryCondition;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
branch_id: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
branch_code: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
branch_name: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
department_id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
department_name: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
employee_id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
employee_name: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
13
src/index.ts
13
src/index.ts
@ -61,6 +61,7 @@ import { BrivaCompanyUser } from "./entity/briva_company_users";
|
||||
import { BrivaCompanyUserRefreshToken } from "./entity/briva_company_user_refresh_token";
|
||||
import { BrivaAccount } from "./entity/briva_accounts";
|
||||
import { BrivaTransaction } from "./entity/briva_transactions";
|
||||
|
||||
import { AssetSupplier } from "./entity/asset_supplier";
|
||||
import { AssetFixedClassification } from "./entity/asset_fixed_classification";
|
||||
import { AssetFixedType } from "./entity/asset_fixed_type";
|
||||
@ -80,6 +81,9 @@ import { AssetInventoryCondition, AssetFixedTypeType } from "./types/asset";
|
||||
import { AssetInventory } from "./entity/asset_inventories";
|
||||
import { AssetInventoryAttribute } from "./entity/asset_inventory_attributes";
|
||||
import { AssetInventoryHistory } from "./entity/asset_inventory_histories";
|
||||
import { AssetInventoryDepreciation } from "./entity/asset_inventory_depreciations";
|
||||
import { AssetInventoryDepreciationLog } from "./entity/asset_inventory_depreciation_logs";
|
||||
|
||||
import { RemitOtp } from "./entity/remit_otp";
|
||||
import { RemitPartnerUser } from "./entity/remit_partner_users";
|
||||
import { RemitPartner } from "./entity/remit_partners";
|
||||
@ -147,11 +151,13 @@ export {
|
||||
CategoryType,
|
||||
PullerStatus,
|
||||
Target,
|
||||
|
||||
BankGaransi,
|
||||
BankGaransiPending,
|
||||
BankGaransiType,
|
||||
BankGaransiStatus,
|
||||
BankGaransiPic,
|
||||
|
||||
Summarize,
|
||||
SummarizeLog,
|
||||
SummarizeLogStatus,
|
||||
@ -160,6 +166,7 @@ export {
|
||||
BpaFormat,
|
||||
BpaLog,
|
||||
Bpa,
|
||||
|
||||
CreditCompany,
|
||||
CreditDebtor,
|
||||
CreditTypeForms,
|
||||
@ -172,14 +179,17 @@ export {
|
||||
CreditApplicationFileStatus,
|
||||
CreditConfigs,
|
||||
CreditConfigInsurance,
|
||||
|
||||
Application,
|
||||
TellerMutation,
|
||||
LogHikvision,
|
||||
|
||||
BrivaCompany,
|
||||
BrivaCompanyUser,
|
||||
BrivaCompanyUserRefreshToken,
|
||||
BrivaAccount,
|
||||
BrivaTransaction,
|
||||
|
||||
AssetSupplier,
|
||||
AssetFixedClassification,
|
||||
AssetFixedType,
|
||||
@ -200,6 +210,9 @@ export {
|
||||
AssetInventoryAttribute,
|
||||
AssetInventoryHistory,
|
||||
AssetFixedTypeType,
|
||||
AssetInventoryDepreciation,
|
||||
AssetInventoryDepreciationLog,
|
||||
|
||||
RemitOtp,
|
||||
RemitPartnerUser,
|
||||
RemitPartner,
|
||||
|
||||
Reference in New Issue
Block a user