ALTER TABLE `sales_order` ADD COLUMN IF NOT EXISTS `producttype` VARCHAR(20) NULL DEFAULT NULL AFTER `myinvoice`, ADD COLUMN IF NOT EXISTS `assetaccount` VARCHAR(20) NULL DEFAULT NULL AFTER `producttype`, ADD COLUMN IF NOT EXISTS `salesaccount` VARCHAR(20) NULL DEFAULT NULL AFTER `assetaccount`, ADD COLUMN IF NOT EXISTS `expenseaccount` VARCHAR(20) NULL DEFAULT NULL AFTER `salesaccount`;
ALTER TABLE `sales_orderraw` ADD COLUMN IF NOT EXISTS `producttype` VARCHAR(20) NULL DEFAULT NULL AFTER `myinvoice`, ADD COLUMN IF NOT EXISTS `assetaccount` VARCHAR(20) NULL DEFAULT NULL AFTER `producttype`, ADD COLUMN IF NOT EXISTS `salesaccount` VARCHAR(20) NULL DEFAULT NULL AFTER `assetaccount`, ADD COLUMN IF NOT EXISTS `expenseaccount` VARCHAR(20) NULL DEFAULT NULL AFTER `salesaccount`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `currency` VARCHAR(50) NULL DEFAULT NULL AFTER `receiptno`; 
ALTER TABLE `bookroom` ADD COLUMN IF NOT EXISTS `currency` VARCHAR(50) NULL DEFAULT NULL AFTER `id`; 
ALTER TABLE `newstock` ADD COLUMN IF NOT EXISTS `batchno` VARCHAR(20) NOT NULL AFTER `projectid`, ADD COLUMN IF NOT EXISTS `enddate` VARCHAR(20) NOT NULL AFTER `batchno`;  
ALTER TABLE `house` ADD COLUMN IF NOT EXISTS `paymentdetails` TEXT NOT NULL AFTER `id`; 
ALTER TABLE `sales_order` ADD COLUMN IF NOT EXISTS `start` VARCHAR(20) NOT NULL AFTER `expenseaccount`; 
ALTER TABLE `sales_order` ADD COLUMN IF NOT EXISTS `close` VARCHAR(20) NOT NULL AFTER `start`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `salesperson` INT(20) NULL DEFAULT NULL AFTER `savedpoints`, ADD COLUMN IF NOT EXISTS `receiptno` VARCHAR(20) NULL DEFAULT NULL AFTER `salesperson`, ADD COLUMN IF NOT EXISTS `currency` VARCHAR(20) NULL DEFAULT NULL AFTER `receiptno`; 
ALTER TABLE `newstock` ADD COLUMN IF NOT EXISTS `category` VARCHAR(20) NOT NULL AFTER `taxtype`, ADD COLUMN IF NOT EXISTS `projectid` INT(20) NOT NULL AFTER `category`, ADD COLUMN IF NOT EXISTS `batchno` VARCHAR(20) NOT NULL AFTER `projectid`, ADD COLUMN IF NOT EXISTS `enddate` VARCHAR(20) NOT NULL AFTER `batchno`; 
ALTER TABLE `plot` ADD COLUMN IF NOT EXISTS `invoicesms` TEXT NOT NULL AFTER `id`, ADD COLUMN IF NOT EXISTS `receiptsms` TEXT NOT NULL AFTER `id`; 
ALTER TABLE `purchaseorder` ADD COLUMN IF NOT EXISTS `qty` VARCHAR(20) NOT NULL AFTER `branchto`, ADD COLUMN IF NOT EXISTS `EXEMPTED` VARCHAR(20) NOT NULL AFTER `qty`, ADD COLUMN IF NOT EXISTS `ZERORATED` VARCHAR(20) NOT NULL AFTER `EXEMPTED`, ADD COLUMN IF NOT EXISTS `agent` VARCHAR(20) NOT NULL AFTER `ZERORATED`, ADD COLUMN IF NOT EXISTS `paymentmethodes` VARCHAR(20) NOT NULL AFTER `agent`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `bankcode` VARCHAR(20) NULL DEFAULT NULL AFTER `branchid`, ADD COLUMN IF NOT EXISTS `branchcode` VARCHAR(20) NULL DEFAULT NULL AFTER `bankcode`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `group` INT(20) NULL DEFAULT NULL AFTER `branchcode`; 
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `bankcode` VARCHAR(20) NOT NULL DEFAULT 'no' AFTER `receiptlogo`; 
ALTER TABLE `plot` ADD COLUMN IF NOT EXISTS `utility` VARCHAR(20) NOT NULL DEFAULT 'yes' AFTER `receiptsms`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `bankcode` VARCHAR(50) NULL DEFAULT NULL AFTER `branchid`, ADD COLUMN IF NOT EXISTS `branchcode` VARCHAR(50) NULL DEFAULT NULL AFTER `bankcode`, ADD COLUMN IF NOT EXISTS `group` INT(4) NULL DEFAULT NULL AFTER `branchcode`; 
ALTER TABLE `products` ADD COLUMN IF NOT EXISTS `reorderquantity` VARCHAR(20) NULL DEFAULT NULL AFTER `vattype`; 
ALTER TABLE `productlist` ADD COLUMN IF NOT EXISTS `reorderquantity` VARCHAR(20) NULL DEFAULT NULL AFTER `vattype`; 
ALTER TABLE `events` ADD COLUMN IF NOT EXISTS `four` VARCHAR(20) NULL DEFAULT NULL AFTER `id`; 
ALTER TABLE `damages` ADD COLUMN IF NOT EXISTS `branchid` VARCHAR(50) NOT NULL AFTER `balance`;
ALTER TABLE `damages` ADD COLUMN IF NOT EXISTS `invoice` VARCHAR(50) NOT NULL AFTER `branchid`;
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `receiptlogo` VARCHAR(100) NOT NULL AFTER `shortcode`; 
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `menutype` VARCHAR(50) NOT NULL DEFAULT 'Left' AFTER `shortcode`; 


