fix: product

This commit is contained in:
ilham 2021-12-23 21:43:48 +07:00
parent d9415dbaa3
commit 7b0056f2ae

View File

@ -12,6 +12,7 @@ import { UsersService } from '../users/users.service';
import { SupplierService } from '../users/supplier/supplier.service';
import { parsingFile } from '../helper/csv-parser';
import { PartnerService } from '../users/partner/partner.service';
import { isNull } from 'util';
export class ProductService {
constructor(
@ -90,6 +91,11 @@ export class ProductService {
});
}
if(!dataHistoryPrice){
console.log(productData,"productnya",partnerData);
return;
}
dataHistoryPrice.endDate = new Date();
await this.productHistoryPrice.save(dataHistoryPrice);
@ -99,7 +105,6 @@ export class ProductService {
price: it[3],
type: productType.NORMAL,
startDate: new Date(),
endDate: null,
partner: it[6] != '-' ? partnerData : null,
});
} else {
@ -122,7 +127,7 @@ export class ProductService {
type: productType.NORMAL,
startDate: new Date(),
endDate: null,
partner: it[6] != '-' ? partnerData : null,
partner: partnerData,
});
}
}),