inr_value:GWM

This commit is contained in:
sriramv 2023-08-08 14:29:41 +05:30
parent 5bf6f37330
commit c639c62abe
4 changed files with 18 additions and 7 deletions

View File

@ -25,6 +25,7 @@ module.exports = (sequelize, DataTypes) => {
is_active: { type: DataTypes.INTEGER }, is_active: { type: DataTypes.INTEGER },
value: { 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 }, createdby: { type: DataTypes.INTEGER },
updatedby: { type: DataTypes.INTEGER }, updatedby: { type: DataTypes.INTEGER },

View File

@ -94,9 +94,12 @@ const { logMsg } = require('../services/logger.js');
update_array_data.forEach((value,index) => { update_array_data.forEach((value,index) => {
if(value.value != null) if(value.value != null)
{ {
Financials.update( { value: value.value , is_editable : 0 } , { where: { entity_id: value.entityid , itemid: value.itemid , fy:value.year} }) // Replace this with the INR value you want to convert
.then(data => { logMsg.info("update success : "+ data); }) lakhsValue = convertINRtoLakhs(value.value);
.catch(err => { logMsg.info("update failed : " + err); });
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(); } if (index === update_array_data.length -1) { resolve(); }
}); });
@ -133,6 +136,12 @@ const { logMsg } = require('../services/logger.js');
} }
function convertINRtoLakhs(inrValue) {
return inrValue / 100000;
}
module.exports = { module.exports = {
lineItemFetching : lineItemFetching , lineItemFetching : lineItemFetching ,
lineItemMapping : lineItemMapping , lineItemMapping : lineItemMapping ,

View File

@ -69,3 +69,4 @@ app.listen({ port: PORT_NUMBER }, async () => {
//await sequelize.authenticate() //await sequelize.authenticate()
}) })