ALTER TABLE `house` ADD COLUMN IF NOT EXISTS `waterno` VARCHAR(30) NOT NULL AFTER `id`, ADD COLUMN IF NOT EXISTS `waterrate` VARCHAR(30) NOT NULL AFTER `id`, ADD COLUMN IF NOT EXISTS `watercharge` VARCHAR(30) NOT NULL AFTER `waterrate`, ADD COLUMN IF NOT EXISTS `watermonth` VARCHAR(30) NOT NULL AFTER `watercharge`, ADD COLUMN IF NOT EXISTS `wateryear` VARCHAR(30) NOT NULL AFTER `watermonth`, ADD COLUMN IF NOT EXISTS `electricityno` VARCHAR(30) NOT NULL AFTER `wateryear`, ADD COLUMN IF NOT EXISTS `electricityrate` VARCHAR(30) NOT NULL AFTER `electricityno`, ADD COLUMN IF NOT EXISTS `electricitycharge` VARCHAR(30) NOT NULL AFTER `electricityrate`, ADD COLUMN IF NOT EXISTS `electricitymonth` VARCHAR(30) NOT NULL AFTER `electricitycharge`, ADD COLUMN IF NOT EXISTS `electricityyear` VARCHAR(30) NOT NULL AFTER `electricitymonth`, ADD COLUMN IF NOT EXISTS `bowholeno` VARCHAR(30) NOT NULL AFTER `electricityyear`, ADD COLUMN IF NOT EXISTS `bowholerate` VARCHAR(30) NOT NULL AFTER `bowholeno`, ADD COLUMN IF NOT EXISTS `bowholecharge` VARCHAR(30) NOT NULL AFTER `bowholerate`, ADD COLUMN IF NOT EXISTS `bowholemonth` VARCHAR(30) NOT NULL AFTER `bowholecharge`, ADD COLUMN IF NOT EXISTS `bowholeyear` VARCHAR(30) NOT NULL AFTER `bowholemonth`;
ALTER TABLE `meterreading` ADD COLUMN IF NOT EXISTS `roomid` INT(20) NULL DEFAULT NULL AFTER `usedqty`;
ALTER TABLE `meterreading` ADD COLUMN IF NOT EXISTS `updatedby` VARCHAR(20) NOT NULL AFTER `id`; 
ALTER TABLE `meterreading` ADD COLUMN IF NOT EXISTS `roomchargeid` INT NOT NULL AFTER `roomid`; 
ALTER TABLE `nhif` ADD COLUMN IF NOT EXISTS `nhifrelief` DECIMAL(10,2) NULL DEFAULT NULL AFTER `userid`;

