- fix code voca in subcategory column
This commit is contained in:
@@ -44,7 +44,7 @@ export class Product extends BaseModel {
|
|||||||
return ProductSubCategories;
|
return ProductSubCategories;
|
||||||
},
|
},
|
||||||
(subCategories) => {
|
(subCategories) => {
|
||||||
return subCategories.id;
|
return subCategories.product;
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
sub_categories: ProductSubCategories;
|
sub_categories: ProductSubCategories;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import { doAuthorizeHemat } from '../helper/sihemat-authorization';
|
|||||||
import { ProductHistoryStatusService } from '../product/history-status/history-status.service';
|
import { ProductHistoryStatusService } from '../product/history-status/history-status.service';
|
||||||
import { Workbook } from 'exceljs';
|
import { Workbook } from 'exceljs';
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import {ProductSubCategoriesService} from "../product/product-sub-categories.service";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TransactionService {
|
export class TransactionService {
|
||||||
@@ -67,6 +68,7 @@ export class TransactionService {
|
|||||||
private callbackPartnerRepository: Repository<CallbackPartner>,
|
private callbackPartnerRepository: Repository<CallbackPartner>,
|
||||||
private coaService: CoaService,
|
private coaService: CoaService,
|
||||||
private productService: ProductService,
|
private productService: ProductService,
|
||||||
|
private productSubcategoriesService: ProductSubCategoriesService,
|
||||||
private productHistoryPriceService: ProductHistoryPriceService,
|
private productHistoryPriceService: ProductHistoryPriceService,
|
||||||
private productHistoryStatusService: ProductHistoryStatusService,
|
private productHistoryStatusService: ProductHistoryStatusService,
|
||||||
private userService: UsersService,
|
private userService: UsersService,
|
||||||
@@ -531,6 +533,10 @@ export class TransactionService {
|
|||||||
orderTransactionDto.productId,
|
orderTransactionDto.productId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const productSubcategories = await this.productSubcategoriesService.findOne(
|
||||||
|
product.sub_categories_id
|
||||||
|
);
|
||||||
|
|
||||||
const supplier = await this.supplierService.findByCode(
|
const supplier = await this.supplierService.findByCode(
|
||||||
product.supplier.code,
|
product.supplier.code,
|
||||||
);
|
);
|
||||||
@@ -628,7 +634,7 @@ export class TransactionService {
|
|||||||
if (supplier.code == 'Hemat') {
|
if (supplier.code == 'Hemat') {
|
||||||
hitLoginHemat = await doAuthorizeHemat(supplier.irs_user, supplier.irs_pass, supplier);
|
hitLoginHemat = await doAuthorizeHemat(supplier.irs_user, supplier.irs_pass, supplier);
|
||||||
}
|
}
|
||||||
console.log('inicodesubcategory', product.sub_categories.name)
|
console.log('inicodesubcategory', productSubcategories.code)
|
||||||
let hitSupplier = supplier.code == 'Hemat' ?
|
let hitSupplier = supplier.code == 'Hemat' ?
|
||||||
await doTransaction(
|
await doTransaction(
|
||||||
orderTransactionDto.productCode,
|
orderTransactionDto.productCode,
|
||||||
@@ -638,7 +644,7 @@ export class TransactionService {
|
|||||||
hitLoginHemat.data,
|
hitLoginHemat.data,
|
||||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
) : await doTransaction(
|
) : await doTransaction(
|
||||||
orderTransactionDto.productCode,
|
orderTransactionDto.productCode,
|
||||||
@@ -648,7 +654,7 @@ export class TransactionService {
|
|||||||
"",
|
"",
|
||||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -891,6 +897,10 @@ export class TransactionService {
|
|||||||
orderTransactionDto.productId
|
orderTransactionDto.productId
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const productSubcategories = await this.productSubcategoriesService.findOne(
|
||||||
|
product.sub_categories_id
|
||||||
|
);
|
||||||
|
|
||||||
const supplier = await this.supplierService.findByCode(
|
const supplier = await this.supplierService.findByCode(
|
||||||
product.supplier.code,
|
product.supplier.code,
|
||||||
);
|
);
|
||||||
@@ -953,7 +963,7 @@ export class TransactionService {
|
|||||||
hitLoginHemat.data,
|
hitLoginHemat.data,
|
||||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
) : await doTransaction(
|
) : await doTransaction(
|
||||||
orderTransactionDto.productCode,
|
orderTransactionDto.productCode,
|
||||||
@@ -963,7 +973,7 @@ export class TransactionService {
|
|||||||
"",
|
"",
|
||||||
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1080,6 +1090,10 @@ export class TransactionService {
|
|||||||
orderTransactionDto.productId
|
orderTransactionDto.productId
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const productSubcategories = await this.productSubcategoriesService.findOne(
|
||||||
|
product.sub_categories_id
|
||||||
|
);
|
||||||
|
|
||||||
const supplier = await this.supplierService.findByCode(
|
const supplier = await this.supplierService.findByCode(
|
||||||
product.supplier.code,
|
product.supplier.code,
|
||||||
);
|
);
|
||||||
@@ -1117,7 +1131,7 @@ export class TransactionService {
|
|||||||
hitLoginHemat.data,
|
hitLoginHemat.data,
|
||||||
'INQUIRY',
|
'INQUIRY',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
)
|
)
|
||||||
} else if (supplier.code == 'Digiflazz') {
|
} else if (supplier.code == 'Digiflazz') {
|
||||||
@@ -1129,7 +1143,7 @@ export class TransactionService {
|
|||||||
hitLoginHemat.data,
|
hitLoginHemat.data,
|
||||||
'INQUIRY',
|
'INQUIRY',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@@ -1141,7 +1155,7 @@ export class TransactionService {
|
|||||||
"",
|
"",
|
||||||
'INQUIRY',
|
'INQUIRY',
|
||||||
orderTransactionDto.bill_trx_id,
|
orderTransactionDto.bill_trx_id,
|
||||||
product.sub_categories.code_voca,
|
productSubcategories.code_voca,
|
||||||
product_price.price
|
product_price.price
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user