=> get INVENTORY values for following sku (PV01, LM01, KW01, ES01 and NM01) from db tables =>PV01 => fcsusdbadmin_notions_dropship.prevuepet_op =>LM01 => fcsusdbadmin_notions_dropship.sd300_notinv_inv =>KW01 => fcsusdbadmin_notions_dropship.sd300_notinv_inv =>ES01 => fcsusdbadmin_notions_dropship.sd300_notinv_inv =>NM01 => fcsusdbadmin_notions_dropship.sd300_notinv_inv => Read active inventory file (downloaded from Ebay) and get following sku (PV01,LM01,KW01,ES01 and NM01) with its inventory and price and calc 4th column with (price* inventory) and save =>Compare skus from file with db sku => remove those sku from file which are not in our db =>Next if hour is 9 or 11 or 17 or 1 or 5 or 21 => loop through NM01 data (from file) and get its inventory from db table =>if any sku inventory not found, we remove the underscore and extract the sku =>then get its inventory from db table =>Check if inventory from file and calculated inventory is different =>then we insert to total_sheet array => and add 4th column in total_sheet_Array with values from multiplying price with new inventory value. =>Next we check if day is not sat nor sunday and hour is 15 =>Loop through LM01 data (from file) => we calculate the inventory value =>Check if inventory from file and calculated inventory is different =>then we insert to total_sheet array => and add 4th column in total_sheet_Array with values from multiplying price with new inventory value. =>Next we check if hour is 1 or 3 or 5 or 7 or 11 or 13 or 15 or 17 or 19 or 21 or 23 =>Loop through PV01 data( from file) => we calculate the inventory value =>Check if inventory from file and calculated inventory is different =>then we insert to total_sheet array => and add 4th column in total_sheet_Array with values from multiplying price with new inventory value. =>Next we check if hour is 1 or 11 or 17 =>Loop through KW01 data( from file) => we calculate the inventory value =>Check if inventory from file and calculated inventory is different =>then we insert to total_sheet array => and add 4th column in total_sheet_Array with values from multiplying price with new inventory value. =>NOW FOR ES01 SKU => LOOping through es01 array(from file) =>Check if inventory from file and calculated inventory is different =>then we insert to total_sheet array => and add 4th column in total_sheet_Array with values from multiplying price with new inventory value. =>if suppose final_array is empty then we jst place the header inside the final_array. else we calc limit from the existing active inv file and we get new limit from the sum of newly calculate inventory and multiplying with the price =>next we check if new limit > 30 lakhs or 3 million col= 4th column of total_sheet_array then we sort the 4th col values in desc order =>now looping through total_sheet_array => if any value not set, we skip => next we check nm01 sku => if nm01 skus are b2b, then we skip => we reduce each sku's inventory by 1 value and save it inside compare_qnty array if done for 1000 values set counter to 0. calculate new limit= array_sum ( 4th col of total_sheet_array) if new value < 29 lakhs looping through compare_qnty we check if inventory is same as before then remove those values from final_array else we set final_array with "Revise","itemid","qty" new limit is the new value (calc in steps above) if est == true we create the file upload.csv and fill the values from final_array then we upload this file using the script upload_inv.php else we display error file is not generated due to time zone