ALTER TABLE `products` ADD COLUMN IF NOT EXISTS `reorderquantity` VARCHAR(100) NULL DEFAULT NULL AFTER `id`;
ALTER TABLE `productlist` ADD COLUMN IF NOT EXISTS `reorderquantity` VARCHAR(100) NULL DEFAULT NULL AFTER `id` ;

ALTER TABLE `salary` ADD COLUMN IF NOT EXISTS `nhifrelief` DECIMAL(10,2) NOT NULL AFTER `paymenttype`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `nhifrelief` DECIMAL(10,2) NULL DEFAULT NULL AFTER `id`;
ALTER TABLE `products` ADD COLUMN IF NOT EXISTS `hscode` VARCHAR(100) NULL DEFAULT NULL AFTER `reorderquantity`;  
ALTER TABLE `productlist` ADD COLUMN IF NOT EXISTS `hscode` VARCHAR(100) NULL DEFAULT NULL AFTER `reorderquantity`; 
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `hscode` VARCHAR(20) NOT NULL DEFAULT 'YES' AFTER `menutype`; 

ALTER TABLE `bookroom` ADD COLUMN IF NOT EXISTS `tax1` DECIMAL(10,2) NOT NULL AFTER `currency`, ADD COLUMN IF NOT EXISTS `tax2` DECIMAL(10,2) NOT NULL AFTER `tax1`, ADD COLUMN IF NOT EXISTS `vatable` DECIMAL(10,2) NOT NULL AFTER `tax2`;
ALTER TABLE `advance` ADD COLUMN IF NOT EXISTS `plotno` VARCHAR(50) NULL DEFAULT NULL AFTER `branchid`, ADD COLUMN IF NOT EXISTS `houseno` VARCHAR(50) NULL DEFAULT NULL AFTER `plotno`;
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `smslogin` VARCHAR(50) NOT NULL DEFAULT 'no' AFTER `hscode`;
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `smscode` VARCHAR(50) NOT NULL AFTER `transactionid`;
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `timesent` DATETIME NOT NULL AFTER `smscode`;
ALTER TABLE `quotation` ADD COLUMN IF NOT EXISTS `approvedby` INT NULL DEFAULT NULL AFTER `displayvat`;

ALTER TABLE `quotation` ADD COLUMN IF NOT EXISTS `updatedid` INT(11) NOT NULL AFTER `approvedby`, ADD COLUMN IF NOT EXISTS `updateddate` VARCHAR(30) NOT NULL DEFAULT '' AFTER `updatedid`; 

ALTER TABLE `productlist` ADD COLUMN IF NOT EXISTS ( UNIQUE (code, branch) );
ALTER TABLE `stocktaking` ADD COLUMN IF NOT EXISTS ( UNIQUE (code, branchid,startdate) );
ALTER TABLE `purchaseorder` ADD COLUMN IF NOT EXISTS ( UNIQUE (supplier, invoice,branchid) );

ALTER TABLE `stocktaking` ADD COLUMN IF NOT EXISTS `description` TEXT NOT NULL AFTER `maincategory`; 


ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `servicecharge` VARCHAR(20) NOT NULL DEFAULT '3' AFTER `smslogin`; 
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `displayservicecharge` VARCHAR(20) NOT NULL DEFAULT 'no' AFTER `servicecharge`; 
ALTER TABLE `purchaseorder` CHANGE `fromdate` `fromdate` DATETIME NOT NULL; 
ALTER TABLE `purchaseorder` CHANGE `createdate` `createdate` DATETIME NOT NULL; 
ALTER TABLE `purchaseorder` CHANGE `orderdate` `orderdate` DATETIME NOT NULL; 
ALTER TABLE `purchaseorder` CHANGE `updateddate` `updateddate` DATE NOT NULL; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `computerno` TEXT NOT NULL AFTER `timesent`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `computernostatus` VARCHAR(20) NOT NULL DEFAULT 'new' AFTER `computerno`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `computernodate` VARCHAR(50) NOT NULL AFTER `computernostatus`; 
ALTER TABLE `people` ADD COLUMN IF NOT EXISTS `computernouserdata` TEXT NOT NULL AFTER `computernodate`; 
ALTER TABLE `message` ADD COLUMN IF NOT EXISTS `branchid` INT NOT NULL DEFAULT '1' AFTER `companyid`; 
ALTER TABLE `computers` ADD COLUMN IF NOT EXISTS `updatedid` INT NULL DEFAULT NULL AFTER `computernouserdata`; 
ALTER TABLE `roomcharges` ADD COLUMN IF NOT EXISTS `chargeid` INT NULL DEFAULT NULL AFTER `id`; 


