sum_api_swagger:GWM
This commit is contained in:
parent
face92357d
commit
181905749c
@ -317,7 +317,7 @@ Pro42Data.forEach((Pro42Datavalue, key)=>{
|
||||
{
|
||||
fin_data_obj = { "entity_id":entity_id,"st_type":st_type,"itemid":i,"fy":fy,"value":0,"is_active":1,"createdby":4}
|
||||
fin_data_array.push(fin_data_obj);
|
||||
} console.log("------"+entity_id +"---"+ fy)
|
||||
} //console.log("------"+entity_id +"---"+ fy)
|
||||
//bulk financials data create
|
||||
Financials.bulkCreate(fin_data_array);
|
||||
//console.log(fin_data_array)
|
||||
@ -368,9 +368,16 @@ exports.createFinancialYear = async (req, res) => {
|
||||
const Y3_st_type = Entityfinyearsdata.dataValues.Y2_st_type;
|
||||
const Y4_st_type = Entityfinyearsdata.dataValues.Y3_st_type;
|
||||
const additional_year_type = req.body.additional_year_type;
|
||||
if(req.body.fy > new Date().getFullYear() && req.body.fy == Entityfinyearsdata.dataValues.Y1)
|
||||
{
|
||||
// not allowing any process
|
||||
res.status(500).send({'status':500, 'message': "The year creation not allowed" ,'data': "No data" });
|
||||
}
|
||||
else
|
||||
{
|
||||
Entityfinyears.update({ Y1:Y1,Y2:Y2,Y3:Y3,Y4:Y4,Y1_st_type:Y1_st_type,Y2_st_type:Y2_st_type,Y3_st_type:Y3_st_type,Y4_st_type:Y4_st_type,additional_year_type:additional_year_type },{ where: { id: id }})
|
||||
.then(UpdatedEntityfinyearsdata => {
|
||||
|
||||
|
||||
// generate new financials data array for given FY with entity_id
|
||||
let fin_data_array = [];
|
||||
for (let i = 1; i < 120; i++)
|
||||
@ -386,6 +393,9 @@ exports.createFinancialYear = async (req, res) => {
|
||||
res.status(404).send({'status':404,
|
||||
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data" });
|
||||
}); // end of update Entityfinyears
|
||||
|
||||
} // end of else part
|
||||
|
||||
}).catch(err => {
|
||||
res.status(404).send({'status':404,
|
||||
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data" });
|
||||
|
||||
@ -8,7 +8,25 @@ module.exports = app => {
|
||||
var router = require("express").Router();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/ConsolidatedSummary:
|
||||
* get:
|
||||
* summary: Consolidated Summary
|
||||
* description: Get consolidated Financials Summary data by sending losid
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: losid
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: LOSID
|
||||
* example: MW112233
|
||||
* responses:
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
// get financials summary
|
||||
router.get("/ConsolidatedSummary", financials.ConsolidatedSummary);
|
||||
/**
|
||||
* @swagger
|
||||
|
||||
Loading…
Reference in New Issue
Block a user