1. Check that cost centre number for the site in Sage.


2. Check the site has been added on expenses and the cost centre number matches Sage


3. Check the site is in the correct division and company in portal 2 and make a home instruction if necessary to move it.


4. Check on HeidiSQL that the site cost centre number on portal matches Sage by using:


SET @theDate = CURDATE();




SELECT 


HD.id,


HD.dated,


HD.home_id,


HD.home_name,


HD.alacarte_id,


LPAD(RIGHT(CONVERT((CASE 


WHEN HD.alacarte_id IS NOT NULL THEN HD.alacarte_id


WHEN HD.jarman_id IS NOT NULL AND HD.jarman_id  >0 THEN HD.jarman_id


WHEN HD.careblox_id IS NOT NULL AND HD.careblox_id >0 THEN HD.careblox_id


ELSE NULL


END),CHAR),3),3,'0') AS CC,


(SELECT NAME FROM portaldb1.groups gp WHERE gp.id = HD.care_company_id) AS COMPANY


/*


,


HD.* 


*/


FROM home_details HD,


(


SELECT HD2.home_id,MAX(HD2.dated) AS dated FROM home_details HD2 WHERE HD2.dated <= @theDate GROUP BY HD2.home_id


) HD3




WHERE HD.home_id = HD3.home_id AND HD.dated = HD3.dated


AND HD.alacarte_id IS NOT NULL


ORDER BY CC


;


5. Ensure A La Carte ID is correct by using:


select * from home_details where home_name like '%example home name%' 


The first two numbers are the company ID, the next three numbers are the cost centre, for example


24 (Silverlake 2) 563 (The Grange Cost Centre)


Edit all instances of the home that show up after running this query.




Home should then appear in Actuals Asker.