ALTER TABLE `roomcharges` ADD COLUMN IF NOT EXISTS ( UNIQUE (roomid, plotno,chargeid) );
ALTER TABLE `tillcollection` ADD COLUMN IF NOT EXISTS `mode` VARCHAR(20) NOT NULL AFTER `short`; 
ALTER TABLE `tillcollection` ADD COLUMN IF NOT EXISTS `remarks` TEXT NOT NULL AFTER `mode`; 
ALTER TABLE `tillcollection` ADD COLUMN IF NOT EXISTS `status` VARCHAR(20) NOT NULL DEFAULT 'Submitted' AFTER `mode`; 
ALTER TABLE `asignrooms` ADD COLUMN IF NOT EXISTS `floor` VARCHAR(20) NOT NULL AFTER `exactdate`; 
ALTER TABLE `asignrooms` CHANGE `plotno` `plotno` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, CHANGE `houseno` `houseno` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `roomsales` ADD COLUMN IF NOT EXISTS `transactioncode` VARCHAR(50) NULL DEFAULT NULL AFTER `invoice`; 
ALTER TABLE `sales_order` CHANGE `mode` `mode` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '16'; 

ALTER TABLE `sales_orderraw` CHANGE `mode` `mode` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '16';
ALTER TABLE `dailycharges` ADD COLUMN IF NOT EXISTS `roomtype` VARCHAR(20) NULL DEFAULT NULL AFTER `id`; 
ALTER TABLE `dailycharges` ADD COLUMN IF NOT EXISTS `idno` VARCHAR(20) NULL DEFAULT NULL AFTER `id`, ADD COLUMN IF NOT EXISTS `phone` VARCHAR(50) NULL DEFAULT NULL AFTER `idno`, ADD COLUMN IF NOT EXISTS `checkin` VARCHAR(30) NULL DEFAULT NULL AFTER `phone`, ADD COLUMN IF NOT EXISTS `checkout` VARCHAR(30) NULL DEFAULT NULL AFTER `checkin`;
ALTER TABLE `dailycharges` ADD COLUMN IF NOT EXISTS `bedid` VARCHAR(20) NULL DEFAULT NULL AFTER `roomtype`, ADD COLUMN IF NOT EXISTS `bedname` VARCHAR(20) NULL DEFAULT NULL AFTER `bedid`; 
ALTER TABLE `bookroom` ADD COLUMN IF NOT EXISTS `updatedid` INT(20) NULL DEFAULT NULL AFTER `id`; 
ALTER TABLE `followups` ADD COLUMN IF NOT EXISTS `dealowner` VARCHAR(20) NULL DEFAULT NULL AFTER `completed`; 

ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `restricttill` VARCHAR(20) NULL DEFAULT 'no' AFTER `displayservicecharge`;  
ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `currency` VARCHAR(20) NOT NULL DEFAULT 'no' AFTER `restricttill`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `change` VARCHAR(20) NOT NULL AFTER `currency`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `othercurrency` VARCHAR(20) NULL DEFAULT NULL AFTER `change`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `othercurrencyamount` VARCHAR(20) NULL DEFAULT NULL AFTER `othercurrency`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `tocurrencyamount` VARCHAR(20) NULL DEFAULT NULL AFTER `othercurrencyamount`; 
ALTER TABLE `branch` ADD COLUMN IF NOT EXISTS `currency` VARCHAR(20) NOT NULL DEFAULT 'KES' AFTER `invoice`; 
ALTER TABLE `branch` ADD COLUMN IF NOT EXISTS `logo` TEXT NOT NULL AFTER `currency`; 
ALTER TABLE `salary` ADD COLUMN IF NOT EXISTS `houselevy` VARCHAR(20) NULL DEFAULT NULL AFTER `nhifrelief`; 
ALTER TABLE `bookroom` ADD COLUMN IF NOT EXISTS `othercurrency` VARCHAR(20) NULL DEFAULT NULL AFTER `updatedid`, ADD COLUMN IF NOT EXISTS `othercurrencyamount` DECIMAL(10,4) NULL DEFAULT NULL AFTER `othercurrency`, ADD COLUMN IF NOT EXISTS `tocurrencyamount` DECIMAL(10,4) NULL DEFAULT NULL AFTER `othercurrencyamount`, ADD COLUMN IF NOT EXISTS `tocurrencychnage` DECIMAL(10,4) NULL DEFAULT NULL AFTER `tocurrencyamount`; 
ALTER TABLE `damages` ADD COLUMN IF NOT EXISTS `buyingprice` VARCHAR(20) NOT NULL AFTER `invoice`, ADD COLUMN IF NOT EXISTS `ttbrice` VARCHAR(20) NOT NULL AFTER `buyingprice`; 


