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