feat: add share profit to item
continuous-integration/drone/tag Build is passing Details

fix/bug-firman 20.1.41-alpha.1
shancheas 2024-08-15 14:27:54 +07:00
parent cefeef8854
commit 50e8951b71
3 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddItemProfit1723706764654 implements MigrationInterface {
name = 'AddItemProfit1723706764654';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "items" ADD "share_profit" numeric`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "items" DROP COLUMN "share_profit"`);
}
}

View File

@ -41,6 +41,9 @@ export class ItemModel
@Column('decimal', { name: 'sales_margin', nullable: true })
sales_margin: number;
@Column('decimal', { name: 'share_profit', nullable: true })
share_profit: number;
@Column('bigint', { name: 'total_price', nullable: true })
total_price: number;

View File

@ -42,10 +42,12 @@ export class DetailItemManager extends BaseDetailManager<ItemEntity> {
`${this.tableName}.limit_value`,
`${this.tableName}.hpp`,
`${this.tableName}.sales_margin`,
`${this.tableName}.share_profit`,
`${this.tableName}.total_price`,
`${this.tableName}.base_price`,
`${this.tableName}.use_queue`,
`${this.tableName}.show_to_booking`,
`${this.tableName}.show_to_booking`,
`item_category.id`,
`item_category.name`,