ALTER TABLE `newstock` ADD COLUMN IF NOT EXISTS `frombefore` VARCHAR(20) NOT NULL AFTER `enddate`, ADD COLUMN IF NOT EXISTS `fromafter` VARCHAR(20) NOT NULL AFTER `frombefore`, ADD COLUMN IF NOT EXISTS `fromremoved` VARCHAR(20) NOT NULL AFTER `fromafter`; 
ALTER TABLE `products` ADD COLUMN IF NOT EXISTS `itemclassification` VARCHAR(50) NOT NULL AFTER `hscode`, ADD COLUMN IF NOT EXISTS `country` VARCHAR(50) NOT NULL AFTER `itemclassification`, ADD COLUMN IF NOT EXISTS `itemtype` VARCHAR(50) NOT NULL AFTER `country`, ADD COLUMN IF NOT EXISTS `packagingunit` VARCHAR(50) NOT NULL AFTER `itemtype`, ADD COLUMN IF NOT EXISTS `salesunit` VARCHAR(50) NOT NULL AFTER `packagingunit`; 
ALTER TABLE `products` ADD COLUMN IF NOT EXISTS `itemstatus` VARCHAR(50) NOT NULL AFTER `salesunit`, ADD COLUMN IF NOT EXISTS `itemtax` VARCHAR(50) NOT NULL AFTER `itemstatus`; 
ALTER TABLE `productlist` ADD COLUMN IF NOT EXISTS `itemclassification` VARCHAR(50) NOT NULL AFTER `hscode`, ADD COLUMN IF NOT EXISTS `country` VARCHAR(50) NOT NULL AFTER `itemclassification`, ADD COLUMN IF NOT EXISTS `itemtype` VARCHAR(50) NOT NULL AFTER `country`, ADD COLUMN IF NOT EXISTS `packagingunit` VARCHAR(50) NOT NULL AFTER `itemtype`, ADD COLUMN IF NOT EXISTS `salesunit` VARCHAR(50) NOT NULL AFTER `packagingunit`;
ALTER TABLE `productlist` ADD COLUMN IF NOT EXISTS `itemstatus` VARCHAR(50) NOT NULL AFTER `salesunit`, ADD COLUMN IF NOT EXISTS `itemtax` VARCHAR(50) NOT NULL AFTER `itemstatus` ;
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `currcptno` VARCHAR(50) NOT NULL AFTER `tocurrencyamount`, ADD COLUMN IF NOT EXISTS `totrcptno` VARCHAR(50) NOT NULL AFTER `currcptno`, ADD COLUMN IF NOT EXISTS `intrldata` TEXT NOT NULL AFTER `totrcptno`, ADD COLUMN IF NOT EXISTS `rcptsign` TEXT NOT NULL AFTER `intrldata`, ADD COLUMN IF NOT EXISTS `sdcdatetime` VARCHAR(50) NOT NULL AFTER `rcptsign`;
ALTER TABLE `purchaseorder` ADD COLUMN IF NOT EXISTS `taxblAmtD` VARCHAR(50) NOT NULL AFTER `paymentmethodes`, ADD COLUMN IF NOT EXISTS `taxblAmtE` VARCHAR(50) NOT NULL AFTER `taxblAmtD`, ADD COLUMN IF NOT EXISTS `taxRtA` VARCHAR(50) NOT NULL AFTER `taxblAmtE`, ADD COLUMN IF NOT EXISTS `taxRtC` VARCHAR(50) NOT NULL AFTER `taxRtA`, ADD COLUMN IF NOT EXISTS `taxRtD` VARCHAR(50) NOT NULL AFTER `taxRtC`, ADD COLUMN IF NOT EXISTS `taxRtE` VARCHAR(50) NOT NULL AFTER `taxRtD`; 
ALTER TABLE `purchaseorder` ADD COLUMN IF NOT EXISTS `taxblAmtB` VARCHAR(50) NOT NULL AFTER `taxRtE`;
ALTER TABLE `newstock` ADD COLUMN IF NOT EXISTS `taskCd` VARCHAR(50) NOT NULL AFTER `fromremoved`, ADD COLUMN IF NOT EXISTS `itemSeq` VARCHAR(50) NOT NULL AFTER `taskCd`,ADD COLUMN IF NOT EXISTS `imptItemsttsCd` VARCHAR(50) NOT NULL AFTER `itemSeq`; 
ALTER TABLE `purchaseorder` ADD COLUMN IF NOT EXISTS `taxAmtA` VARCHAR(50) NULL DEFAULT NULL AFTER `taxblAmtB`, ADD COLUMN IF NOT EXISTS `taxAmtB` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtA`, ADD COLUMN IF NOT EXISTS `taxAmtC` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtB`, ADD COLUMN IF NOT EXISTS `taxAmtD` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtC`, ADD COLUMN IF NOT EXISTS `taxAmtE` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtD`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `taxblAmtA` VARCHAR(50) NULL DEFAULT NULL AFTER `sdcdatetime`, ADD COLUMN IF NOT EXISTS `taxblAmtB` VARCHAR(50) NULL DEFAULT NULL AFTER `taxblAmtA`, ADD COLUMN IF NOT EXISTS `taxblAmtC` VARCHAR(50) NULL DEFAULT NULL AFTER `taxblAmtB`, ADD COLUMN IF NOT EXISTS `taxblAmtD` VARCHAR(50) NULL DEFAULT NULL AFTER `taxblAmtC`, ADD COLUMN IF NOT EXISTS `taxblAmtE` VARCHAR(50) NULL DEFAULT NULL AFTER `taxblAmtD`, ADD COLUMN IF NOT EXISTS `taxAmtA` VARCHAR(50) NULL DEFAULT NULL AFTER `taxblAmtE`, ADD COLUMN IF NOT EXISTS `taxAmtB` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtA`, ADD COLUMN IF NOT EXISTS `taxAmtC` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtB`, ADD COLUMN IF NOT EXISTS `taxAmtD` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtC`, ADD COLUMN IF NOT EXISTS `taxAmtE` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtD`, ADD COLUMN IF NOT EXISTS `taxRtA` VARCHAR(50) NULL DEFAULT NULL AFTER `taxAmtE`, ADD COLUMN IF NOT EXISTS `taxRtB` VARCHAR(50) NULL DEFAULT NULL AFTER `taxRtA`, ADD COLUMN IF NOT EXISTS `taxRtC` VARCHAR(50) NULL DEFAULT NULL AFTER `taxRtB`, ADD COLUMN IF NOT EXISTS `taxRtD` VARCHAR(50) NULL DEFAULT NULL AFTER `taxRtC`, ADD COLUMN IF NOT EXISTS `taxRtE` VARCHAR(50) NULL DEFAULT NULL AFTER `taxRtD`; 
ALTER TABLE `sales_orderraw` ADD COLUMN IF NOT EXISTS `taxcode` VARCHAR(50) NULL DEFAULT NULL AFTER `expenseaccount`; 
ALTER TABLE `sales_order` ADD COLUMN IF NOT EXISTS `taxcode` VARCHAR(50) NULL DEFAULT NULL AFTER `expenseaccount`; 
ALTER TABLE `charges` ADD COLUMN IF NOT EXISTS `hscode` VARCHAR(50) NOT NULL AFTER `companyid`, ADD COLUMN IF NOT EXISTS `itemclassification` VARCHAR(50) NOT NULL AFTER `hscode`, ADD COLUMN IF NOT EXISTS `country` VARCHAR(50) NOT NULL AFTER `itemclassification`, ADD COLUMN IF NOT EXISTS `itemtype` VARCHAR(50) NOT NULL AFTER `country`, ADD COLUMN IF NOT EXISTS `packagingunit` VARCHAR(50) NOT NULL AFTER `itemtype`, ADD COLUMN IF NOT EXISTS `salesunit` VARCHAR(50) NOT NULL AFTER `packagingunit` ;
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `sdcId` TEXT NOT NULL AFTER `taxRtE`, ADD COLUMN IF NOT EXISTS `mrcNo` TEXT NOT NULL AFTER `sdcId`; 

