-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 09, 2023 at 10:38 AM
-- Server version: 5.0.51
-- PHP Version: 5.3.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `jjlourens2`
--

-- --------------------------------------------------------

--
-- Stand-in structure for view `view_action`
--
CREATE TABLE IF NOT EXISTS `view_action` (
`pk_job` int(11)
,`fk_job` int(11)
,`pkAction` int(11)
,`fkActType` int(11)
,`actNote` longblob
,`actDateCap` datetime
,`actDateFor` date
,`actTimeFor` time
,`actUserCap` int(11)
,`actUserFor` int(11)
,`actIsDoneSuper` int(11)
,`actIsDoneUser` int(11)
,`actDateUserIsdone` datetime
,`rndm5` varchar(12)
,`actDateSuperIsdone` datetime
,`pkactType` int(11)
,`actname` varchar(35)
,`capid` int(11)
,`capname` varchar(255)
,`forid` varchar(255)
,`forname` int(11)
,`actClerkNote` longtext
,`actSuperNote` longtext
,`jbClaimNo` varchar(255)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_financial`
--
CREATE TABLE IF NOT EXISTS `view_cal_financial` (
`clName` varchar(50)
,`clSurname` varchar(50)
,`fkJobDone` int(1)
,`fkInsApproval` int(1)
,`fkExcessDelay` int(1)
,`fkExcessGet` int(1)
,`fkLeakDetection` int(1)
,`fkInspection` int(1)
,`jbClaimNo` varchar(255)
,`insName` varchar(255)
,`fkquote` int(1)
,`fkproofpay` int(1)
,`finuInCharge` int(11)
,`sheduleDate` date
,`jobType` int(3)
,`jobCat` int(2)
,`jobDone` int(1)
,`tName` varchar(255)
,`ActionName` varchar(30)
,`userName` varchar(255)
,`fkCloseFile` int(1)
,`pk_job` int(11)
,`finDelay` int(1)
,`finDelayDate` date
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_financial_closefile`
--
CREATE TABLE IF NOT EXISTS `view_cal_financial_closefile` (
`clName` varchar(50)
,`clSurname` varchar(50)
,`fkJobDone` int(1)
,`fkInsApproval` int(1)
,`fkExcessDelay` int(1)
,`fkExcessGet` int(1)
,`fkLeakDetection` int(1)
,`fkInspection` int(1)
,`jbClaimNo` varchar(255)
,`insName` varchar(255)
,`fkquote` int(1)
,`fkproofpay` int(1)
,`finuInCharge` int(11)
,`sheduleDate` date
,`jobType` int(3)
,`jobCat` int(2)
,`jobDone` int(1)
,`tName` varchar(255)
,`ActionName` varchar(30)
,`userName` varchar(255)
,`fkCloseFile` int(1)
,`pk_job` int(11)
,`finDelay` int(1)
,`finDelayDate` date
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_financial_sos`
--
CREATE TABLE IF NOT EXISTS `view_cal_financial_sos` (
`clName` varchar(50)
,`clSurname` varchar(50)
,`fkJobDone` int(1)
,`fkInsApproval` int(1)
,`fkExcessDelay` int(1)
,`fkExcessGet` int(1)
,`fkLeakDetection` int(1)
,`fkInspection` int(1)
,`jbClaimNo` varchar(255)
,`insName` varchar(255)
,`fkquote` int(1)
,`fkproofpay` int(1)
,`finuInCharge` int(11)
,`sheduleDate` date
,`jobType` int(3)
,`jobCat` int(2)
,`jobDone` int(1)
,`tName` varchar(255)
,`ActionName` varchar(30)
,`userName` varchar(255)
,`finDelayDate` date
,`finDelay` int(1)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_inspection`
--
CREATE TABLE IF NOT EXISTS `view_cal_inspection` (
`clSurname` varchar(50)
,`sheduleDate` date
,`pname` varchar(50)
,`jobDone` int(1)
,`cancelled` enum('1','0')
,`fk_postal` int(11)
,`jobType` int(3)
,`jbClaimNo` varchar(255)
,`pk_postal` int(11)
,`suburb` varchar(50)
,`fk_plumber` int(11)
,`snooze` int(1)
,`pk_job` int(11)
,`jobCat` int(2)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_inspection_sos`
--
CREATE TABLE IF NOT EXISTS `view_cal_inspection_sos` (
`clSurname` varchar(50)
,`sheduleDate` date
,`pname` varchar(50)
,`jobDone` int(1)
,`cancelled` enum('1','0')
,`fk_postal` int(11)
,`jobType` int(3)
,`jbClaimNo` varchar(255)
,`pk_postal` int(11)
,`suburb` varchar(50)
,`fk_plumber` int(11)
,`snooze` int(1)
,`pk_job` int(11)
,`jobCat` int(2)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_job`
--
CREATE TABLE IF NOT EXISTS `view_cal_job` (
`pk_job` int(11)
,`snooze` int(1)
,`jobDone` int(1)
,`t0` bigint(13)
,`t1` bigint(13)
,`t2` bigint(13)
,`t3` bigint(13)
,`t4` bigint(13)
,`t5` bigint(13)
,`t6` bigint(13)
,`t7` bigint(13)
,`t8` bigint(13)
,`t9` bigint(13)
,`t10` bigint(13)
,`t11` bigint(13)
,`t12` bigint(13)
,`t13` bigint(13)
,`t14` bigint(13)
,`t15` bigint(13)
,`t16` bigint(13)
,`t17` bigint(13)
,`t18` bigint(13)
,`t19` bigint(13)
,`t20` bigint(13)
,`t21` bigint(13)
,`t22` bigint(13)
,`t23` bigint(13)
,`t24` bigint(13)
,`t25` bigint(13)
,`t26` bigint(13)
,`t27` bigint(13)
,`t28` bigint(13)
,`t29` bigint(13)
,`t30` bigint(13)
,`t31` bigint(13)
,`t32` bigint(13)
,`t33` bigint(13)
,`t34` bigint(13)
,`infot0` varchar(372)
,`infot1` varchar(372)
,`infot2` varchar(372)
,`infot3` varchar(372)
,`infot4` varchar(372)
,`infot5` varchar(372)
,`infot6` varchar(372)
,`infot7` varchar(372)
,`infot8` varchar(372)
,`infot9` varchar(372)
,`infot10` varchar(372)
,`infot11` varchar(372)
,`infot12` varchar(372)
,`infot13` varchar(372)
,`infot14` varchar(372)
,`infot15` varchar(372)
,`infot16` varchar(372)
,`infot17` varchar(372)
,`infot18` varchar(372)
,`infot19` varchar(372)
,`infot20` varchar(372)
,`infot21` varchar(372)
,`infot22` varchar(372)
,`infot23` varchar(372)
,`infot24` varchar(372)
,`infot25` varchar(372)
,`infot26` varchar(372)
,`infot27` varchar(372)
,`infot28` varchar(372)
,`infot29` varchar(372)
,`infot30` varchar(372)
,`infot31` varchar(372)
,`infot32` varchar(372)
,`infot33` varchar(372)
,`infot34` varchar(372)
,`cl0` bigint(11)
,`cl1` bigint(11)
,`cl2` bigint(11)
,`cl3` bigint(11)
,`cl4` bigint(11)
,`cl5` bigint(11)
,`cl6` bigint(11)
,`cl7` bigint(11)
,`cl8` bigint(11)
,`cl9` bigint(11)
,`cl10` bigint(11)
,`cl11` bigint(11)
,`cl12` bigint(11)
,`cl13` bigint(11)
,`cl14` bigint(11)
,`cl15` bigint(11)
,`cl16` bigint(11)
,`cl17` bigint(11)
,`cl18` bigint(11)
,`cl19` bigint(11)
,`cl20` bigint(11)
,`cl21` bigint(11)
,`cl22` bigint(11)
,`cl23` bigint(11)
,`cl24` bigint(11)
,`cl25` bigint(11)
,`cl26` bigint(11)
,`cl27` bigint(11)
,`cl28` bigint(11)
,`cl29` bigint(11)
,`cl30` bigint(11)
,`cl31` bigint(11)
,`cl32` bigint(11)
,`cl33` bigint(11)
,`cl34` bigint(11)
,`ti0` varbinary(8)
,`ti1` varbinary(8)
,`ti2` varbinary(8)
,`ti3` varbinary(8)
,`ti4` varbinary(8)
,`ti5` varbinary(8)
,`ti6` varbinary(8)
,`ti7` varbinary(8)
,`ti8` varbinary(8)
,`ti9` varbinary(8)
,`ti10` varbinary(8)
,`ti11` varbinary(8)
,`ti12` varbinary(8)
,`ti13` varbinary(8)
,`ti14` varbinary(8)
,`ti15` varbinary(8)
,`ti16` varbinary(8)
,`ti17` varbinary(8)
,`ti18` varbinary(8)
,`ti19` varbinary(8)
,`ti20` varbinary(8)
,`ti21` varbinary(8)
,`ti22` varbinary(8)
,`ti23` varbinary(8)
,`ti24` varbinary(8)
,`ti25` varbinary(8)
,`ti26` varbinary(8)
,`ti27` varbinary(8)
,`ti28` varbinary(8)
,`ti29` varbinary(8)
,`ti30` varbinary(8)
,`ti31` varbinary(8)
,`ti32` varbinary(8)
,`ti33` varbinary(8)
,`ti34` varbinary(8)
,`cat0` bigint(11)
,`cat1` bigint(11)
,`cat2` bigint(11)
,`cat3` bigint(11)
,`cat4` bigint(11)
,`cat5` bigint(11)
,`cat6` bigint(11)
,`cat7` bigint(11)
,`cat8` bigint(11)
,`cat9` bigint(11)
,`cat10` bigint(11)
,`cat11` bigint(11)
,`cat12` bigint(11)
,`cat13` bigint(11)
,`cat14` bigint(11)
,`cat15` bigint(11)
,`cat16` bigint(11)
,`cat17` bigint(11)
,`cat18` bigint(11)
,`cat19` bigint(11)
,`cat20` bigint(11)
,`cat21` bigint(11)
,`cat22` bigint(11)
,`cat23` bigint(11)
,`cat24` bigint(11)
,`cat25` bigint(11)
,`cat26` bigint(11)
,`cat27` bigint(11)
,`cat28` bigint(11)
,`cat29` bigint(11)
,`cat30` bigint(11)
,`cat31` bigint(11)
,`cat32` bigint(11)
,`cat33` bigint(11)
,`cat34` bigint(11)
,`action0` bigint(11)
,`action1` bigint(11)
,`action2` bigint(11)
,`action3` bigint(11)
,`action4` bigint(11)
,`action5` bigint(11)
,`action6` bigint(11)
,`action7` bigint(11)
,`action8` bigint(11)
,`action9` bigint(11)
,`action10` bigint(11)
,`action11` bigint(11)
,`action12` bigint(11)
,`action13` bigint(11)
,`action14` bigint(11)
,`action15` bigint(11)
,`action16` bigint(11)
,`action17` bigint(11)
,`action18` bigint(11)
,`action19` bigint(11)
,`action20` bigint(11)
,`action21` bigint(11)
,`action22` bigint(11)
,`action23` bigint(11)
,`action24` bigint(11)
,`action25` bigint(11)
,`action26` bigint(11)
,`action27` bigint(11)
,`action28` bigint(11)
,`action29` bigint(11)
,`action30` bigint(11)
,`action31` bigint(11)
,`action32` bigint(11)
,`action33` bigint(11)
,`action34` bigint(11)
,`pk_schedule` int(11)
,`cancelled` enum('1','0')
,`jobType` int(3)
,`timeStart` time
,`pk_plumber` int(11)
,`ActionName` varchar(30)
,`sheduleDate` date
,`pname` varchar(50)
,`plumberRank` int(3)
,`fk_plumberType` int(3)
,`typeName` varchar(30)
,`rank` int(3)
,`specifictime` int(1)
,`jobCat` int(2)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_stats`
--
CREATE TABLE IF NOT EXISTS `view_cal_stats` (
`insName` varchar(255)
,`jobType` int(3)
,`jbClaimNo` varchar(255)
,`cancelled` enum('1','0')
,`pk_jtype` int(11)
,`tName` varchar(255)
,`tNameShort` varchar(5)
,`jobCat` int(2)
,`sheduleDate` date
,`ActionName` varchar(30)
,`ActionShort` varchar(5)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_stats2`
--
CREATE TABLE IF NOT EXISTS `view_cal_stats2` (
`tName` varchar(255)
,`insAmt1` bigint(21)
,`sheduleDate` date
,`jobType` int(3)
,`insName` varchar(255)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_stats3`
--
CREATE TABLE IF NOT EXISTS `view_cal_stats3` (
`tName` varchar(255)
,`typetotal` bigint(21)
,`sheduleDate` date
,`jobType` int(3)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_stats_comebacks`
--
CREATE TABLE IF NOT EXISTS `view_cal_stats_comebacks` (
`COUNT(jobType)` bigint(21)
,`sheduleDate` date
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_cal_travel`
--
CREATE TABLE IF NOT EXISTS `view_cal_travel` (
`pk_job` int(11)
,`snooze` int(1)
,`jobDone` int(1)
,`t0` bigint(13)
,`t1` bigint(13)
,`t2` bigint(13)
,`t3` bigint(13)
,`t4` bigint(13)
,`t5` bigint(13)
,`t6` bigint(13)
,`t7` bigint(13)
,`t8` bigint(13)
,`t9` bigint(13)
,`t10` bigint(13)
,`t11` bigint(13)
,`t12` bigint(13)
,`t13` bigint(13)
,`t14` bigint(13)
,`t15` bigint(13)
,`t16` bigint(13)
,`t17` bigint(13)
,`t18` bigint(13)
,`t19` bigint(13)
,`t20` bigint(13)
,`t21` bigint(13)
,`t22` bigint(13)
,`t23` bigint(13)
,`t24` bigint(13)
,`t25` bigint(13)
,`t26` bigint(13)
,`t27` bigint(13)
,`t28` bigint(13)
,`t29` bigint(13)
,`t30` bigint(13)
,`t31` bigint(13)
,`t32` bigint(13)
,`t33` bigint(13)
,`t34` bigint(13)
,`infot0` varchar(50)
,`infot1` varchar(50)
,`infot2` varchar(50)
,`infot3` varchar(50)
,`infot4` varchar(50)
,`infot5` varchar(50)
,`infot6` varchar(50)
,`infot7` varchar(50)
,`infot8` varchar(50)
,`infot9` varchar(50)
,`infot10` varchar(50)
,`infot11` varchar(50)
,`infot12` varchar(50)
,`infot13` varchar(50)
,`infot14` varchar(50)
,`infot15` varchar(50)
,`infot16` varchar(50)
,`infot17` varchar(50)
,`infot18` varchar(50)
,`infot19` varchar(50)
,`infot20` varchar(50)
,`infot21` varchar(50)
,`infot22` varchar(50)
,`infot23` varchar(50)
,`infot24` varchar(50)
,`infot25` varchar(50)
,`infot26` varchar(50)
,`infot27` varchar(50)
,`infot28` varchar(50)
,`infot29` varchar(50)
,`infot30` varchar(50)
,`infot31` varchar(50)
,`infot32` varchar(50)
,`infot33` varchar(50)
,`infot34` varchar(50)
,`cl0` bigint(11)
,`cl1` bigint(11)
,`cl2` bigint(11)
,`cl3` bigint(11)
,`cl4` bigint(11)
,`cl5` bigint(11)
,`cl6` bigint(11)
,`cl7` bigint(11)
,`cl8` bigint(11)
,`cl9` bigint(11)
,`cl10` bigint(11)
,`cl11` bigint(11)
,`cl12` bigint(11)
,`cl13` bigint(11)
,`cl14` bigint(11)
,`cl15` bigint(11)
,`cl16` bigint(11)
,`cl17` bigint(11)
,`cl18` bigint(11)
,`cl19` bigint(11)
,`cl20` bigint(11)
,`cl21` bigint(11)
,`cl22` bigint(11)
,`cl23` bigint(11)
,`cl24` bigint(11)
,`cl25` bigint(11)
,`cl26` bigint(11)
,`cl27` bigint(11)
,`cl28` bigint(11)
,`cl29` bigint(11)
,`cl30` bigint(11)
,`cl31` bigint(11)
,`cl32` bigint(11)
,`cl33` bigint(11)
,`cl34` bigint(11)
,`ti0` varbinary(8)
,`ti1` varbinary(8)
,`ti2` varbinary(8)
,`ti3` varbinary(8)
,`ti4` varbinary(8)
,`ti5` varbinary(8)
,`ti6` varbinary(8)
,`ti7` varbinary(8)
,`ti8` varbinary(8)
,`ti9` varbinary(8)
,`ti10` varbinary(8)
,`ti11` varbinary(8)
,`ti12` varbinary(8)
,`ti13` varbinary(8)
,`ti14` varbinary(8)
,`ti15` varbinary(8)
,`ti16` varbinary(8)
,`ti17` varbinary(8)
,`ti18` varbinary(8)
,`ti19` varbinary(8)
,`ti20` varbinary(8)
,`ti21` varbinary(8)
,`ti22` varbinary(8)
,`ti23` varbinary(8)
,`ti24` varbinary(8)
,`ti25` varbinary(8)
,`ti26` varbinary(8)
,`ti27` varbinary(8)
,`ti28` varbinary(8)
,`ti29` varbinary(8)
,`ti30` varbinary(8)
,`ti31` varbinary(8)
,`ti32` varbinary(8)
,`ti33` varbinary(8)
,`ti34` varbinary(8)
,`cat0` bigint(11)
,`cat1` bigint(11)
,`cat2` bigint(11)
,`cat3` bigint(11)
,`cat4` bigint(11)
,`cat5` bigint(11)
,`cat6` bigint(11)
,`cat7` bigint(11)
,`cat8` bigint(11)
,`cat9` bigint(11)
,`cat10` bigint(11)
,`cat11` bigint(11)
,`cat12` bigint(11)
,`cat13` bigint(11)
,`cat14` bigint(11)
,`cat15` bigint(11)
,`cat16` bigint(11)
,`cat17` bigint(11)
,`cat18` bigint(11)
,`cat19` bigint(11)
,`cat20` bigint(11)
,`cat21` bigint(11)
,`cat22` bigint(11)
,`cat23` bigint(11)
,`cat24` bigint(11)
,`cat25` bigint(11)
,`cat26` bigint(11)
,`cat27` bigint(11)
,`cat28` bigint(11)
,`cat29` bigint(11)
,`cat30` bigint(11)
,`cat31` bigint(11)
,`cat32` bigint(11)
,`cat33` bigint(11)
,`cat34` bigint(11)
,`action0` bigint(11)
,`action1` bigint(11)
,`action2` bigint(11)
,`action3` bigint(11)
,`action4` bigint(11)
,`action5` bigint(11)
,`action6` bigint(11)
,`action7` bigint(11)
,`action8` bigint(11)
,`action9` bigint(11)
,`action10` bigint(11)
,`action11` bigint(11)
,`action12` bigint(11)
,`action13` bigint(11)
,`action14` bigint(11)
,`action15` bigint(11)
,`action16` bigint(11)
,`action17` bigint(11)
,`action18` bigint(11)
,`action19` bigint(11)
,`action20` bigint(11)
,`action21` bigint(11)
,`action22` bigint(11)
,`action23` bigint(11)
,`action24` bigint(11)
,`action25` bigint(11)
,`action26` bigint(11)
,`action27` bigint(11)
,`action28` bigint(11)
,`action29` bigint(11)
,`action30` bigint(11)
,`action31` bigint(11)
,`action32` bigint(11)
,`action33` bigint(11)
,`action34` bigint(11)
,`pk_schedule` int(11)
,`cancelled` enum('1','0')
,`jobType` int(3)
,`timeStart` time
,`pk_plumber` int(11)
,`ActionName` varchar(30)
,`sheduleDate` date
,`pname` varchar(50)
,`plumberRank` int(3)
,`fk_plumberType` int(3)
,`typeName` varchar(30)
,`rank` int(3)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_client_add`
--
CREATE TABLE IF NOT EXISTS `view_client_add` (
`pk_client` int(11)
,`jbClaimNo` varchar(255)
,`jbRefVal` varchar(255)
,`clDateJoin` date
,`clSurname` varchar(50)
,`clTel1` varchar(13)
,`clTel2` varchar(13)
,`clTel3` varchar(13)
,`clName` varchar(50)
,`clPostal` varchar(255)
,`suburb` varchar(50)
,`town` varchar(50)
,`jbdate` datetime
,`pk_job` int(11)
,`clEmail` varchar(255)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_diarynotes`
--
CREATE TABLE IF NOT EXISTS `view_diarynotes` (
`pk_job` int(11)
,`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`pk_notes` int(11)
,`userInCharge` int(11)
,`pk_appType` int(11)
,`typeName` varchar(255)
,`followUpDate` date
,`fk_client` int(11)
,`noteType` int(11)
,`complete` enum('0','1')
,`followtime` time
,`fkUType` int(1)
,`finuInCharge` int(11)
,`noteFor` int(2)
,`tracknote` int(11)
,`alarmTime` int(3)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_diaryplumber`
--
CREATE TABLE IF NOT EXISTS `view_diaryplumber` (
`pk_job` int(11)
,`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`userInCharge` int(11)
,`fk_client` int(11)
,`pk_schedule` int(11)
,`sheduleDate` date
,`cancelled` enum('1','0')
,`jobDone` int(1)
,`timeStart` time
,`jobType` int(3)
,`fk_plumber` int(11)
,`pk_plumber` int(11)
,`pname` varchar(50)
,`ptel` varchar(255)
,`snooze` int(1)
,`pkaction` int(11)
,`ActionName` varchar(30)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_finoutstanding_report`
--
CREATE TABLE IF NOT EXISTS `view_finoutstanding_report` (
`jbdate` datetime
,`fk_insurer` int(11)
,`finuInCharge` int(11)
,`insName` varchar(255)
,`pk_insurer` int(11)
,`fkInvoiced` int(1)
,`fkInvoice1` int(1)
,`jbClaimNo` varchar(255)
,`userName` varchar(255)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_jobcardreport`
--
CREATE TABLE IF NOT EXISTS `view_jobcardreport` (
`pname` varchar(50)
,`pk_plumber` int(11)
,`pk_job` int(11)
,`fk_client` int(11)
,`pk_schedule` int(11)
,`sheduleDate` date
,`timeStart` time
,`timeFinish` time
,`cancelled` enum('1','0')
,`jobdescription` longtext
,`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`clTel1` varchar(13)
,`clTel2` varchar(13)
,`clPostal` varchar(255)
,`fk_postal` int(11)
,`pk_postal` int(11)
,`suburb` varchar(50)
,`postalcd` int(11)
,`clTel3` varchar(13)
,`clEmail` varchar(255)
,`town` varchar(50)
,`clNotes` longtext
,`jbClaimNo` varchar(255)
,`fk_insurer` int(11)
,`pk_insurer` int(11)
,`insName` varchar(255)
,`excessVal` decimal(10,2)
,`cancelReason` longtext
,`jobType` int(3)
,`pkaction` int(11)
,`ActionName` varchar(30)
,`jobCat` int(2)
,`pk_jtype` int(11)
,`tName` varchar(255)
,`tNameShort` varchar(5)
,`excessInfo` varchar(100)
,`limitVal` decimal(10,2)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_monthly job breakdown`
--
CREATE TABLE IF NOT EXISTS `view_monthly job breakdown` (
`jbdate` datetime
,`fk_insurer` int(11)
,`jbClaimNo` varchar(255)
,`pk_insurer` int(11)
,`insName` varchar(255)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_notes`
--
CREATE TABLE IF NOT EXISTS `view_notes` (
`pk_job` int(11)
,`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`fk_client` int(11)
,`pk_notes` int(11)
,`noteUser` int(11)
,`dateCap` datetime
,`Note` longtext
,`noteHide` int(11)
,`fk_job` int(11)
,`UserEdit` int(11)
,`EditDate` datetime
,`followUpDate` date
,`noteType` int(11)
,`completeNote` longtext
,`complete` enum('0','1')
,`pk_appType` int(11)
,`typeName` varchar(255)
,`pk_user` int(11)
,`userName` varchar(255)
,`completeDate` datetime
,`completeUser` int(11)
,`pk_user2` int(11)
,`userName2` varchar(255)
,`clTel1` varchar(13)
,`clTel2` varchar(13)
,`clPostal` varchar(255)
,`clPostalcd` int(4)
,`pk_insurer` int(11)
,`insName` varchar(255)
,`fk_insurer` int(11)
,`jbRefVal` varchar(255)
,`jbClaimNo` varchar(255)
,`pk_other_ref` int(11)
,`ref_name` varchar(30)
,`excessVal` decimal(10,2)
,`followtime` time
,`noteFor` int(2)
,`pkNotefor` int(11)
,`userNotefor` varchar(255)
,`tracknote` int(11)
,`clEmail` varchar(255)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_overview`
--
CREATE TABLE IF NOT EXISTS `view_overview` (
`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`pk_job` int(11)
,`jbdate` datetime
,`fkInspection` int(1)
,`fkLeakDetection` int(1)
,`fkJobDone` int(1)
,`fkInsApproval` int(1)
,`fkExcessDelay` int(1)
,`fkInvoiced` int(1)
,`userInCharge` int(11)
,`pk_user` int(11)
,`userName` varchar(255)
,`fkReportSent` int(1)
,`jbClaimNo` varchar(255)
,`fkExcessGet` int(1)
,`fkquote` int(1)
,`fkproofpay` int(1)
,`fkInvoice1` int(1)
,`fkReportFinal` int(1)
,`fkbluecard` int(1)
,`finuInCharge` int(11)
,`pkuser2` int(11)
,`finUsername` varchar(255)
,`jobCat` int(2)
,`fkCloseFile` int(1)
,`sheduleDate` date
,`finDelay` int(1)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_plumberlocation`
--
CREATE TABLE IF NOT EXISTS `view_plumberlocation` (
`pk_schedule` int(11)
,`sheduleDate` date
,`fk_plumber` int(11)
,`snooze` int(1)
,`snoozeTime` time
,`pname` varchar(50)
,`suburb` varchar(50)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_quote1`
--
CREATE TABLE IF NOT EXISTS `view_quote1` (
`pk_quote` int(11)
,`fk_job` int(11)
,`pk_quoteItem` int(11)
,`fk_quote` int(11)
,`price` decimal(10,2)
,`addDate` date
,`quantity` decimal(10,2)
,`qdescription` varchar(255)
,`Description1` varchar(100)
,`category` varchar(100)
,`qDateAdd` datetime
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_quote_info`
--
CREATE TABLE IF NOT EXISTS `view_quote_info` (
`pk_quote` int(11)
,`fk_job` int(11)
,`pk_quoteItem` int(11)
,`fk_quote` int(11)
,`price` decimal(10,2)
,`addDate` date
,`quantity` decimal(10,2)
,`qdescription` varchar(255)
,`Description1` varchar(100)
,`jbClaimNo` varchar(255)
,`clSurname` varchar(50)
,`clName` varchar(50)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_schedule`
--
CREATE TABLE IF NOT EXISTS `view_schedule` (
`pk_job` int(11)
,`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`fk_client` int(11)
,`pk_schedule` int(11)
,`sheduleDate` date
,`capDate` datetime
,`capUser` int(11)
,`fk_plumber` int(11)
,`jobdescription` longtext
,`cancellTime` datetime
,`cancelled` enum('1','0')
,`cancelReason` longtext
,`cancelluser` int(11)
,`jobType` int(3)
,`jobDoneInfo` longtext
,`jobDone` int(1)
,`jobDoneUser` int(11)
,`jobDoneTime` datetime
,`isActive` enum('0','1')
,`timeStart` time
,`timeFinish` time
,`myrand1` varchar(255)
,`fk_job` int(11)
,`pk_plumber` int(11)
,`pname` varchar(50)
,`ptel` varchar(255)
,`jbClaimNo` varchar(255)
,`excessVal` decimal(10,2)
,`fk_insurer` int(11)
,`pk_insurer` int(11)
,`insName` varchar(255)
,`fk_postal` int(11)
,`clPostal` varchar(255)
,`clTel1` varchar(13)
,`clTel2` varchar(13)
,`clTel3` varchar(13)
,`snooze` int(1)
,`t0` int(1)
,`t1` int(1)
,`t2` int(1)
,`t3` int(1)
,`t4` int(1)
,`t5` int(1)
,`t6` int(1)
,`t7` int(1)
,`t8` int(1)
,`t9` int(1)
,`t10` int(1)
,`t11` int(1)
,`t12` int(1)
,`t13` int(1)
,`t14` int(1)
,`t15` int(1)
,`t16` int(1)
,`t17` int(1)
,`t18` int(1)
,`t19` int(1)
,`t20` int(1)
,`t21` int(1)
,`t22` int(1)
,`t23` int(1)
,`t24` int(1)
,`t25` int(1)
,`t26` int(1)
,`t27` int(1)
,`t28` int(1)
,`t29` int(1)
,`t30` int(1)
,`t31` int(1)
,`t32` int(1)
,`t33` int(1)
,`t34` int(1)
,`userInCharge` int(11)
,`fkInspection` int(1)
,`ActionName` varchar(30)
,`pkaction` int(11)
,`jobCat` int(2)
,`pk_jtype` int(11)
,`tName` varchar(255)
,`tNameShort` varchar(5)
,`ActionShort` varchar(5)
,`jbRefVal` varchar(255)
,`plumberRank` int(3)
,`fk_plumberType` int(3)
,`typeName` varchar(30)
,`pk_plumberType` int(11)
,`rank` int(3)
,`specifictime` int(1)
,`excessInfo` varchar(100)
,`limitVal` decimal(10,2)
,`salessms` int(1)
,`userName` varchar(255)
,`pk_user` int(11)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_schedule_print`
--
CREATE TABLE IF NOT EXISTS `view_schedule_print` (
`pk_job` int(11)
,`pk_client` int(11)
,`clSurname` varchar(50)
,`clName` varchar(50)
,`fk_client` int(11)
,`pk_schedule` int(11)
,`sheduleDate` date
,`capDate` datetime
,`capUser` int(11)
,`fk_plumber` int(11)
,`jobdescription` longtext
,`cancellTime` datetime
,`cancelled` enum('1','0')
,`cancelReason` longtext
,`cancelluser` int(11)
,`jobType` int(3)
,`jobDoneInfo` longtext
,`jobDone` int(1)
,`jobDoneUser` int(11)
,`jobDoneTime` datetime
,`isActive` enum('0','1')
,`timeStart` time
,`timeFinish` time
,`myrand1` varchar(255)
,`fk_job` int(11)
,`pk_plumber` int(11)
,`pname` varchar(50)
,`ptel` varchar(255)
,`clTel1` varchar(13)
,`clTel2` varchar(13)
,`clPostal` varchar(255)
,`clPostalcd` int(4)
,`jbClaimNo` varchar(255)
,`jbRefVal` varchar(255)
,`pk_other_ref` int(11)
,`ref_name` varchar(30)
,`fk_other_ref` int(11)
,`pk_insurer` int(11)
,`insName` varchar(255)
,`fk_insurer` int(11)
,`pkaction` int(11)
,`ActionName` varchar(30)
,`ActionShort` varchar(5)
,`pk_jtype` int(11)
,`tName` varchar(255)
,`tNameShort` varchar(5)
,`jobCat` int(2)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_schedule_taken`
--
CREATE TABLE IF NOT EXISTS `view_schedule_taken` (
`sheduleDate` date
,`jobDone` int(1)
,`isActive` enum('0','1')
,`pk_plumber` int(11)
,`t1` int(1)
,`jbinfo` varchar(372)
,`t2` int(1)
,`t3` int(1)
,`t4` int(1)
,`t5` int(1)
,`t6` int(1)
,`t7` int(1)
,`t8` int(1)
,`cancelled` enum('1','0')
,`pname` varchar(50)
,`t9` int(1)
,`t10` int(1)
,`t11` int(1)
,`t12` int(1)
,`t13` int(1)
,`t14` int(1)
,`t15` int(1)
,`t16` int(1)
,`t17` int(1)
,`t18` int(1)
,`t19` int(1)
,`t20` int(1)
,`t21` int(1)
,`t22` int(1)
,`t23` int(1)
,`t24` int(1)
,`t25` int(1)
,`t26` int(1)
,`t27` int(1)
,`t28` int(1)
,`t29` int(1)
,`t30` int(1)
,`t31` int(1)
,`t32` int(1)
,`t33` int(1)
,`t34` int(1)
,`t0` int(1)
,`snooze` int(1)
,`pk_schedule` int(11)
,`jobType` int(3)
,`fk_postal` int(11)
,`suburb` varchar(50)
,`pk_postal` int(11)
,`timeStart` time
,`pk_job` int(11)
,`ActionName` varchar(30)
,`pkaction` int(11)
,`tName` varchar(255)
,`tNameShort` varchar(5)
,`ActionShort` varchar(5)
,`jobCat` int(2)
,`plumberRank` int(3)
,`fk_plumberType` int(3)
,`typeName` varchar(30)
,`rank` int(3)
,`specifictime` int(1)
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_solar_fincheck`
--
CREATE TABLE IF NOT EXISTS `view_solar_fincheck` (
`id` int(11)
,`clid` varchar(3)
,`clutility` varchar(3)
,`problemJob` varchar(3)
,`signquote` varchar(3)
,`proofpay` varchar(3)
,`fk_job` int(11)
,`jbClaimNo` varchar(255)
,`datecap` date
);
-- --------------------------------------------------------

--
-- Stand-in structure for view `view_solar_rebate`
--
CREATE TABLE IF NOT EXISTS `view_solar_rebate` (
`jbClaimNo` varchar(255)
,`jobgo` varchar(3)
,`eskomdocs` varchar(3)
,`eskomrebate` varchar(3)
,`datecap` date
);
-- --------------------------------------------------------

--
-- Table structure for table `werd`
--

CREATE TABLE IF NOT EXISTS `werd` (
  `ID` int(11) NOT NULL auto_increment,
  `UserAdd` int(255) default NULL,
  `UserEdit` int(255) default NULL,
  `DateAdded` date default NULL,
  `DateEdited` date default NULL,
  `fk_job` int(255) NOT NULL,
  `fk_plumber` int(255) NOT NULL,
  `rndm5` varchar(30) NOT NULL,
  `Serial` varchar(30) NOT NULL,
  `Is0254` varchar(3) NOT NULL,
  `Is0254Reason` varchar(3) default NULL,
  `GeyserPosition` varchar(30) NOT NULL,
  `GeyserLocation` varchar(30) NOT NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `randomchk` USING BTREE (`rndm5`),
  KEY `plumber` USING BTREE (`fk_plumber`),
  KEY `fkjob1` USING BTREE (`fk_job`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=265 ;

--
-- Dumping data for table `werd`
--

INSERT INTO `werd` (`ID`, `UserAdd`, `UserEdit`, `DateAdded`, `DateEdited`, `fk_job`, `fk_plumber`, `rndm5`, `Serial`, `Is0254`, `Is0254Reason`, `GeyserPosition`, `GeyserLocation`) VALUES
(1, 27, 0, '2016-08-07', NULL, 96922, 60, '0f6u20160807215048', '13456', 'No', 'asd', 'Horisontal', 'Bathroom - Ensuite'),
(2, 27, NULL, '2016-08-10', NULL, 98413, 79, '0xax20160810150720', '517116', 'Yes', NULL, 'Horisontal', 'Passage'),
(3, 27, NULL, '2016-08-11', NULL, 98408, 79, '0gq320160811131611', '517116', 'Yes', NULL, 'Horisontal', 'Passage'),
(4, 27, NULL, '2016-08-12', NULL, 98529, 3, '0swp20160812150333', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(5, 27, NULL, '2016-08-15', NULL, 98638, 79, '0j1t20160815115707', '00000', 'Yes', NULL, 'Horisontal', 'Passage'),
(6, 27, NULL, '2016-08-15', NULL, 98640, 79, '0qrp20160815144027', '5/8/16', 'Yes', NULL, 'Horisontal', 'Passage'),
(7, 27, NULL, '2016-08-26', NULL, 98877, 3, '0vxm20160826175548', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(8, 27, NULL, '2016-08-29', NULL, 98909, 3, '0mqz20160829123535', 'None ', 'Yes', NULL, 'Vertical', 'Bedroom - Main'),
(9, 27, NULL, '2016-09-05', NULL, 99243, 79, '0a9u20160905114216', '00000 ', 'Yes', NULL, 'Horisontal', 'Passage'),
(10, 27, NULL, '2016-09-07', NULL, 99332, 3, '0kh320160907113533', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(11, 27, NULL, '2016-09-07', NULL, 99337, 3, '04xw20160907142548', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(12, 27, NULL, '2016-09-08', NULL, 99343, 3, '0b6420160908110326', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(13, 27, NULL, '2016-09-19', NULL, 99679, 124, '0jo20160919112109', 'WD001', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(14, 27, NULL, '2016-09-19', NULL, 99680, 124, '0do920160919131727', 'do not see serial number', 'Yes', NULL, 'Horisontal', 'Diningroom'),
(15, 27, NULL, '2016-09-20', NULL, 99688, 124, '0sk20160920061423', 'no serial', 'Yes', NULL, 'Horisontal', 'Passage'),
(16, 27, NULL, '2016-09-20', NULL, 99689, 124, '0gao20160920062034', 'no serial no', 'Yes', NULL, 'Horisontal', 'Passage'),
(17, 27, NULL, '2016-09-20', NULL, 99578, 124, '0pjg20160920131301', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(18, 27, NULL, '2016-09-21', NULL, 99700, 124, '0tr20160921072651', 'none', 'Yes', NULL, 'Vertical', 'Passage'),
(19, 27, NULL, '2016-09-21', NULL, 99777, 117, '06vd20160921192656', 'WD001', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(20, 27, NULL, '2016-09-22', NULL, 99711, 124, '0j6120160922064326', 'none', 'Yes', NULL, 'Horisontal', 'Bedroom - Second'),
(21, 27, NULL, '2016-09-22', NULL, 99713, 124, '0mtr20160922064625', 'none', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(22, 27, NULL, '2016-09-22', NULL, 99707, 124, '04a920160922134110', 'none', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(23, 27, NULL, '2016-09-23', NULL, 99839, 124, '0enj20160923055133', 'no serial', 'Yes', NULL, 'Horisontal', 'Passage'),
(24, 27, NULL, '2016-09-23', NULL, 99791, 124, '0jch20160923065206', 'no serial', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(25, 27, NULL, '2016-09-23', NULL, 99716, 124, '0q3620160923083300', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(26, 27, NULL, '2016-09-23', NULL, 99765, 124, '0xp20160923112020', 'none', 'Yes', NULL, 'Vertical', 'Bathroom - Guest toilet'),
(27, 27, NULL, '2016-09-26', NULL, 99702, 124, '0aoy20160926053222', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(28, 27, NULL, '2016-09-26', NULL, 99728, 124, '0y4t20160926053438', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(29, 27, NULL, '2016-09-26', NULL, 99689, 114, '0zoh20160926102425', '000', 'Yes', NULL, 'Horisontal', 'Passage'),
(30, 27, NULL, '2016-09-26', NULL, 99708, 124, '0v6w20160926132657', 'none', 'Yes', NULL, 'Horisontal', 'Lounge'),
(31, 27, NULL, '2016-09-26', NULL, 99717, 124, '0q7x20160926132914', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(32, 27, NULL, '2016-09-27', NULL, 99732, 124, '05gh20160927053827', 'none', 'Yes', NULL, 'Horisontal', 'Lounge'),
(33, 27, NULL, '2016-09-27', NULL, 99743, 124, '05f20160927054111', 'none', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(34, 27, NULL, '2016-09-27', NULL, 99697, 124, '09o20160927142406', 'none', 'Yes', NULL, 'Vertical', 'Passage'),
(35, 27, NULL, '2016-09-27', NULL, 99689, 114, '0vp20160927211351', '000', 'Yes', NULL, 'Horisontal', 'Passage'),
(36, 27, NULL, '2016-09-28', NULL, 99708, 124, '0ep20160928071501', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(37, 27, NULL, '2016-09-28', NULL, 99792, 3, '08m420160928111029', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(38, 27, NULL, '2016-09-30', NULL, 99724, 3, '02uc20160930114257', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(39, 27, NULL, '2016-10-04', NULL, 99334, 124, '0cg420161004124242', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Second'),
(40, 27, NULL, '2016-10-04', NULL, 99775, 125, '0wqw20161004142016', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(41, 27, NULL, '2016-10-05', NULL, 100181, 127, '0rch20161005124851', 'WD001', 'Yes', NULL, 'Horisontal', 'Passage'),
(42, 27, NULL, '2016-10-05', NULL, 100134, 127, '0hvp20161005154105', 'WD001 ', 'Yes', NULL, 'Horisontal', 'Passage'),
(43, 27, NULL, '2016-10-05', NULL, 99775, 125, '05px20161005184351', '121/ 122/ 123', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(44, 27, NULL, '2016-10-07', NULL, 100276, 125, '0r2520161007121218', 'none', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(45, 27, NULL, '2016-10-10', NULL, 99738, 124, '09xa20161010055030', 'none', 'Yes', NULL, 'Vertical', 'Bedroom - Main'),
(46, 27, NULL, '2016-10-10', NULL, 100208, 124, '0zym20161010055430', 'none', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(47, 27, NULL, '2016-10-11', NULL, 100294, 127, '0vs520161011130252', 'WD001 ', 'Yes', NULL, 'Horisontal', 'Passage'),
(48, 27, NULL, '2016-10-11', NULL, 99691, 127, '0nr520161011143732', 'WD001 ', 'Yes', NULL, 'Horisontal', 'Passage'),
(49, 27, NULL, '2016-10-11', NULL, 100201, 124, '085m20161011175335', 'none', 'No', 'sto', 'Horisontal', 'Bathroom - Main'),
(50, 27, NULL, '2016-10-11', NULL, 100201, 125, '0q7d20161011174239', 'none', 'Yes', NULL, 'Horisontal', 'Bedroom - Second'),
(51, 27, NULL, '2016-10-13', NULL, 99740, 124, '0vw320161013055859', 'none ', 'Yes', NULL, 'Horisontal', 'Passage'),
(52, 27, NULL, '2016-10-13', NULL, 100366, 127, '0rdk20161013145416', 'WD001 ', 'Yes', NULL, 'Horisontal', 'Study'),
(53, 27, NULL, '2016-10-14', NULL, 99731, 125, '0nk20161014112617', 'none', 'No', 'tpv', 'Horisontal', 'Kitchen'),
(54, 27, NULL, '2016-10-17', NULL, 99790, 124, '0jmq20161017042756', 'none', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(55, 27, NULL, '2016-10-17', NULL, 100212, 124, '0bah20161017043205', 'none', 'Yes', NULL, 'Horisontal', 'Outside'),
(56, 27, NULL, '2016-10-17', NULL, 99788, 124, '0esv20161017115757', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(57, 27, NULL, '2016-10-19', NULL, 99742, 124, '04nh20161019155530', 'none', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(58, 27, NULL, '2016-10-19', NULL, 100532, 124, '0pz920161019155911', 'none', 'Yes', NULL, 'Vertical', 'Bedroom - Main'),
(59, 27, NULL, '2016-10-20', NULL, 99713, 3, '08fg20161020103106', 'None ', 'No', 'V b', 'Horisontal', 'Passage'),
(60, 27, NULL, '2016-10-20', NULL, 100581, 3, '0v8j20161020141616', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(61, 27, NULL, '2016-10-20', NULL, 99788, 124, '03se20161020173731', 'none', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(62, 27, NULL, '2016-10-27', NULL, 100750, 125, '07gt20161027110351', 'none', 'Yes', NULL, 'Horisontal', 'Passage'),
(63, 27, NULL, '2016-10-27', NULL, 100752, 125, '06j520161027122634', 'none', 'Yes', NULL, 'Horisontal', 'Lounge'),
(64, 27, NULL, '2016-10-29', NULL, 100752, 79, '0r8g20161029120848', '000000', 'Yes', NULL, 'Horisontal', 'Lounge'),
(65, 27, NULL, '2016-10-31', NULL, 100704, 124, '0war20161031054859', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(66, 27, NULL, '2016-11-01', NULL, 100705, 3, '0x2g20161101130407', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(67, 27, NULL, '2016-11-03', NULL, 100930, 127, '0o4v20161103125358', 'WD001', 'Yes', NULL, 'Vertical', 'Passage'),
(68, 27, NULL, '2016-11-04', NULL, 100876, 3, '01hx20161104105415', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(69, 27, NULL, '2016-11-04', NULL, 100873, 3, '02e20161104125026', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(70, 27, NULL, '2016-11-10', NULL, 99852, 3, '0usa20161110113445', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(71, 27, NULL, '2016-11-14', NULL, 100426, 124, '0mp920161114123024', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(72, 27, NULL, '2016-11-14', NULL, 101120, 124, '0fsm20161114185351', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(73, 27, NULL, '2016-11-14', NULL, 100201, 124, '06q20161114185605', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Second'),
(74, 27, NULL, '2016-11-17', NULL, 100201, 124, '0ydv20161117144423', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(75, 27, NULL, '2016-11-18', NULL, 101294, 124, '0wpe20161118132510', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(76, 27, NULL, '2016-11-24', NULL, 101519, 117, '0mau20161124140306', '001', 'Yes', NULL, 'Horisontal', 'Passage'),
(77, 27, NULL, '2016-11-24', NULL, 101519, 117, '05zq20161124141306', '001', 'Yes', NULL, 'Vertical', 'Passage'),
(78, 27, NULL, '2016-12-05', NULL, 101717, 124, '0znz20161205134811', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(79, 27, NULL, '2016-12-05', NULL, 101719, 124, '0xmr20161205143547', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(80, 27, NULL, '2016-12-05', NULL, 101723, 124, '0n220161205152053', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(81, 27, NULL, '2016-12-06', NULL, 101716, 124, '0e1120161206052718', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(82, 27, NULL, '2016-12-06', NULL, 101724, 124, '0p6s20161206110347', 'I00017', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(83, 27, NULL, '2016-12-06', NULL, 101718, 124, '02et20161206114613', 'I00016', 'Yes', NULL, 'Horisontal', 'Garrage'),
(84, 27, NULL, '2016-12-06', NULL, 101720, 124, '08ym20161206143816', 'I00018', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(85, 27, NULL, '2016-12-06', NULL, 101721, 124, '05ne20161206144155', 'I00015', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(86, 27, NULL, '2016-12-06', NULL, 101722, 124, '0vgf20161206154750', 'I00019', 'Yes', NULL, 'Horisontal', 'Garrage'),
(87, 27, NULL, '2016-12-08', NULL, 97218, 124, '0o9620161208053750', 'None ', 'Yes', NULL, 'Vertical', 'Other'),
(88, 27, NULL, '2016-12-09', NULL, 97218, 124, '0dyb20161209055858', 'None ', 'Yes', NULL, 'Vertical', 'Other'),
(89, 27, NULL, '2016-12-12', NULL, 101738, 125, '0ejh20161212124156', 'I00008', 'Yes', NULL, 'Horisontal', 'Passage'),
(90, 27, NULL, '2016-12-13', NULL, 97218, 124, '028f20161213130831', 'None ', 'Yes', NULL, 'Vertical', 'Other'),
(91, 27, NULL, '2016-12-19', NULL, 102052, 124, '0p9e20161219160428', 'I00012', 'Yes', NULL, 'Horisontal', 'Passage'),
(92, 27, NULL, '2016-12-21', NULL, 102074, 124, '0ez20161221052919', 'I00015', 'Yes', NULL, 'Vertical', 'Passage'),
(93, 27, NULL, '2016-12-23', NULL, 102261, 124, '0z320161223131834', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(94, 27, NULL, '2016-12-24', NULL, 102279, 124, '0m7m20161224185622', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(95, 27, NULL, '2017-01-17', NULL, 101715, 124, '0t3j20170117144418', '00009', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(96, 27, NULL, '2017-01-23', NULL, 101718, 124, '0zr720170123144525', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(97, 27, NULL, '2017-01-23', NULL, 97384, 124, '0o320170123162757', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(98, 27, NULL, '2017-01-24', NULL, 101721, 124, '0pkx20170124053702', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(99, 27, NULL, '2017-01-24', NULL, 101719, 124, '0w7r20170124053900', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(100, 27, NULL, '2017-01-24', NULL, 101716, 124, '04kj20170124054116', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(101, 27, NULL, '2017-01-24', NULL, 101723, 124, '0gt20170124054244', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(102, 27, NULL, '2017-01-24', NULL, 101717, 124, '0uox20170124054509', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(103, 27, NULL, '2017-01-24', NULL, 101722, 124, '0zk20170124054619', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(104, 27, NULL, '2017-01-24', NULL, 101720, 124, '0fym20170124054746', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(105, 27, NULL, '2017-01-24', NULL, 103084, 124, '0hvz20170124135649', 'None ', 'Yes', NULL, 'Horisontal', 'Scullery'),
(106, 27, NULL, '2017-01-25', NULL, 103015, 124, '04r20170125053044', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(107, 27, NULL, '2017-01-28', NULL, 103254, 124, '0obt20170128065032', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(108, 27, NULL, '2017-01-31', NULL, 101648, 124, '0cy20170131131515', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(109, 27, NULL, '2017-02-01', NULL, 101650, 124, '0x2c20170201063353', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(110, 27, NULL, '2017-02-05', NULL, 103384, 124, '0r8c20170205064436', 'None ', 'Yes', NULL, 'Horisontal', 'Diningroom'),
(111, 27, NULL, '2017-02-07', NULL, 101120, 124, '042t20170207162607', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(112, 27, NULL, '2017-02-08', NULL, 101120, 124, '077v20170208105608', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(113, 27, NULL, '2017-02-09', NULL, 103538, 124, '02oa20170209054524', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(114, 27, NULL, '2017-02-09', NULL, 103531, 124, '0ef120170209054618', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(115, 27, NULL, '2017-02-09', NULL, 103532, 124, '0e1220170209054707', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(116, 27, NULL, '2017-02-09', NULL, 103533, 124, '0tav20170209054804', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(117, 27, NULL, '2017-02-09', NULL, 103534, 124, '07u120170209054851', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(118, 27, NULL, '2017-02-09', NULL, 103535, 124, '076p20170209054921', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(119, 27, NULL, '2017-02-09', NULL, 103536, 124, '0u8e20170209054953', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(120, 27, NULL, '2017-02-09', NULL, 103537, 124, '0oz620170209055025', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(121, 27, NULL, '2017-02-09', NULL, 103539, 124, '08x820170209055059', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(122, 27, NULL, '2017-02-09', NULL, 103541, 124, '0oex20170209055136', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(123, 27, NULL, '2017-02-09', NULL, 103599, 127, '0m5b20170209090112', 'None', 'Yes', NULL, 'Horisontal', 'Lounge'),
(124, 27, NULL, '2017-02-10', NULL, 103449, 124, '0k8n20170210043257', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(125, 27, NULL, '2017-02-10', NULL, 103622, 124, '0go20170210105446', 'None ', 'No', 'We ', 'Horisontal', 'Other'),
(126, 27, NULL, '2017-02-13', NULL, 101648, 3, '0v2120170213141659', 'No', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(127, 27, NULL, '2017-02-15', NULL, 103542, 79, '0jh20170215133637', '00000', 'Yes', NULL, 'Horisontal', 'Passage'),
(128, 27, NULL, '2017-03-09', NULL, 104027, 124, '0gcy20170309054726', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(129, 27, NULL, '2017-03-17', NULL, 104415, 127, '0yqh20170317053453', 'None ', 'Yes', NULL, 'Vertical', 'Other'),
(130, 27, NULL, '2017-03-17', NULL, 104468, 3, '0k7q20170317113918', 'None', 'Yes', NULL, 'Vertical', 'Passage'),
(131, 27, NULL, '2017-03-24', NULL, 104587, 124, '04z920170324052311', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(132, 27, NULL, '2017-03-30', NULL, 104529, 124, '0szt20170330055443', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(133, 27, NULL, '2017-03-30', NULL, 104675, 124, '0b5820170330055716', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(134, 27, NULL, '2017-03-31', NULL, 103447, 127, '0ahu20170331170613', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(135, 27, NULL, '2017-04-03', NULL, 104587, 79, '0ew220170403110016', '00000', 'Yes', NULL, 'Horisontal', 'Passage'),
(136, 27, NULL, '2017-04-03', NULL, 104675, 79, '0tyt20170403123659', '00000', 'Yes', NULL, 'Horisontal', 'Garrage'),
(137, 27, NULL, '2017-04-04', NULL, 104675, 124, '0skr20170404053337', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(138, 27, NULL, '2017-04-04', NULL, 104538, 3, '0r4v20170404123624', 'None', 'Yes', NULL, 'Vertical', 'Bathroom - Ensuite'),
(139, 27, NULL, '2017-04-07', NULL, 104928, 124, '04m820170407065742', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(140, 27, NULL, '2017-04-08', NULL, 104675, 5, '0oo20170408095636', 'None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(141, 27, NULL, '2017-04-25', NULL, 104675, 124, '026n20170425060921', 'None None ', 'Yes', NULL, 'Horisontal', 'Garrage'),
(142, 27, NULL, '2017-04-25', NULL, 105302, 124, '0oxz20170425062056', 'None ', 'Yes', NULL, 'Vertical', 'Bathroom - Main'),
(143, 27, NULL, '2017-04-28', NULL, 105302, 124, '0e3a20170428055304', 'None ', 'Yes', NULL, 'Vertical', 'Bathroom - Ensuite'),
(144, 27, NULL, '2017-05-03', NULL, 105302, 124, '0yhb20170503075456', 'None ', 'Yes', NULL, 'Vertical', 'Bedroom - Main'),
(145, 27, NULL, '2017-05-05', NULL, 105302, 3, '0k5s20170505150330', 'None ', 'Yes', NULL, 'Vertical', 'Scullery'),
(146, 27, NULL, '2017-05-13', NULL, 104587, 3, '0szv20170513125441', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(147, 27, NULL, '2017-05-16', NULL, 105302, 127, '0nea20170516200655', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(148, 27, NULL, '2017-05-17', NULL, 105904, 127, '0tu720170517123225', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(149, 27, NULL, '2017-05-25', NULL, 105972, 3, '0bda20170525151548', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(150, 27, NULL, '2017-05-26', NULL, 106077, 3, '0h6p20170526103755', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(151, 27, NULL, '2017-05-26', NULL, 106079, 3, '067420170526123006', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(152, 27, NULL, '2017-05-31', NULL, 106208, 127, '0st20170531132611', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(153, 27, NULL, '2017-06-01', NULL, 105302, 3, '0a3g20170601165009', 'None', 'Yes', NULL, 'Vertical', 'Scullery'),
(154, 27, NULL, '2017-06-07', NULL, 106384, 3, '0nxx20170607110821', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(155, 27, NULL, '2017-06-08', NULL, 106425, 127, '0k6820170608052126', '00091', 'Yes', NULL, 'Horisontal', 'Passage'),
(156, 27, NULL, '2017-06-08', NULL, 106421, 127, '071120170608052804', '00092', 'Yes', NULL, 'Vertical', 'Passage'),
(157, 27, NULL, '2017-06-08', NULL, 106455, 3, '0pw320170608130126', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(158, 27, NULL, '2017-06-23', NULL, 106147, 3, '0nja20170623103949', 'None', 'Yes', NULL, 'Vertical', 'Bathroom - Main'),
(159, 27, NULL, '2017-06-29', NULL, 106992, 3, '0s9j20170629104837', 'None', 'Yes', NULL, 'Vertical', 'Bedroom - Main'),
(160, 27, NULL, '2017-07-05', NULL, 107142, 127, '065o20170705121552', 'I00108', 'Yes', NULL, 'Horisontal', 'Passage'),
(161, 27, NULL, '2017-07-13', NULL, 104529, 127, '0anj20170713173330', 'None', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(162, 27, NULL, '2017-09-11', NULL, 108680, 3, '0a1n20170911213418', 'None', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(163, 27, NULL, '2017-09-20', NULL, 108886, 3, '0z6o20170920165128', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(164, 27, NULL, '2017-09-21', NULL, 108890, 3, '0k2h20170921111141', 'None ', 'Yes', NULL, 'Vertical', 'Kitchen'),
(165, 27, NULL, '2017-09-21', NULL, 108891, 3, '036420170921131517', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(166, 27, NULL, '2017-09-27', NULL, 108844, 3, '06tx20170927142130', 'None', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(167, 27, NULL, '2017-09-28', NULL, 106572, 117, '0dvq20170928162814', 'None ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(168, 27, NULL, '2017-10-19', NULL, 109485, 117, '0vr820171019142123', 'None ', 'Yes', NULL, 'Vertical', 'Bedroom - Main'),
(169, 27, NULL, '2017-10-19', NULL, 109484, 117, '0thz20171019142548', 'None ', 'Yes', NULL, 'Vertical', 'Bathroom - Main'),
(170, 27, NULL, '2017-10-19', NULL, 109483, 117, '093m20171019163156', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(171, 27, NULL, '2017-11-02', NULL, 109775, 3, '0tnu20171102151128', 'None', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(172, 27, NULL, '2017-11-07', NULL, 109892, 117, '0w2f20171107172522', 'I.000160', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(173, 27, NULL, '2017-11-14', NULL, 109996, 3, '0t3420171114115508', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(174, 27, NULL, '2017-12-08', NULL, 110586, 3, '0suj20171208122012', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(175, 27, NULL, '2018-02-01', NULL, 111825, 3, '0xrq20180201170542', 'None ', 'Yes', NULL, 'Horisontal', 'Study'),
(176, 27, NULL, '2018-02-13', NULL, 112027, 3, '0q5o20180213113824', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(177, 27, NULL, '2018-02-13', NULL, 112031, 3, '0ko520180213132449', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(178, 27, NULL, '2018-02-16', NULL, 112138, 3, '0v1t20180216105121', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(179, 27, NULL, '2018-02-22', NULL, 112289, 3, '058g20180222105802', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(180, 27, NULL, '2018-03-02', NULL, 112339, 3, '0asj20180302173626', 'None', 'Yes', NULL, 'Vertical', 'Kitchen'),
(181, 27, NULL, '2018-03-19', NULL, 112901, 3, '0c9n20180319140543', 'None', 'Yes', NULL, 'Vertical', 'Kitchen'),
(182, 27, NULL, '2018-03-20', NULL, 112901, 4, '0a7x20180320144152', 'Ajdhdjajqk', 'Yes', NULL, 'Vertical', 'Passage'),
(183, 27, NULL, '2018-04-04', NULL, 113138, 3, '02y20180404123357', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(184, 27, NULL, '2018-04-10', NULL, 113300, 3, '0qa120180410111023', 'None ', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(185, 27, NULL, '2018-04-16', NULL, 112289, 3, '0mzd20180416100046', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(186, 27, NULL, '2018-04-17', NULL, 113497, 4, '0yec20180417122731', 'Xjajejs', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(187, 27, NULL, '2018-04-25', NULL, 113654, 3, '0pv720180425121254', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(188, 27, NULL, '2018-05-11', NULL, 114030, 3, '05c520180511142016', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(189, 27, NULL, '2018-05-23', NULL, 114308, 3, '0w9w20180523075151', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(190, 27, NULL, '2018-07-13', NULL, 115441, 128, '0dpe20180713165359', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(191, 27, NULL, '2018-07-24', NULL, 115739, 3, '0pcg20180724123115', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(192, 27, NULL, '2018-08-03', NULL, 115441, 3, '09tu20180803164632', 'None', 'Yes', NULL, 'Vertical', 'Passage'),
(193, 27, NULL, '2018-08-06', NULL, 115122, 3, '0wet20180806171927', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(194, 27, NULL, '2018-08-07', NULL, 115122, 3, '0an20180807172125', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(195, 27, NULL, '2018-08-08', NULL, 115122, 3, '0pqx20180808173040', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(196, 27, NULL, '2018-08-13', NULL, 115122, 3, '0r8b20180813175553', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(197, 27, NULL, '2018-08-14', NULL, 115122, 3, '02z720180814170952', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(198, 27, NULL, '2018-08-15', NULL, 115122, 3, '019y20180815172603', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(199, 27, NULL, '2018-08-17', NULL, 115122, 3, '0fp320180817153557', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(200, 27, NULL, '2018-08-21', NULL, 115122, 3, '0j5920180821175021', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(201, 27, NULL, '2018-08-21', NULL, 115122, 3, '0cg420180821175429', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(202, 27, NULL, '2018-08-23', NULL, 115122, 3, '0j1x20180823152455', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(203, 27, NULL, '2018-08-29', NULL, 116520, 3, '04dw20180829192615', 'None', 'Yes', NULL, 'Vertical', 'Passage'),
(204, 27, NULL, '2018-09-06', NULL, 116339, 79, '0e5220180906103629', '00000 ', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(205, 27, NULL, '2018-09-11', NULL, 116744, 3, '0q1r20180911163257', 'None ', 'Yes', NULL, 'Vertical', 'Kitchen'),
(206, 27, NULL, '2018-09-13', NULL, 116789, 137, '0wn420180913130738', 'Unknown ', 'No', 'No ', 'Horisontal', 'Passage'),
(207, 27, NULL, '2018-09-20', NULL, 116901, 3, '0yx220180920102241', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(208, 27, NULL, '2018-09-26', NULL, 116976, 3, '0kg520180926110302', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(209, 27, NULL, '2018-10-02', NULL, 116901, 4, '0y7120181002143557', 'Cjajaj', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(210, 27, NULL, '2018-10-03', NULL, 115122, 3, '0t4s20181003173628', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(211, 27, NULL, '2018-10-16', NULL, 117435, 3, '0rqg20181016175039', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(212, 27, NULL, '2018-10-19', NULL, 117485, 3, '03cg20181019111217', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(213, 27, NULL, '2018-10-26', NULL, 117629, 3, '0f3720181026133130', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(214, 27, NULL, '2018-10-30', NULL, 106615, 137, '09n420181030143005', 'None ', 'No', 'Non', 'Horisontal', 'Bedroom - Main'),
(215, 27, NULL, '2018-11-02', NULL, 117750, 3, '0u5c20181102133813', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(216, 27, NULL, '2018-11-12', NULL, 117796, 3, '0rx520181112142256', 'None', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(217, 27, NULL, '2018-11-24', NULL, 118202, 3, '0ms420181124140107', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(218, 27, NULL, '2018-11-28', NULL, 118270, 3, '0dru20181128142218', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(219, 27, NULL, '2018-12-10', NULL, 118469, 3, '0aba20181210111619', 'None', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(220, 27, NULL, '2018-12-10', NULL, 117713, 3, '0zq20181210122054', 'None', 'Yes', NULL, 'Vertical', 'Laundry room'),
(221, 27, NULL, '2018-12-10', NULL, 118479, 3, '01z620181210130609', 'None', 'Yes', NULL, 'Horisontal', 'Bedroom - Main'),
(222, 27, NULL, '2018-12-12', NULL, 118402, 3, '09oz20181212121554', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(223, 27, NULL, '2018-12-13', NULL, 115122, 3, '04x20181213154611', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(224, 27, NULL, '2018-12-18', NULL, 118270, 3, '0wcf20181218162836', 'None', 'Yes', NULL, 'Vertical', 'Bathroom - Guest toilet'),
(225, 27, NULL, '2018-12-21', NULL, 118735, 3, '0uj420181221150631', 'None', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(226, 27, NULL, '2019-01-10', NULL, 119117, 137, '0zs120190110152131', 'None', 'Yes', NULL, 'Horisontal', 'Bathroom - Main'),
(227, 27, NULL, '2019-02-01', NULL, 119587, 137, '0fc820190201113934', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(228, 27, NULL, '2019-02-06', NULL, 119117, 3, '019j20190206172935', 'None', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(229, 27, NULL, '2019-02-18', NULL, 115122, 3, '0tmu20190218164631', 'None', 'Yes', NULL, 'Horisontal', 'Passage'),
(230, 27, NULL, '2019-03-13', NULL, 120321, 79, '0tf320190313111515', '00000 ', 'Yes', NULL, 'Horisontal', 'Passage'),
(231, 27, NULL, '2019-05-31', NULL, 122109, 3, '0f3o20190531105837', 'No ', 'Yes', NULL, 'Horisontal', 'Passage'),
(232, 27, NULL, '2019-06-04', NULL, 105302, 3, '0w7n20190604150926', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(233, 27, NULL, '2019-06-04', NULL, 122108, 3, '07kv20190604160231', 'None ', 'Yes', NULL, 'Vertical', 'Outside'),
(234, 27, NULL, '2019-07-25', NULL, 123466, 3, '0ofp20190725142352', 'None', 'Yes', NULL, 'Horisontal', 'Kitchen'),
(235, 27, NULL, '2020-03-06', NULL, 129003, 138, '0mac20200306103556', 'None', 'No', 'Lag', 'Horisontal', 'Passage'),
(236, 27, NULL, '2020-03-19', NULL, 129290, 3, '06ws20200319120200', 'No', 'Yes', NULL, 'Horisontal', 'Passage'),
(237, 27, NULL, '2020-04-30', NULL, 130304, 3, '0mpr20200430182649', 'No', 'Yes', NULL, 'Horisontal', 'Passage'),
(238, 27, NULL, '2020-07-16', NULL, 132273, 3, '067b20200716120957', 'No', 'Yes', NULL, 'Vertical', 'Passage'),
(239, 27, NULL, '2020-07-20', NULL, 132273, 3, '0w7g20200720110604', 'None ', 'Yes', NULL, 'Vertical', 'Passage'),
(240, 27, NULL, '2020-08-26', NULL, 133388, 3, '03k20200826175241', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(241, 27, NULL, '2020-09-02', NULL, 133537, 3, '0d7w20200902164838', 'No', 'Yes', NULL, 'Horisontal', 'Passage'),
(242, 27, NULL, '2020-09-16', NULL, 133876, 146, '0tg620200916102133', 'Unsure', 'Yes', NULL, 'Horisontal', 'Other'),
(243, 27, NULL, '2021-02-25', NULL, 137590, 3, '0yqc20210225144728', 'No', 'Yes', NULL, 'Horisontal', 'Passage'),
(244, 27, NULL, '2021-04-09', NULL, 138505, 3, '0bw320210409110259', 'None ', 'Yes', NULL, 'Horisontal', 'Lounge'),
(245, 27, NULL, '2021-05-13', NULL, 139169, 3, '0qgr20210513105110', 'None ', 'Yes', NULL, 'Horisontal', 'Bathroom - Ensuite'),
(246, 27, NULL, '2021-05-25', NULL, 139408, 146, '0km720210525101844', 'WD001', 'No', 'No ', 'Horisontal', 'Passage'),
(247, 27, NULL, '2021-05-26', NULL, 139436, 3, '0nkj20210526174803', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(248, 27, NULL, '2021-10-15', NULL, 97024, 3, '0ync20211015210320', 'No', 'Yes', NULL, 'Horisontal', 'Passage'),
(249, 27, NULL, '2021-10-18', NULL, 142388, 3, '0k620211018123807', 'None ', 'Yes', NULL, 'Horisontal', 'Lounge'),
(250, 27, NULL, '2021-11-02', NULL, 140705, 3, '015c20211102152248', 'No', 'Yes', NULL, 'Vertical', 'Garrage'),
(251, 27, NULL, '2022-03-25', NULL, 145533, 3, '04bo20220325131505', 'Job is not done sence cable is', 'Yes', NULL, 'Horisontal', 'Bathroom - Guest toilet'),
(252, 27, NULL, '2022-04-04', NULL, 145533, 3, '0ra420220404080658', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(253, 27, NULL, '2022-05-11', NULL, 146268, 3, '0pw20220511103606', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(254, 27, NULL, '2022-05-12', NULL, 146268, 3, '09u20220512094528', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(255, 27, NULL, '2022-05-13', NULL, 144631, 3, '0nv820220513135207', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(256, 27, NULL, '2022-05-23', NULL, 146780, 3, '01z20220523111218', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(257, 27, NULL, '2022-06-06', NULL, 147035, 3, '0m4g20220606100125', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(258, 27, NULL, '2022-08-29', NULL, 149090, 3, '0mwc20220829145848', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(259, 27, NULL, '2022-10-05', NULL, 149904, 3, '0dw220221005073847', 'Ni', 'Yes', NULL, 'Horisontal', 'Passage'),
(260, 27, NULL, '2022-10-05', NULL, 149904, 3, '0wma20221005181940', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(261, 27, NULL, '2022-10-31', NULL, 150487, 138, '0wn520221031130736', '0000000', 'Yes', NULL, 'Horisontal', 'Passage'),
(262, 27, NULL, '2022-11-01', NULL, 149904, 3, '0ufn20221101123501', 'None ', 'Yes', NULL, 'Horisontal', 'Passage'),
(263, 27, NULL, '2023-02-04', NULL, 152425, 3, '0rn620230204123924', 'No', 'Yes', NULL, 'Horisontal', 'Passage'),
(264, 27, NULL, '2023-05-25', NULL, 154908, 79, '0rth20230525104316', '00000', 'Yes', NULL, 'Horisontal', 'Garrage');

-- --------------------------------------------------------

--
-- Structure for view `view_action`
--
DROP TABLE IF EXISTS `view_action`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_action` AS select `job`.`pk_job` AS `pk_job`,`job_action`.`fk_job` AS `fk_job`,`job_action`.`pkAction` AS `pkAction`,`job_action`.`fkActType` AS `fkActType`,`job_action`.`actNote` AS `actNote`,`job_action`.`actDateCap` AS `actDateCap`,`job_action`.`actDateFor` AS `actDateFor`,`job_action`.`actTimeFor` AS `actTimeFor`,`job_action`.`actUserCap` AS `actUserCap`,`job_action`.`actUserFor` AS `actUserFor`,`job_action`.`actIsDoneSuper` AS `actIsDoneSuper`,`job_action`.`actIsDoneUser` AS `actIsDoneUser`,`job_action`.`actDateUserIsdone` AS `actDateUserIsdone`,`job_action`.`rndm5` AS `rndm5`,`job_action`.`actDateSuperIsdone` AS `actDateSuperIsdone`,`setup_acttype`.`pkactType` AS `pkactType`,`setup_acttype`.`actname` AS `actname`,`usercap1`.`pk_user` AS `capid`,`usercap1`.`userName` AS `capname`,`userfor1`.`userName` AS `forid`,`userfor1`.`pk_user` AS `forname`,`job_action`.`actClerkNote` AS `actClerkNote`,`job_action`.`actSuperNote` AS `actSuperNote`,`job`.`jbClaimNo` AS `jbClaimNo` from ((((`job` join `job_action` on((`job_action`.`fk_job` = `job`.`pk_job`))) join `setup_user` `usercap1` on((`usercap1`.`pk_user` = `job_action`.`actUserCap`))) join `setup_acttype` on((`setup_acttype`.`pkactType` = `job_action`.`fkActType`))) join `setup_user` `userfor1` on((`userfor1`.`pk_user` = `job_action`.`actUserFor`)));

-- --------------------------------------------------------

--
-- Structure for view `view_cal_financial`
--
DROP TABLE IF EXISTS `view_cal_financial`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_financial` AS select `clientdetails`.`clName` AS `clName`,`clientdetails`.`clSurname` AS `clSurname`,`job`.`fkJobDone` AS `fkJobDone`,`job`.`fkInsApproval` AS `fkInsApproval`,`job`.`fkExcessDelay` AS `fkExcessDelay`,`job`.`fkExcessGet` AS `fkExcessGet`,`job`.`fkLeakDetection` AS `fkLeakDetection`,`job`.`fkInspection` AS `fkInspection`,`job`.`jbClaimNo` AS `jbClaimNo`,`setup_insurer`.`insName` AS `insName`,`job`.`fkquote` AS `fkquote`,`job`.`fkproofpay` AS `fkproofpay`,`job`.`finuInCharge` AS `finuInCharge`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`jobType` AS `jobType`,`job_schedule`.`jobCat` AS `jobCat`,`job_schedule`.`jobDone` AS `jobDone`,`job_type`.`tName` AS `tName`,`setup_scheduletype`.`ActionName` AS `ActionName`,`setup_user`.`userName` AS `userName`,`job`.`fkCloseFile` AS `fkCloseFile`,`job`.`pk_job` AS `pk_job`,`job`.`finDelay` AS `finDelay`,`job`.`finDelayDate` AS `finDelayDate` from ((((((`job` join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_user` on((`setup_user`.`pk_user` = `job`.`finuInCharge`))) join `job_schedule` on((`job`.`pk_job` = `job_schedule`.`fk_job`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`))) where (((`job`.`fkExcessGet` = _utf8'0') or (`job`.`fkInvoice1` = _utf8'0') or (`job`.`fkInvoiced` = _utf8'0') or (`job`.`fkReportFinal` = _utf8'0') or (`job`.`fkbluecard` = _utf8'0')) and (`job`.`fkInspection` = _utf8'1') and (`job`.`fkLeakDetection` = _utf8'1') and (`job`.`fkquote` = _utf8'1') and (`job`.`fkInsApproval` = _utf8'1') and (`job`.`fkExcessDelay` = _utf8'1') and (`job`.`fkJobDone` = _utf8'1') and (`job`.`fkReportSent` = _utf8'1') and (`job`.`fkproofpay` = _utf8'1')) group by `job`.`pk_job`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_financial_closefile`
--
DROP TABLE IF EXISTS `view_cal_financial_closefile`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_financial_closefile` AS select `clientdetails`.`clName` AS `clName`,`clientdetails`.`clSurname` AS `clSurname`,`job`.`fkJobDone` AS `fkJobDone`,`job`.`fkInsApproval` AS `fkInsApproval`,`job`.`fkExcessDelay` AS `fkExcessDelay`,`job`.`fkExcessGet` AS `fkExcessGet`,`job`.`fkLeakDetection` AS `fkLeakDetection`,`job`.`fkInspection` AS `fkInspection`,`job`.`jbClaimNo` AS `jbClaimNo`,`setup_insurer`.`insName` AS `insName`,`job`.`fkquote` AS `fkquote`,`job`.`fkproofpay` AS `fkproofpay`,`job`.`finuInCharge` AS `finuInCharge`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`jobType` AS `jobType`,`job_schedule`.`jobCat` AS `jobCat`,`job_schedule`.`jobDone` AS `jobDone`,`job_type`.`tName` AS `tName`,`setup_scheduletype`.`ActionName` AS `ActionName`,`setup_user`.`userName` AS `userName`,`job`.`fkCloseFile` AS `fkCloseFile`,`job`.`pk_job` AS `pk_job`,`job`.`finDelay` AS `finDelay`,`job`.`finDelayDate` AS `finDelayDate` from ((((((`job` join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_user` on((`setup_user`.`pk_user` = `job`.`finuInCharge`))) join `job_schedule` on((`job`.`pk_job` = `job_schedule`.`fk_job`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`))) where (((`job`.`fkExcessGet` = _utf8'0') or (`job`.`fkInvoice1` = _utf8'0') or (`job`.`fkInvoiced` = _utf8'0') or (`job`.`fkReportFinal` = _utf8'0') or (`job`.`fkbluecard` = _utf8'0')) and (`job`.`fkInspection` = _utf8'1') and (`job`.`fkLeakDetection` = _utf8'1') and (`job`.`fkquote` = _utf8'1') and (`job`.`fkInsApproval` = _utf8'1') and (`job`.`fkExcessDelay` = _utf8'1') and (`job`.`fkJobDone` = _utf8'1') and (`job`.`fkReportSent` = _utf8'1') and (`job`.`fkproofpay` = _utf8'1') and (`job`.`fkCloseFile` = 1)) group by `job`.`pk_job`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_financial_sos`
--
DROP TABLE IF EXISTS `view_cal_financial_sos`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_financial_sos` AS select `clientdetails`.`clName` AS `clName`,`clientdetails`.`clSurname` AS `clSurname`,`job`.`fkJobDone` AS `fkJobDone`,`job`.`fkInsApproval` AS `fkInsApproval`,`job`.`fkExcessDelay` AS `fkExcessDelay`,`job`.`fkExcessGet` AS `fkExcessGet`,`job`.`fkLeakDetection` AS `fkLeakDetection`,`job`.`fkInspection` AS `fkInspection`,`job`.`jbClaimNo` AS `jbClaimNo`,`setup_insurer`.`insName` AS `insName`,`job`.`fkquote` AS `fkquote`,`job`.`fkproofpay` AS `fkproofpay`,`job`.`finuInCharge` AS `finuInCharge`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`jobType` AS `jobType`,`job_schedule`.`jobCat` AS `jobCat`,`job_schedule`.`jobDone` AS `jobDone`,`job_type`.`tName` AS `tName`,`setup_scheduletype`.`ActionName` AS `ActionName`,`setup_user`.`userName` AS `userName`,`job`.`finDelayDate` AS `finDelayDate`,`job`.`finDelay` AS `finDelay` from ((((((`job` join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_user` on((`setup_user`.`pk_user` = `job`.`finuInCharge`))) join `job_schedule` on((`job`.`pk_job` = `job_schedule`.`fk_job`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`))) where (((`job`.`fkExcessGet` = _utf8'0') or (`job`.`fkInvoice1` = _utf8'0') or (`job`.`fkInvoiced` = _utf8'0') or (`job`.`fkReportFinal` = _utf8'0') or (`job`.`fkbluecard` = _utf8'0')) and (`job`.`fkInspection` = _utf8'1') and (`job`.`fkLeakDetection` = _utf8'1') and (`job`.`fkquote` = _utf8'1') and (`job`.`fkInsApproval` = _utf8'1') and (`job`.`fkExcessDelay` = _utf8'1') and (`job`.`fkJobDone` = _utf8'1') and (`job`.`fkReportSent` = _utf8'1') and (`job`.`fkproofpay` = _utf8'1') and (`job_schedule`.`jobCat` = 6)) group by `job`.`pk_job`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_inspection`
--
DROP TABLE IF EXISTS `view_cal_inspection`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_inspection` AS select `view_schedule`.`clSurname` AS `clSurname`,`view_schedule`.`sheduleDate` AS `sheduleDate`,`view_schedule`.`pname` AS `pname`,`view_schedule`.`jobDone` AS `jobDone`,`view_schedule`.`cancelled` AS `cancelled`,`view_schedule`.`fk_postal` AS `fk_postal`,`view_schedule`.`jobType` AS `jobType`,`view_schedule`.`jbClaimNo` AS `jbClaimNo`,`setup_postal_codes`.`pk_postal` AS `pk_postal`,`setup_postal_codes`.`suburb` AS `suburb`,`view_schedule`.`fk_plumber` AS `fk_plumber`,`view_schedule`.`snooze` AS `snooze`,`view_schedule`.`pk_job` AS `pk_job`,`view_schedule`.`jobCat` AS `jobCat` from (`view_schedule` join `setup_postal_codes` on((`setup_postal_codes`.`pk_postal` = `view_schedule`.`fk_postal`))) where (`view_schedule`.`jobType` = 1) order by `view_schedule`.`pname`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_inspection_sos`
--
DROP TABLE IF EXISTS `view_cal_inspection_sos`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_inspection_sos` AS select `view_schedule`.`clSurname` AS `clSurname`,`view_schedule`.`sheduleDate` AS `sheduleDate`,`view_schedule`.`pname` AS `pname`,`view_schedule`.`jobDone` AS `jobDone`,`view_schedule`.`cancelled` AS `cancelled`,`view_schedule`.`fk_postal` AS `fk_postal`,`view_schedule`.`jobType` AS `jobType`,`view_schedule`.`jbClaimNo` AS `jbClaimNo`,`setup_postal_codes`.`pk_postal` AS `pk_postal`,`setup_postal_codes`.`suburb` AS `suburb`,`view_schedule`.`fk_plumber` AS `fk_plumber`,`view_schedule`.`snooze` AS `snooze`,`view_schedule`.`pk_job` AS `pk_job`,`view_schedule`.`jobCat` AS `jobCat` from (`view_schedule` join `setup_postal_codes` on((`setup_postal_codes`.`pk_postal` = `view_schedule`.`fk_postal`))) where (`view_schedule`.`jobCat` = 6) order by `view_schedule`.`pname`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_job`
--
DROP TABLE IF EXISTS `view_cal_job`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_job` AS select `view_schedule_taken`.`pk_job` AS `pk_job`,`view_schedule_taken`.`snooze` AS `snooze`,`view_schedule_taken`.`jobDone` AS `jobDone`,if((`view_schedule_taken`.`t0` = 1),((`view_schedule_taken`.`t0` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t0`,if((`view_schedule_taken`.`t1` = 1),((`view_schedule_taken`.`t1` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t1`,if((`view_schedule_taken`.`t2` = 1),((`view_schedule_taken`.`t2` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t2`,if((`view_schedule_taken`.`t3` = 1),((`view_schedule_taken`.`t3` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t3`,if((`view_schedule_taken`.`t4` = 1),((`view_schedule_taken`.`t4` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t4`,if((`view_schedule_taken`.`t5` = 1),((`view_schedule_taken`.`t5` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t5`,if((`view_schedule_taken`.`t6` = 1),((`view_schedule_taken`.`t6` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t6`,if((`view_schedule_taken`.`t7` = 1),((`view_schedule_taken`.`t7` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t7`,if((`view_schedule_taken`.`t8` = 1),((`view_schedule_taken`.`t8` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t8`,if((`view_schedule_taken`.`t9` = 1),((`view_schedule_taken`.`t9` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t9`,if((`view_schedule_taken`.`t10` = 1),((`view_schedule_taken`.`t10` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t10`,if((`view_schedule_taken`.`t11` = 1),((`view_schedule_taken`.`t11` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t11`,if((`view_schedule_taken`.`t12` = 1),((`view_schedule_taken`.`t12` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t12`,if((`view_schedule_taken`.`t13` = 1),((`view_schedule_taken`.`t13` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t13`,if((`view_schedule_taken`.`t14` = 1),((`view_schedule_taken`.`t14` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t14`,if((`view_schedule_taken`.`t15` = 1),((`view_schedule_taken`.`t15` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t15`,if((`view_schedule_taken`.`t16` = 1),((`view_schedule_taken`.`t16` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t16`,if((`view_schedule_taken`.`t17` = 1),((`view_schedule_taken`.`t17` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t17`,if((`view_schedule_taken`.`t18` = 1),((`view_schedule_taken`.`t18` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t18`,if((`view_schedule_taken`.`t19` = 1),((`view_schedule_taken`.`t19` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t19`,if((`view_schedule_taken`.`t20` = 1),((`view_schedule_taken`.`t20` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t20`,if((`view_schedule_taken`.`t21` = 1),((`view_schedule_taken`.`t21` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t21`,if((`view_schedule_taken`.`t22` = 1),((`view_schedule_taken`.`t22` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t22`,if((`view_schedule_taken`.`t23` = 1),((`view_schedule_taken`.`t23` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t23`,if((`view_schedule_taken`.`t24` = 1),((`view_schedule_taken`.`t24` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t24`,if((`view_schedule_taken`.`t25` = 1),((`view_schedule_taken`.`t25` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t25`,if((`view_schedule_taken`.`t26` = 1),((`view_schedule_taken`.`t26` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t26`,if((`view_schedule_taken`.`t27` = 1),((`view_schedule_taken`.`t27` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t27`,if((`view_schedule_taken`.`t28` = 1),((`view_schedule_taken`.`t28` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t28`,if((`view_schedule_taken`.`t29` = 1),((`view_schedule_taken`.`t29` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t29`,if((`view_schedule_taken`.`t30` = 1),((`view_schedule_taken`.`t30` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t30`,if((`view_schedule_taken`.`t31` = 1),((`view_schedule_taken`.`t31` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t31`,if((`view_schedule_taken`.`t32` = 1),((`view_schedule_taken`.`t32` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t32`,if((`view_schedule_taken`.`t33` = 1),((`view_schedule_taken`.`t33` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t33`,if((`view_schedule_taken`.`t34` = 1),((`view_schedule_taken`.`t34` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`jbinfo`,NULL) AS `infot34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action34`,`view_schedule_taken`.`pk_schedule` AS `pk_schedule`,`view_schedule_taken`.`cancelled` AS `cancelled`,`view_schedule_taken`.`jobType` AS `jobType`,`view_schedule_taken`.`timeStart` AS `timeStart`,`view_schedule_taken`.`pk_plumber` AS `pk_plumber`,`view_schedule_taken`.`ActionName` AS `ActionName`,`view_schedule_taken`.`sheduleDate` AS `sheduleDate`,`view_schedule_taken`.`pname` AS `pname`,`view_schedule_taken`.`plumberRank` AS `plumberRank`,`view_schedule_taken`.`fk_plumberType` AS `fk_plumberType`,`view_schedule_taken`.`typeName` AS `typeName`,`view_schedule_taken`.`rank` AS `rank`,`view_schedule_taken`.`specifictime` AS `specifictime`,`view_schedule_taken`.`jobCat` AS `jobCat` from `view_schedule_taken` where (((`view_schedule_taken`.`jobType` <> 1) and (`view_schedule_taken`.`jobType` <> 4)) or ((`view_schedule_taken`.`jobType` = 1) and (`view_schedule_taken`.`specifictime` = 1)) or ((`view_schedule_taken`.`jobType` = 4) and (`view_schedule_taken`.`specifictime` = 1)));

-- --------------------------------------------------------

--
-- Structure for view `view_cal_stats`
--
DROP TABLE IF EXISTS `view_cal_stats`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_stats` AS select `setup_insurer`.`insName` AS `insName`,`job_schedule`.`jobType` AS `jobType`,`job`.`jbClaimNo` AS `jbClaimNo`,`job_schedule`.`cancelled` AS `cancelled`,`job_type`.`pk_jtype` AS `pk_jtype`,`job_type`.`tName` AS `tName`,`job_type`.`tNameShort` AS `tNameShort`,`job_schedule`.`jobCat` AS `jobCat`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`setup_scheduletype`.`ActionName` AS `ActionName`,`setup_scheduletype`.`ActionShort` AS `ActionShort` from ((((`job` join `job_schedule` on((`job`.`pk_job` = `job_schedule`.`fk_job`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) where (((`job_schedule`.`jobType` = 2) or ((`job_schedule`.`jobType` = 3) and (`job_type`.`pk_jtype` = 7))) and (`job_schedule`.`cancelled` <> 1));

-- --------------------------------------------------------

--
-- Structure for view `view_cal_stats2`
--
DROP TABLE IF EXISTS `view_cal_stats2`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_stats2` AS select `view_cal_stats`.`tName` AS `tName`,count(`view_cal_stats`.`tName`) AS `insAmt1`,`view_cal_stats`.`sheduleDate` AS `sheduleDate`,`view_cal_stats`.`jobType` AS `jobType`,`view_cal_stats`.`insName` AS `insName` from `view_cal_stats` group by `view_cal_stats`.`sheduleDate`,`view_cal_stats`.`insName` order by `view_cal_stats`.`sheduleDate`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_stats3`
--
DROP TABLE IF EXISTS `view_cal_stats3`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_stats3` AS select `view_cal_stats`.`tName` AS `tName`,count(`view_cal_stats`.`tName`) AS `typetotal`,`view_cal_stats`.`sheduleDate` AS `sheduleDate`,`view_cal_stats`.`jobType` AS `jobType` from `view_cal_stats` group by `view_cal_stats`.`sheduleDate`,`view_cal_stats`.`tName` order by `view_cal_stats`.`sheduleDate`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_stats_comebacks`
--
DROP TABLE IF EXISTS `view_cal_stats_comebacks`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_stats_comebacks` AS select count(`job_schedule`.`jobType`) AS `COUNT(jobType)`,`job_schedule`.`sheduleDate` AS `sheduleDate` from `job_schedule` where (`job_schedule`.`jobType` = 5) group by `job_schedule`.`sheduleDate`;

-- --------------------------------------------------------

--
-- Structure for view `view_cal_travel`
--
DROP TABLE IF EXISTS `view_cal_travel`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cal_travel` AS select `view_schedule_taken`.`pk_job` AS `pk_job`,`view_schedule_taken`.`snooze` AS `snooze`,`view_schedule_taken`.`jobDone` AS `jobDone`,if((`view_schedule_taken`.`t0` = 1),((`view_schedule_taken`.`t0` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t0`,if((`view_schedule_taken`.`t1` = 1),((`view_schedule_taken`.`t1` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t1`,if((`view_schedule_taken`.`t2` = 1),((`view_schedule_taken`.`t2` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t2`,if((`view_schedule_taken`.`t3` = 1),((`view_schedule_taken`.`t3` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t3`,if((`view_schedule_taken`.`t4` = 1),((`view_schedule_taken`.`t4` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t4`,if((`view_schedule_taken`.`t5` = 1),((`view_schedule_taken`.`t5` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t5`,if((`view_schedule_taken`.`t6` = 1),((`view_schedule_taken`.`t6` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t6`,if((`view_schedule_taken`.`t7` = 1),((`view_schedule_taken`.`t7` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t7`,if((`view_schedule_taken`.`t8` = 1),((`view_schedule_taken`.`t8` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t8`,if((`view_schedule_taken`.`t9` = 1),((`view_schedule_taken`.`t9` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t9`,if((`view_schedule_taken`.`t10` = 1),((`view_schedule_taken`.`t10` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t10`,if((`view_schedule_taken`.`t11` = 1),((`view_schedule_taken`.`t11` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t11`,if((`view_schedule_taken`.`t12` = 1),((`view_schedule_taken`.`t12` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t12`,if((`view_schedule_taken`.`t13` = 1),((`view_schedule_taken`.`t13` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t13`,if((`view_schedule_taken`.`t14` = 1),((`view_schedule_taken`.`t14` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t14`,if((`view_schedule_taken`.`t15` = 1),((`view_schedule_taken`.`t15` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t15`,if((`view_schedule_taken`.`t16` = 1),((`view_schedule_taken`.`t16` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t16`,if((`view_schedule_taken`.`t17` = 1),((`view_schedule_taken`.`t17` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t17`,if((`view_schedule_taken`.`t18` = 1),((`view_schedule_taken`.`t18` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t18`,if((`view_schedule_taken`.`t19` = 1),((`view_schedule_taken`.`t19` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t19`,if((`view_schedule_taken`.`t20` = 1),((`view_schedule_taken`.`t20` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t20`,if((`view_schedule_taken`.`t21` = 1),((`view_schedule_taken`.`t21` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t21`,if((`view_schedule_taken`.`t22` = 1),((`view_schedule_taken`.`t22` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t22`,if((`view_schedule_taken`.`t23` = 1),((`view_schedule_taken`.`t23` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t23`,if((`view_schedule_taken`.`t24` = 1),((`view_schedule_taken`.`t24` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t24`,if((`view_schedule_taken`.`t25` = 1),((`view_schedule_taken`.`t25` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t25`,if((`view_schedule_taken`.`t26` = 1),((`view_schedule_taken`.`t26` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t26`,if((`view_schedule_taken`.`t27` = 1),((`view_schedule_taken`.`t27` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t27`,if((`view_schedule_taken`.`t28` = 1),((`view_schedule_taken`.`t28` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t28`,if((`view_schedule_taken`.`t29` = 1),((`view_schedule_taken`.`t29` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t29`,if((`view_schedule_taken`.`t30` = 1),((`view_schedule_taken`.`t30` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t30`,if((`view_schedule_taken`.`t31` = 1),((`view_schedule_taken`.`t31` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t31`,if((`view_schedule_taken`.`t32` = 1),((`view_schedule_taken`.`t32` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t32`,if((`view_schedule_taken`.`t33` = 1),((`view_schedule_taken`.`t33` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t33`,if((`view_schedule_taken`.`t34` = 1),((`view_schedule_taken`.`t34` + `view_schedule_taken`.`jobDone`) + `view_schedule_taken`.`snooze`),0) AS `t34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`suburb`,NULL) AS `infot34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`pk_job`,NULL) AS `cl34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`timeStart`,NULL) AS `ti34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`jobCat`,NULL) AS `cat34`,if((`view_schedule_taken`.`t0` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action0`,if((`view_schedule_taken`.`t1` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action1`,if((`view_schedule_taken`.`t2` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action2`,if((`view_schedule_taken`.`t3` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action3`,if((`view_schedule_taken`.`t4` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action4`,if((`view_schedule_taken`.`t5` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action5`,if((`view_schedule_taken`.`t6` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action6`,if((`view_schedule_taken`.`t7` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action7`,if((`view_schedule_taken`.`t8` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action8`,if((`view_schedule_taken`.`t9` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action9`,if((`view_schedule_taken`.`t10` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action10`,if((`view_schedule_taken`.`t11` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action11`,if((`view_schedule_taken`.`t12` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action12`,if((`view_schedule_taken`.`t13` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action13`,if((`view_schedule_taken`.`t14` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action14`,if((`view_schedule_taken`.`t15` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action15`,if((`view_schedule_taken`.`t16` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action16`,if((`view_schedule_taken`.`t17` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action17`,if((`view_schedule_taken`.`t18` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action18`,if((`view_schedule_taken`.`t19` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action19`,if((`view_schedule_taken`.`t20` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action20`,if((`view_schedule_taken`.`t21` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action21`,if((`view_schedule_taken`.`t22` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action22`,if((`view_schedule_taken`.`t23` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action23`,if((`view_schedule_taken`.`t24` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action24`,if((`view_schedule_taken`.`t25` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action25`,if((`view_schedule_taken`.`t26` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action26`,if((`view_schedule_taken`.`t27` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action27`,if((`view_schedule_taken`.`t28` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action28`,if((`view_schedule_taken`.`t29` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action29`,if((`view_schedule_taken`.`t30` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action30`,if((`view_schedule_taken`.`t31` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action31`,if((`view_schedule_taken`.`t32` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action32`,if((`view_schedule_taken`.`t33` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action33`,if((`view_schedule_taken`.`t34` = 1),`view_schedule_taken`.`pkaction`,NULL) AS `action34`,`view_schedule_taken`.`pk_schedule` AS `pk_schedule`,`view_schedule_taken`.`cancelled` AS `cancelled`,`view_schedule_taken`.`jobType` AS `jobType`,`view_schedule_taken`.`timeStart` AS `timeStart`,`view_schedule_taken`.`pk_plumber` AS `pk_plumber`,`view_schedule_taken`.`ActionName` AS `ActionName`,`view_schedule_taken`.`sheduleDate` AS `sheduleDate`,`view_schedule_taken`.`pname` AS `pname`,`view_schedule_taken`.`plumberRank` AS `plumberRank`,`view_schedule_taken`.`fk_plumberType` AS `fk_plumberType`,`view_schedule_taken`.`typeName` AS `typeName`,`view_schedule_taken`.`rank` AS `rank` from `view_schedule_taken` where ((`view_schedule_taken`.`jobType` <> 1) and (`view_schedule_taken`.`jobType` <> 4));

-- --------------------------------------------------------

--
-- Structure for view `view_client_add`
--
DROP TABLE IF EXISTS `view_client_add`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_client_add` AS select `clientdetails`.`pk_client` AS `pk_client`,`job`.`jbClaimNo` AS `jbClaimNo`,`job`.`jbRefVal` AS `jbRefVal`,`clientdetails`.`clDateJoin` AS `clDateJoin`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clTel1` AS `clTel1`,`clientdetails`.`clTel2` AS `clTel2`,`clientdetails`.`clTel3` AS `clTel3`,`clientdetails`.`clName` AS `clName`,`clientdetails`.`clPostal` AS `clPostal`,`setup_postal_codes`.`suburb` AS `suburb`,`setup_postal_codes`.`town` AS `town`,`job`.`jbdate` AS `jbdate`,`job`.`pk_job` AS `pk_job`,`clientdetails`.`clEmail` AS `clEmail` from ((`clientdetails` left join `job` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_postal_codes` on((`setup_postal_codes`.`pk_postal` = `clientdetails`.`fk_postal`)));

-- --------------------------------------------------------

--
-- Structure for view `view_diarynotes`
--
DROP TABLE IF EXISTS `view_diarynotes`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_diarynotes` AS select `job`.`pk_job` AS `pk_job`,`clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`job_notes`.`pk_notes` AS `pk_notes`,`job`.`userInCharge` AS `userInCharge`,`setup_notetype`.`pk_appType` AS `pk_appType`,`setup_notetype`.`typeName` AS `typeName`,`job_notes`.`followUpDate` AS `followUpDate`,`job`.`fk_client` AS `fk_client`,`job_notes`.`noteType` AS `noteType`,`job_notes`.`complete` AS `complete`,`job_notes`.`followtime` AS `followtime`,`job_notes`.`fkUType` AS `fkUType`,`job`.`finuInCharge` AS `finuInCharge`,`job_notes`.`noteFor` AS `noteFor`,`job_notes`.`tracknote` AS `tracknote`,`setup_notetype`.`alarmTime` AS `alarmTime` from (((`job` join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `job_notes` on((`job`.`pk_job` = `job_notes`.`fk_job`))) join `setup_notetype` on((`setup_notetype`.`pk_appType` = `job_notes`.`noteType`)));

-- --------------------------------------------------------

--
-- Structure for view `view_diaryplumber`
--
DROP TABLE IF EXISTS `view_diaryplumber`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_diaryplumber` AS select `job`.`pk_job` AS `pk_job`,`clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`job`.`userInCharge` AS `userInCharge`,`job`.`fk_client` AS `fk_client`,`job_schedule`.`pk_schedule` AS `pk_schedule`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`cancelled` AS `cancelled`,`job_schedule`.`jobDone` AS `jobDone`,`job_schedule`.`timeStart` AS `timeStart`,`job_schedule`.`jobType` AS `jobType`,`job_schedule`.`fk_plumber` AS `fk_plumber`,`setup_plumber`.`pk_plumber` AS `pk_plumber`,`setup_plumber`.`pname` AS `pname`,`setup_plumber`.`ptel` AS `ptel`,`job_schedule`.`snooze` AS `snooze`,`setup_scheduletype`.`pkaction` AS `pkaction`,`setup_scheduletype`.`ActionName` AS `ActionName` from ((((`job` join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `job_schedule` on((`job`.`pk_job` = `job_schedule`.`fk_job`))) join `setup_plumber` on((`setup_plumber`.`pk_plumber` = `job_schedule`.`fk_plumber`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`)));

-- --------------------------------------------------------

--
-- Structure for view `view_finoutstanding_report`
--
DROP TABLE IF EXISTS `view_finoutstanding_report`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_finoutstanding_report` AS select `job`.`jbdate` AS `jbdate`,`job`.`fk_insurer` AS `fk_insurer`,`job`.`finuInCharge` AS `finuInCharge`,`setup_insurer`.`insName` AS `insName`,`setup_insurer`.`pk_insurer` AS `pk_insurer`,`job`.`fkInvoiced` AS `fkInvoiced`,`job`.`fkInvoice1` AS `fkInvoice1`,`job`.`jbClaimNo` AS `jbClaimNo`,`setup_user`.`userName` AS `userName` from ((`job` join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_user` on((`setup_user`.`pk_user` = `job`.`finuInCharge`))) where ((`job`.`fkInvoiced` = _utf8'0') or (`job`.`fkInvoice1` = _utf8'0'));

-- --------------------------------------------------------

--
-- Structure for view `view_jobcardreport`
--
DROP TABLE IF EXISTS `view_jobcardreport`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_jobcardreport` AS select `setup_plumber`.`pname` AS `pname`,`setup_plumber`.`pk_plumber` AS `pk_plumber`,`job`.`pk_job` AS `pk_job`,`job`.`fk_client` AS `fk_client`,`job_schedule`.`pk_schedule` AS `pk_schedule`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`timeStart` AS `timeStart`,`job_schedule`.`timeFinish` AS `timeFinish`,`job_schedule`.`cancelled` AS `cancelled`,`job_schedule`.`jobdescription` AS `jobdescription`,`clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`clientdetails`.`clTel1` AS `clTel1`,`clientdetails`.`clTel2` AS `clTel2`,`clientdetails`.`clPostal` AS `clPostal`,`clientdetails`.`fk_postal` AS `fk_postal`,`setup_postal_codes`.`pk_postal` AS `pk_postal`,`setup_postal_codes`.`suburb` AS `suburb`,`setup_postal_codes`.`postalcd` AS `postalcd`,`clientdetails`.`clTel3` AS `clTel3`,`clientdetails`.`clEmail` AS `clEmail`,`setup_postal_codes`.`town` AS `town`,`clientdetails`.`clNotes` AS `clNotes`,`job`.`jbClaimNo` AS `jbClaimNo`,`job`.`fk_insurer` AS `fk_insurer`,`setup_insurer`.`pk_insurer` AS `pk_insurer`,`setup_insurer`.`insName` AS `insName`,`job`.`excessVal` AS `excessVal`,`job_schedule`.`cancelReason` AS `cancelReason`,`job_schedule`.`jobType` AS `jobType`,`setup_scheduletype`.`pkaction` AS `pkaction`,`setup_scheduletype`.`ActionName` AS `ActionName`,`job_schedule`.`jobCat` AS `jobCat`,`job_type`.`pk_jtype` AS `pk_jtype`,`job_type`.`tName` AS `tName`,`job_type`.`tNameShort` AS `tNameShort`,`job_schedule`.`excessInfo` AS `excessInfo`,`job`.`limitVal` AS `limitVal` from (((((((`job_schedule` join `setup_plumber`) join `job`) join `clientdetails`) join `setup_postal_codes`) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`))) where ((`setup_postal_codes`.`pk_postal` = `clientdetails`.`fk_postal`) and (`clientdetails`.`pk_client` = `job`.`fk_client`) and (`setup_plumber`.`pk_plumber` = `job_schedule`.`fk_plumber`) and (`job_schedule`.`fk_job` = `job`.`pk_job`));

-- --------------------------------------------------------

--
-- Structure for view `view_monthly job breakdown`
--
DROP TABLE IF EXISTS `view_monthly job breakdown`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_monthly job breakdown` AS select `job`.`jbdate` AS `jbdate`,`job`.`fk_insurer` AS `fk_insurer`,`job`.`jbClaimNo` AS `jbClaimNo`,`setup_insurer`.`pk_insurer` AS `pk_insurer`,`setup_insurer`.`insName` AS `insName` from (`job` join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`)));

-- --------------------------------------------------------

--
-- Structure for view `view_notes`
--
DROP TABLE IF EXISTS `view_notes`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_notes` AS select `job`.`pk_job` AS `pk_job`,`clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`job`.`fk_client` AS `fk_client`,`job_notes`.`pk_notes` AS `pk_notes`,`job_notes`.`noteUser` AS `noteUser`,`job_notes`.`dateCap` AS `dateCap`,`job_notes`.`Note` AS `Note`,`job_notes`.`noteHide` AS `noteHide`,`job_notes`.`fk_job` AS `fk_job`,`job_notes`.`UserEdit` AS `UserEdit`,`job_notes`.`EditDate` AS `EditDate`,`job_notes`.`followUpDate` AS `followUpDate`,`job_notes`.`noteType` AS `noteType`,`job_notes`.`completeNote` AS `completeNote`,`job_notes`.`complete` AS `complete`,`setup_notetype`.`pk_appType` AS `pk_appType`,`setup_notetype`.`typeName` AS `typeName`,`user2`.`pk_user` AS `pk_user`,`user2`.`userName` AS `userName`,`job_notes`.`completeDate` AS `completeDate`,`job_notes`.`completeUser` AS `completeUser`,`setup_user`.`pk_user` AS `pk_user2`,`setup_user`.`userName` AS `userName2`,`clientdetails`.`clTel1` AS `clTel1`,`clientdetails`.`clTel2` AS `clTel2`,`clientdetails`.`clPostal` AS `clPostal`,`clientdetails`.`clPostalcd` AS `clPostalcd`,`setup_insurer`.`pk_insurer` AS `pk_insurer`,`setup_insurer`.`insName` AS `insName`,`job`.`fk_insurer` AS `fk_insurer`,`job`.`jbRefVal` AS `jbRefVal`,`job`.`jbClaimNo` AS `jbClaimNo`,`setup_other_ref`.`pk_other_ref` AS `pk_other_ref`,`setup_other_ref`.`ref_name` AS `ref_name`,`job`.`excessVal` AS `excessVal`,`job_notes`.`followtime` AS `followtime`,`job_notes`.`noteFor` AS `noteFor`,`uNotefor`.`pk_user` AS `pkNotefor`,`uNotefor`.`userName` AS `userNotefor`,`job_notes`.`tracknote` AS `tracknote`,`clientdetails`.`clEmail` AS `clEmail` from ((((((((`job` join `job_notes` on((`job`.`pk_job` = `job_notes`.`fk_job`))) join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_notetype` on((`setup_notetype`.`pk_appType` = `job_notes`.`noteType`))) join `setup_user` `user2` on((`user2`.`pk_user` = `job_notes`.`noteUser`))) join `setup_user` on((`setup_user`.`pk_user` = `job_notes`.`completeUser`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_other_ref` on((`setup_other_ref`.`pk_other_ref` = `job`.`fk_other_ref`))) join `setup_user` `uNotefor` on((`uNotefor`.`pk_user` = `job_notes`.`noteFor`)));

-- --------------------------------------------------------

--
-- Structure for view `view_overview`
--
DROP TABLE IF EXISTS `view_overview`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_overview` AS select `clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`job`.`pk_job` AS `pk_job`,`job`.`jbdate` AS `jbdate`,`job`.`fkInspection` AS `fkInspection`,`job`.`fkLeakDetection` AS `fkLeakDetection`,`job`.`fkJobDone` AS `fkJobDone`,`job`.`fkInsApproval` AS `fkInsApproval`,`job`.`fkExcessDelay` AS `fkExcessDelay`,`job`.`fkInvoiced` AS `fkInvoiced`,`job`.`userInCharge` AS `userInCharge`,`setup_user`.`pk_user` AS `pk_user`,`setup_user`.`userName` AS `userName`,`job`.`fkReportSent` AS `fkReportSent`,`job`.`jbClaimNo` AS `jbClaimNo`,`job`.`fkExcessGet` AS `fkExcessGet`,`job`.`fkquote` AS `fkquote`,`job`.`fkproofpay` AS `fkproofpay`,`job`.`fkInvoice1` AS `fkInvoice1`,`job`.`fkReportFinal` AS `fkReportFinal`,`job`.`fkbluecard` AS `fkbluecard`,`job`.`finuInCharge` AS `finuInCharge`,`setup_user2`.`pk_user` AS `pkuser2`,`setup_user2`.`userName` AS `finUsername`,`job_schedule`.`jobCat` AS `jobCat`,`job`.`fkCloseFile` AS `fkCloseFile`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job`.`finDelay` AS `finDelay` from ((((`job` join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_user` on((`setup_user`.`pk_user` = `job`.`userInCharge`))) join `setup_user` `setup_user2` on((`setup_user2`.`pk_user` = `job`.`finuInCharge`))) join `job_schedule` on((`job`.`pk_job` = `job_schedule`.`fk_job`)));

-- --------------------------------------------------------

--
-- Structure for view `view_plumberlocation`
--
DROP TABLE IF EXISTS `view_plumberlocation`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_plumberlocation` AS select `job_schedule`.`pk_schedule` AS `pk_schedule`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`fk_plumber` AS `fk_plumber`,`job_schedule`.`snooze` AS `snooze`,`job_schedule`.`snoozeTime` AS `snoozeTime`,`setup_plumber`.`pname` AS `pname`,`setup_postal_codes`.`suburb` AS `suburb` from ((((`job_schedule` join `setup_plumber` on((`setup_plumber`.`pk_plumber` = `job_schedule`.`fk_plumber`))) join `job` on((`job`.`pk_job` = `job_schedule`.`fk_job`))) join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_postal_codes` on((`setup_postal_codes`.`pk_postal` = `clientdetails`.`fk_postal`))) where `job_schedule`.`snoozeTime` in (select max(`job_schedule`.`snoozeTime`) AS `max(``job_schedule``.``snoozeTime``)` from `job_schedule` where (`job_schedule`.`snooze` = 1) group by `job_schedule`.`sheduleDate`,`job_schedule`.`fk_plumber`);

-- --------------------------------------------------------

--
-- Structure for view `view_quote1`
--
DROP TABLE IF EXISTS `view_quote1`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_quote1` AS select `job_quote`.`pk_quote` AS `pk_quote`,`job_quote`.`fk_job` AS `fk_job`,`job_quoteitem`.`pk_quoteItem` AS `pk_quoteItem`,`job_quoteitem`.`fk_quote` AS `fk_quote`,`job_quoteitem`.`price` AS `price`,`job_quote`.`addDate` AS `addDate`,`job_quoteitem`.`quantity` AS `quantity`,`job_quoteitem`.`qdescription` AS `qdescription`,`job_quote`.`Description1` AS `Description1`,`job_quoteitem`.`category` AS `category`,`job_quoteitem`.`qDateAdd` AS `qDateAdd` from (`job_quote` join `job_quoteitem` on((`job_quote`.`pk_quote` = `job_quoteitem`.`fk_quote`))) group by `job_quote`.`pk_quote`,`job_quote`.`fk_job`,`job_quote`.`Description1`,`job_quoteitem`.`pk_quoteItem`,`job_quoteitem`.`fk_quote`,`job_quoteitem`.`qdescription`,`job_quoteitem`.`delete`,`job_quote`.`addDate`,`job_quoteitem`.`price`;

-- --------------------------------------------------------

--
-- Structure for view `view_quote_info`
--
DROP TABLE IF EXISTS `view_quote_info`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_quote_info` AS select `job_quote`.`pk_quote` AS `pk_quote`,`job_quote`.`fk_job` AS `fk_job`,`job_quoteitem`.`pk_quoteItem` AS `pk_quoteItem`,`job_quoteitem`.`fk_quote` AS `fk_quote`,`job_quoteitem`.`price` AS `price`,`job_quote`.`addDate` AS `addDate`,`job_quoteitem`.`quantity` AS `quantity`,`job_quoteitem`.`qdescription` AS `qdescription`,`job_quote`.`Description1` AS `Description1`,`job`.`jbClaimNo` AS `jbClaimNo`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName` from (((`job_quote` join `job_quoteitem` on((`job_quote`.`pk_quote` = `job_quoteitem`.`fk_quote`))) join `job` on((`job`.`pk_job` = `job_quote`.`fk_job`))) join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) group by `job_quote`.`pk_quote`,`job_quote`.`fk_job`,`job_quote`.`Description1`,`job_quoteitem`.`pk_quoteItem`,`job_quoteitem`.`fk_quote`,`job_quoteitem`.`qdescription`,`job_quoteitem`.`delete`,`job_quote`.`addDate`,`job_quoteitem`.`price`;

-- --------------------------------------------------------

--
-- Structure for view `view_schedule`
--
DROP TABLE IF EXISTS `view_schedule`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_schedule` AS select `job`.`pk_job` AS `pk_job`,`clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`job`.`fk_client` AS `fk_client`,`job_schedule`.`pk_schedule` AS `pk_schedule`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`capDate` AS `capDate`,`job_schedule`.`capUser` AS `capUser`,`job_schedule`.`fk_plumber` AS `fk_plumber`,`job_schedule`.`jobdescription` AS `jobdescription`,`job_schedule`.`cancellTime` AS `cancellTime`,`job_schedule`.`cancelled` AS `cancelled`,`job_schedule`.`cancelReason` AS `cancelReason`,`job_schedule`.`cancelluser` AS `cancelluser`,`job_schedule`.`jobType` AS `jobType`,`job_schedule`.`jobDoneInfo` AS `jobDoneInfo`,`job_schedule`.`jobDone` AS `jobDone`,`job_schedule`.`jobDoneUser` AS `jobDoneUser`,`job_schedule`.`jobDoneTime` AS `jobDoneTime`,`job_schedule`.`isActive` AS `isActive`,`job_schedule`.`timeStart` AS `timeStart`,`job_schedule`.`timeFinish` AS `timeFinish`,`job_schedule`.`myrand1` AS `myrand1`,`job_schedule`.`fk_job` AS `fk_job`,`setup_plumber`.`pk_plumber` AS `pk_plumber`,`setup_plumber`.`pname` AS `pname`,`setup_plumber`.`ptel` AS `ptel`,`job`.`jbClaimNo` AS `jbClaimNo`,`job`.`excessVal` AS `excessVal`,`job`.`fk_insurer` AS `fk_insurer`,`setup_insurer`.`pk_insurer` AS `pk_insurer`,`setup_insurer`.`insName` AS `insName`,`clientdetails`.`fk_postal` AS `fk_postal`,`clientdetails`.`clPostal` AS `clPostal`,`clientdetails`.`clTel1` AS `clTel1`,`clientdetails`.`clTel2` AS `clTel2`,`clientdetails`.`clTel3` AS `clTel3`,`job_schedule`.`snooze` AS `snooze`,`job_schedule`.`t0` AS `t0`,`job_schedule`.`t1` AS `t1`,`job_schedule`.`t2` AS `t2`,`job_schedule`.`t3` AS `t3`,`job_schedule`.`t4` AS `t4`,`job_schedule`.`t5` AS `t5`,`job_schedule`.`t6` AS `t6`,`job_schedule`.`t7` AS `t7`,`job_schedule`.`t8` AS `t8`,`job_schedule`.`t9` AS `t9`,`job_schedule`.`t10` AS `t10`,`job_schedule`.`t11` AS `t11`,`job_schedule`.`t12` AS `t12`,`job_schedule`.`t13` AS `t13`,`job_schedule`.`t14` AS `t14`,`job_schedule`.`t15` AS `t15`,`job_schedule`.`t16` AS `t16`,`job_schedule`.`t17` AS `t17`,`job_schedule`.`t18` AS `t18`,`job_schedule`.`t19` AS `t19`,`job_schedule`.`t20` AS `t20`,`job_schedule`.`t21` AS `t21`,`job_schedule`.`t22` AS `t22`,`job_schedule`.`t23` AS `t23`,`job_schedule`.`t24` AS `t24`,`job_schedule`.`t25` AS `t25`,`job_schedule`.`t26` AS `t26`,`job_schedule`.`t27` AS `t27`,`job_schedule`.`t28` AS `t28`,`job_schedule`.`t29` AS `t29`,`job_schedule`.`t30` AS `t30`,`job_schedule`.`t31` AS `t31`,`job_schedule`.`t32` AS `t32`,`job_schedule`.`t33` AS `t33`,`job_schedule`.`t34` AS `t34`,`job`.`userInCharge` AS `userInCharge`,`job`.`fkInspection` AS `fkInspection`,`setup_scheduletype`.`ActionName` AS `ActionName`,`setup_scheduletype`.`pkaction` AS `pkaction`,`job_schedule`.`jobCat` AS `jobCat`,`job_type`.`pk_jtype` AS `pk_jtype`,`job_type`.`tName` AS `tName`,`job_type`.`tNameShort` AS `tNameShort`,`setup_scheduletype`.`ActionShort` AS `ActionShort`,`job`.`jbRefVal` AS `jbRefVal`,`job_schedule`.`plumberRank` AS `plumberRank`,`setup_plumber`.`fk_plumberType` AS `fk_plumberType`,`setup_plumber_type`.`typeName` AS `typeName`,`setup_plumber_type`.`pk_plumberType` AS `pk_plumberType`,`setup_plumber`.`rank` AS `rank`,`job_schedule`.`specifictime` AS `specifictime`,`job_schedule`.`excessInfo` AS `excessInfo`,`job`.`limitVal` AS `limitVal`,`job`.`salessms` AS `salessms`,`setup_user`.`userName` AS `userName`,`setup_user`.`pk_user` AS `pk_user` from ((((((((`job` join `job_schedule` on((`job_schedule`.`fk_job` = `job`.`pk_job`))) join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_plumber` on((`setup_plumber`.`pk_plumber` = `job_schedule`.`fk_plumber`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`))) join `setup_plumber_type` on((`setup_plumber_type`.`pk_plumberType` = `setup_plumber`.`fk_plumberType`))) join `setup_user` on((`setup_user`.`pk_user` = `job_schedule`.`capUser`)));

-- --------------------------------------------------------

--
-- Structure for view `view_schedule_print`
--
DROP TABLE IF EXISTS `view_schedule_print`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_schedule_print` AS select `job`.`pk_job` AS `pk_job`,`clientdetails`.`pk_client` AS `pk_client`,`clientdetails`.`clSurname` AS `clSurname`,`clientdetails`.`clName` AS `clName`,`job`.`fk_client` AS `fk_client`,`job_schedule`.`pk_schedule` AS `pk_schedule`,`job_schedule`.`sheduleDate` AS `sheduleDate`,`job_schedule`.`capDate` AS `capDate`,`job_schedule`.`capUser` AS `capUser`,`job_schedule`.`fk_plumber` AS `fk_plumber`,`job_schedule`.`jobdescription` AS `jobdescription`,`job_schedule`.`cancellTime` AS `cancellTime`,`job_schedule`.`cancelled` AS `cancelled`,`job_schedule`.`cancelReason` AS `cancelReason`,`job_schedule`.`cancelluser` AS `cancelluser`,`job_schedule`.`jobType` AS `jobType`,`job_schedule`.`jobDoneInfo` AS `jobDoneInfo`,`job_schedule`.`jobDone` AS `jobDone`,`job_schedule`.`jobDoneUser` AS `jobDoneUser`,`job_schedule`.`jobDoneTime` AS `jobDoneTime`,`job_schedule`.`isActive` AS `isActive`,`job_schedule`.`timeStart` AS `timeStart`,`job_schedule`.`timeFinish` AS `timeFinish`,`job_schedule`.`myrand1` AS `myrand1`,`job_schedule`.`fk_job` AS `fk_job`,`setup_plumber`.`pk_plumber` AS `pk_plumber`,`setup_plumber`.`pname` AS `pname`,`setup_plumber`.`ptel` AS `ptel`,`clientdetails`.`clTel1` AS `clTel1`,`clientdetails`.`clTel2` AS `clTel2`,`clientdetails`.`clPostal` AS `clPostal`,`clientdetails`.`clPostalcd` AS `clPostalcd`,`job`.`jbClaimNo` AS `jbClaimNo`,`job`.`jbRefVal` AS `jbRefVal`,`setup_other_ref`.`pk_other_ref` AS `pk_other_ref`,`setup_other_ref`.`ref_name` AS `ref_name`,`job`.`fk_other_ref` AS `fk_other_ref`,`setup_insurer`.`pk_insurer` AS `pk_insurer`,`setup_insurer`.`insName` AS `insName`,`job`.`fk_insurer` AS `fk_insurer`,`setup_scheduletype`.`pkaction` AS `pkaction`,`setup_scheduletype`.`ActionName` AS `ActionName`,`setup_scheduletype`.`ActionShort` AS `ActionShort`,`job_type`.`pk_jtype` AS `pk_jtype`,`job_type`.`tName` AS `tName`,`job_type`.`tNameShort` AS `tNameShort`,`job_schedule`.`jobCat` AS `jobCat` from (((((((`job` join `job_schedule` on((`job_schedule`.`fk_job` = `job`.`pk_job`))) join `clientdetails` on((`clientdetails`.`pk_client` = `job`.`fk_client`))) join `setup_plumber` on((`setup_plumber`.`pk_plumber` = `job_schedule`.`fk_plumber`))) join `setup_other_ref` on((`setup_other_ref`.`pk_other_ref` = `job`.`fk_other_ref`))) join `setup_insurer` on((`setup_insurer`.`pk_insurer` = `job`.`fk_insurer`))) join `setup_scheduletype` on((`setup_scheduletype`.`pkaction` = `job_schedule`.`jobType`))) join `job_type` on((`job_type`.`pk_jtype` = `job_schedule`.`jobCat`)));

-- --------------------------------------------------------

--
-- Structure for view `view_schedule_taken`
--
DROP TABLE IF EXISTS `view_schedule_taken`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_schedule_taken` AS select `view_schedule`.`sheduleDate` AS `sheduleDate`,`view_schedule`.`jobDone` AS `jobDone`,`view_schedule`.`isActive` AS `isActive`,`view_schedule`.`pk_plumber` AS `pk_plumber`,`view_schedule`.`t1` AS `t1`,concat(`view_schedule`.`jbClaimNo`,_utf8'- ',`view_schedule`.`tNameShort`,_utf8' ',convert(`view_schedule`.`ActionShort` using utf8),_utf8'- ',`setup_postal_codes`.`suburb`,_utf8'- ',`view_schedule`.`clSurname`) AS `jbinfo`,`view_schedule`.`t2` AS `t2`,`view_schedule`.`t3` AS `t3`,`view_schedule`.`t4` AS `t4`,`view_schedule`.`t5` AS `t5`,`view_schedule`.`t6` AS `t6`,`view_schedule`.`t7` AS `t7`,`view_schedule`.`t8` AS `t8`,`view_schedule`.`cancelled` AS `cancelled`,`view_schedule`.`pname` AS `pname`,`view_schedule`.`t9` AS `t9`,`view_schedule`.`t10` AS `t10`,`view_schedule`.`t11` AS `t11`,`view_schedule`.`t12` AS `t12`,`view_schedule`.`t13` AS `t13`,`view_schedule`.`t14` AS `t14`,`view_schedule`.`t15` AS `t15`,`view_schedule`.`t16` AS `t16`,`view_schedule`.`t17` AS `t17`,`view_schedule`.`t18` AS `t18`,`view_schedule`.`t19` AS `t19`,`view_schedule`.`t20` AS `t20`,`view_schedule`.`t21` AS `t21`,`view_schedule`.`t22` AS `t22`,`view_schedule`.`t23` AS `t23`,`view_schedule`.`t24` AS `t24`,`view_schedule`.`t25` AS `t25`,`view_schedule`.`t26` AS `t26`,`view_schedule`.`t27` AS `t27`,`view_schedule`.`t28` AS `t28`,`view_schedule`.`t29` AS `t29`,`view_schedule`.`t30` AS `t30`,`view_schedule`.`t31` AS `t31`,`view_schedule`.`t32` AS `t32`,`view_schedule`.`t33` AS `t33`,`view_schedule`.`t34` AS `t34`,`view_schedule`.`t0` AS `t0`,`view_schedule`.`snooze` AS `snooze`,`view_schedule`.`pk_schedule` AS `pk_schedule`,`view_schedule`.`jobType` AS `jobType`,`view_schedule`.`fk_postal` AS `fk_postal`,`setup_postal_codes`.`suburb` AS `suburb`,`setup_postal_codes`.`pk_postal` AS `pk_postal`,`view_schedule`.`timeStart` AS `timeStart`,`view_schedule`.`pk_job` AS `pk_job`,`view_schedule`.`ActionName` AS `ActionName`,`view_schedule`.`pkaction` AS `pkaction`,`view_schedule`.`tName` AS `tName`,`view_schedule`.`tNameShort` AS `tNameShort`,`view_schedule`.`ActionShort` AS `ActionShort`,`view_schedule`.`jobCat` AS `jobCat`,`view_schedule`.`plumberRank` AS `plumberRank`,`view_schedule`.`fk_plumberType` AS `fk_plumberType`,`view_schedule`.`typeName` AS `typeName`,`view_schedule`.`rank` AS `rank`,`view_schedule`.`specifictime` AS `specifictime` from (`view_schedule` join `setup_postal_codes` on((`setup_postal_codes`.`pk_postal` = `view_schedule`.`fk_postal`))) where (`view_schedule`.`cancelled` <> 1);

-- --------------------------------------------------------

--
-- Structure for view `view_solar_fincheck`
--
DROP TABLE IF EXISTS `view_solar_fincheck`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_solar_fincheck` AS select `job_solar_survey`.`id` AS `id`,`job_solar_survey`.`clid` AS `clid`,`job_solar_survey`.`clutility` AS `clutility`,`job_solar_survey`.`problemJob` AS `problemJob`,`job_solar_survey`.`signquote` AS `signquote`,`job_solar_survey`.`proofpay` AS `proofpay`,`job_solar_survey`.`fk_job` AS `fk_job`,`job`.`jbClaimNo` AS `jbClaimNo`,`job_solar_survey`.`datecap` AS `datecap` from (`job_solar_survey` join `job` on((`job`.`pk_job` = `job_solar_survey`.`fk_job`))) where ((`job_solar_survey`.`clid` = _utf8'Yes') and (`job_solar_survey`.`clutility` = _utf8'Yes') and (`job_solar_survey`.`problemJob` = _utf8'No') and (`job_solar_survey`.`proofpay` = _utf8'Yes') and (`job_solar_survey`.`jobgo` = _utf8'No'));

-- --------------------------------------------------------

--
-- Structure for view `view_solar_rebate`
--
DROP TABLE IF EXISTS `view_solar_rebate`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_solar_rebate` AS select `job`.`jbClaimNo` AS `jbClaimNo`,`job_solar_survey`.`jobgo` AS `jobgo`,`job_solar_survey`.`eskomdocs` AS `eskomdocs`,`job_solar_survey`.`eskomrebate` AS `eskomrebate`,`job_solar_survey`.`datecap` AS `datecap` from (`job_solar_survey` join `job` on((`job`.`pk_job` = `job_solar_survey`.`fk_job`))) where ((`job_solar_survey`.`eskomdocs` = _utf8'Yes') and (`job_solar_survey`.`eskomrebate` = _utf8'No'));

--
-- Constraints for dumped tables
--

--
-- Constraints for table `werd`
--
ALTER TABLE `werd`
  ADD CONSTRAINT `fkjob1` FOREIGN KEY (`fk_job`) REFERENCES `job` (`pk_job`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `plumber` FOREIGN KEY (`fk_plumber`) REFERENCES `setup_plumber` (`pk_plumber`) ON DELETE NO ACTION ON UPDATE NO ACTION;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
