inr_value:GWM
This commit is contained in:
parent
5bf6f37330
commit
c639c62abe
@ -24,7 +24,8 @@ module.exports = (sequelize, DataTypes) => {
|
||||
is_editable: { type: DataTypes.INTEGER },
|
||||
is_active: { type: DataTypes.INTEGER },
|
||||
value: { type: DataTypes.INTEGER },
|
||||
sub_value: { type: DataTypes.STRING },
|
||||
sub_value: { type: DataTypes.STRING },
|
||||
inr_value: { type: DataTypes.INTEGER },
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ function probe42ApiCall(cin) {
|
||||
method: "POST",
|
||||
json: true,
|
||||
body: myJSONObject
|
||||
}, function (error, response, body) {
|
||||
}, function (error, response, body) {
|
||||
if (body != undefined) {
|
||||
if (response.statusCode == 200 && body.hasOwnProperty("data") && body.data.financials.length != 0) {
|
||||
financial_data = body.data.financials;
|
||||
|
||||
@ -94,9 +94,12 @@ const { logMsg } = require('../services/logger.js');
|
||||
update_array_data.forEach((value,index) => {
|
||||
if(value.value != null)
|
||||
{
|
||||
Financials.update( { value: value.value , is_editable : 0 } , { where: { entity_id: value.entityid , itemid: value.itemid , fy:value.year} })
|
||||
.then(data => { logMsg.info("update success : "+ data); })
|
||||
.catch(err => { logMsg.info("update failed : " + err); });
|
||||
// Replace this with the INR value you want to convert
|
||||
lakhsValue = convertINRtoLakhs(value.value);
|
||||
|
||||
Financials.update( { inr_value:value.value,value: lakhsValue , is_editable : 0 } , { where: { entity_id: value.entityid , itemid: value.itemid , fy:value.year} })
|
||||
.then(data => { logMsg.info("update success : "+ data); })
|
||||
.catch(err => { logMsg.info("update failed : " + err); });
|
||||
}
|
||||
if (index === update_array_data.length -1) { resolve(); }
|
||||
});
|
||||
@ -131,7 +134,13 @@ const { logMsg } = require('../services/logger.js');
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function convertINRtoLakhs(inrValue) {
|
||||
return inrValue / 100000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
lineItemFetching : lineItemFetching ,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user