ALTER TABLE `plot` ADD COLUMN IF NOT EXISTS `service` VARCHAR(50) NOT NULL DEFAULT 'no' AFTER `utility`; ALTER TABLE `plot` ADD COLUMN IF NOT EXISTS `servicedeposit` VARCHAR(10) NULL DEFAULT 'no' AFTER `service`, ADD COLUMN IF NOT EXISTS `lease` VARCHAR(10) NULL DEFAULT 'no' AFTER `servicedeposit`; 

ALTER TABLE `stock` ADD COLUMN IF NOT EXISTS `shift` VARCHAR(50) NULL DEFAULT NULL AFTER `id`; 


ALTER TABLE `smsconfig` ADD COLUMN IF NOT EXISTS `etims` VARCHAR(50) NOT NULL DEFAULT 'no' AFTER `currency`, ADD COLUMN IF NOT EXISTS `etimsonline` VARCHAR(50) NOT NULL DEFAULT 'no' AFTER `etims`; 
ALTER TABLE `sales` ADD COLUMN IF NOT EXISTS `salesdump` TEXT NOT NULL AFTER `mrcNo`, ADD COLUMN IF NOT EXISTS `receiptdump` TEXT NOT NULL AFTER `salesdump`, ADD COLUMN IF NOT EXISTS `etimsstatus` INT NOT NULL DEFAULT '0' AFTER `receiptdump`, ADD COLUMN IF NOT EXISTS `itemsstockmaster` TEXT NOT NULL AFTER `etimsstatus`; 
ALTER TABLE `expenses` ADD COLUMN IF NOT EXISTS `department` VARCHAR(50) NULL DEFAULT NULL AFTER `monthlyrate`; 

