SET FOREIGN_KEY_CHECKS=0;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

SET SESSION time_zone='+0:00';

INSERT INTO `requests` (`id`, `date_received`, `serial_number`, `service_number`, `employee_name`, `email_addr`, `mobile_phone`, `section`, `division_id`, `branch`, `approver_service_number`, `request_type_id`, `last_altered_by`, `last_altered_date`, `endorser_service_number`, `primary_leave_period_id`, `leave_comments`, `reason_declined`, `med_cert_witnessed`, `notify_email`, `notify_sms`) VALUES
	(1, '2012-08-20 03:24:15', 1, 47802, 'Matthew Clarke', 'Matthew.Clarke@ausgrid.com.au', '0417667681', 'Business Systems Development', 1, 'Business Services', 39887, 1, NULL, NULL, NULL, 1, NULL, NULL, NULL, 1, 0),
	(2, '2012-08-20 03:24:15', 2, 47802, 'Matthew Clarke', 'Matthew.Clarke@ausgrid.com.au', '0417667681', 'Business Systems Development', 1, 'Business Services', 39887, 1, NULL, NULL, NULL, 3, NULL, NULL, NULL, 1, 0),
	(3, '2012-08-20 03:24:15', 3, 47357, 'Aaron Hughes', 'ahughes@ausgrid.com.au', '0407270082', 'Transmission Substations - Newcastle', 2, 'Transmission Substations & Services', 39887, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0),
	(4, '2012-08-20 03:24:15', 4, 47357, 'Aaron Hughes', 'ahughes@ausgrid.com.au', '0407270082', 'Transmission Substations - Newcastle', 2, 'Transmission Substations & Services', 39887, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0),
	(5, '2012-08-19 22:25:19', 5, 55513, 'Jeff Rogers', 'JRogers@ausgrid.com.au', '0409401690', 'Business Systems Development', 1, 'Business Services', 43880, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0);


INSERT INTO `request_accrued_rdos` (`id`, `item_id`, `rdo_date`) VALUES
	(1, 6, '2012-07-06');

INSERT INTO `request_contractor_leave_periods` (`id`, `item_id`, `start_date`, `end_date`, `comments`) VALUES
	(1, 10, '2012-09-03', '2012-09-28', 'Comments');

INSERT INTO `request_items` (`id`, `item_serial_number`, `request_id`, `status_id`, `status_reason`) VALUES
	(1, 1, 1, 1, NULL),
	(2, 3, 2, 1, NULL),
	(3, 4, 2, 1, NULL),
	(4, 1, 2, 1, NULL),
	(5, 2, 2, 1, NULL),
	(6, 1, 3, 1, NULL),
	(7, 1, 4, 1, NULL),
	(8, 2, 4, 1, NULL),
	(9, 5, 2, 1, NULL),
	(10, 1, 5, 1, NULL);

INSERT INTO `request_leave_periods` (`id`, `item_id`, `leave_type_id`, `start_date`, `end_date`, `med_cert_witnessed`) VALUES
	(1, 1, 1, '2012-07-10', '2012-07-12', NULL),
	(2, 2, 2, '2012-09-03', '2012-10-01', NULL),
	(3, 3, 9, '2012-10-15', '2012-10-19', NULL);

INSERT INTO `request_leave_period_details` (`leave_period_id`, `start_time`, `end_time`, `duration_weeks`, `duration_days`, `duration_hours`, `duration_minutes`, `pay_type_id`, `prepayment_requested`) VALUES
	(1, '08:00:00', '17:00:00', 0, 3, 0, 0, NULL, NULL),
	(2, '08:00:00', '17:00:00', 3, 2, 0, 0, 2, 1);

INSERT INTO `request_rdos` (`id`, `item_id`, `rdo_date`) VALUES
	(1, 4, '2012-09-14'),
	(2, 5, '2012-09-28');

INSERT INTO `request_rdo_replacements` (`id`, `item_id`, `actual_date`, `date_taken`, `accrued_rdo_item_id`) VALUES
	(1, 7, '2012-07-06', '2012-07-20', NULL),
	(2, 8, '2012-07-13', '2012-07-27', NULL);

INSERT INTO `request_ulves` (`id`, `item_id`, `ulve_date`) VALUES
	(1, 9, '2012-08-29');


INSERT INTO user_cost_centres (service_number, cost_centre) VALUES (43880, 2101);
INSERT INTO cost_centre_preferences (cost_centre, schedules_weekends) VALUES (2101, 1);

INSERT INTO user_roles (service_number, role_id) VALUES
	(47187, 1), -- Superuser
	(39887, 2), -- Manager
	(43880, 3); -- Level 3 manager

INSERT INTO manager_map (manager_service_number, level3_service_number) VALUES
	(39887, 43880);

SET FOREIGN_KEY_CHECKS=1;