ALTER TABLE `uomproducts` ADD COLUMN IF NOT EXISTS `unitprice` INT(20) NULL DEFAULT '0' AFTER `id`;

ALTER TABLE `advancepayment` ADD COLUMN IF NOT EXISTS `branchid` INT(20) NULL DEFAULT '1' AFTER `advanceid`;
ALTER TABLE `uomproducts` CHANGE `unitprice` `unitprice` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `stock` ADD COLUMN IF NOT EXISTS `bprice` VARCHAR(20) NOT NULL AFTER `shift`, ADD COLUMN IF NOT EXISTS `profit` VARCHAR(20) NOT NULL AFTER `bprice`;
ALTER TABLE `purchaseorderlist` ADD COLUMN IF NOT EXISTS `total` VARCHAR(20) NOT NULL AFTER `serial`;
ALTER TABLE `purchaseorder` ADD COLUMN IF NOT EXISTS `withholdingrate` VARCHAR(20) NULL DEFAULT NULL AFTER `taxAmtE`, ADD COLUMN IF NOT EXISTS `withholdingamount` VARCHAR(20) NULL DEFAULT NULL AFTER `withholdingrate`;
ALTER TABLE `quotation` ADD COLUMN IF NOT EXISTS `department` INT NULL DEFAULT NULL AFTER `updateddate`;


ALTER TABLE `sms_in` ADD COLUMN IF NOT EXISTS `branchid` INT(20) NULL DEFAULT '1' AFTER `id`;


ALTER TABLE `tills` ADD COLUMN IF NOT EXISTS `invoice` VARCHAR(20) NOT NULL AFTER `id`;
ALTER TABLE `tills` ADD COLUMN IF NOT EXISTS `branchid` INT NOT NULL DEFAULT '1' AFTER `invoice`;
ALTER TABLE `sms_in` ADD COLUMN IF NOT EXISTS `branchid` INT(20) NULL DEFAULT '1' AFTER `OrgAccountBalance`;

