CREATE TABLE `yillikizinkalan` (
	`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
	`personelid` BIGINT(20) NULL DEFAULT NULL,
	`yil` INT(11) NULL DEFAULT NULL,
	`kalan` INT(11) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=0;


alter table personel modify `evtel` VARCHAR(100) NULL DEFAULT NULL;
alter table personel modify `ceptel` VARCHAR(100) NULL DEFAULT NULL;
alter table personel modify `esdurumu` VARCHAR(15) NULL DEFAULT NULL;


alter table personel add `sgk_istencikiskodu` VARCHAR(10) NULL DEFAULT NULL;

alter table personel add `ilksoyad` VARCHAR(60) NULL DEFAULT NULL;
alter table firma add `kontrolno` VARCHAR(20) NULL DEFAULT '0';
alter table firma add `aracino` VARCHAR(20) NULL DEFAULT '0';

alter table `pts_puantaj` add `eksikvar` TINYINT(1) NULL DEFAULT '0' COMMENT 'dvm gec erk eks den harhangi bir var ise';

alter table `pts_donemparametre` add `altgrupid` INT(11) NULL DEFAULT NULL;
alter table pts_genelayarlar add `donemaltgrupkullan` TINYINT(1) NULL DEFAULT '0'  COMMENT 'vardiyali gruplarda altgruplar icin';




alter table personel add `ay` INT(11) NULL DEFAULT NULL COMMENT 'dogumtarihi icin ay alani';
alter table pts_genelayarlar add `odemekullan` TINYINT(1) NULL DEFAULT '0'  COMMENT 'pts_odeme iptal olur kazanckesinti olarak odeme yapmak icin';
alter table pts_genelayarlar add `kisiselbordro` TINYINT(1) NULL DEFAULT '0'  COMMENT 'dizayn ekrani olan ayrintili kisisel bordroyu aktif yapar';
 

alter table grup add `donemtamamlasonramesaiver` TINYINT(1) NULL DEFAULT '0' COMMENT 'donemdeki nc yi tamamlar fazlasını kod=2ye mesai verir';

CREATE TABLE `pts_takimplan` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`takimkod` VARCHAR(5) NULL DEFAULT NULL,
	`grupid` INT(11) NULL DEFAULT NULL,
	`altgrupid` INT(11) NULL DEFAULT NULL,
	`puantajid` INT(11) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB;

alter table pts_genelayarlar add `eksikcalismasubat` TINYINT(1) NULL DEFAULT '0'  COMMENT 'Subat ayı icin';
alter table mailsablon add `dogumgunuolanlar` TINYINT(1) NULL DEFAULT '0';


alter table pts_genelayarlar add `maxmesaisaat` VARCHAR(10) NULL DEFAULT NULL  COMMENT 'resmide max mesai saati icin';


CREATE TABLE `pts_izinad` (
	`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
	`kod` VARCHAR(10) NULL DEFAULT NULL,
	`ad` VARCHAR(60) NULL DEFAULT '0',
	PRIMARY KEY (`id`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=0;

CREATE TABLE `pts_ziyaretci` (
	`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
	`kartfc` VARCHAR(5) NOT NULL DEFAULT '',
	`kartno` VARCHAR(10) NOT NULL DEFAULT '',
	`kartid` VARCHAR(10) NOT NULL DEFAULT '',
	`ad` VARCHAR(60) NULL DEFAULT NULL,
	`soyad` VARCHAR(60) NULL DEFAULT NULL,
	`ceptel` VARCHAR(30) NULL DEFAULT NULL,
	`plaka` VARCHAR(30) NULL DEFAULT NULL,
	`firmaad` VARCHAR(500) NULL DEFAULT NULL,
	`aciklama` VARCHAR(500) NULL DEFAULT NULL,
	`personelturu` VARCHAR(10) NULL DEFAULT NULL, 
	`tarih` DATE NULL DEFAULT NULL,
        `saat` TIME NULL DEFAULT NULL,
	PRIMARY KEY (`id`),
	INDEX `kartno` (`kartno`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=0;

CREATE TABLE `gc_giriscikis2` (
	`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
	`personelid` BIGINT(20) NOT NULL,
	`giristarihi` DATE NULL DEFAULT NULL,
	`girissaati` TIME NULL DEFAULT NULL,
	`cikistarihi` DATE NULL DEFAULT NULL,
	`cikissaati` TIME NULL DEFAULT NULL,
	`toplamsure` VARCHAR(5) NULL DEFAULT NULL,
	`islemturu` VARCHAR(2) NULL DEFAULT NULL,
	`ellegiris` VARCHAR(1) NULL DEFAULT NULL,
	`ellecikis` VARCHAR(1) NULL DEFAULT NULL,
	`aciklama` VARCHAR(60) NULL DEFAULT NULL,
	`surefarki` VARCHAR(6) NULL DEFAULT NULL,
	`isurefarki` INT(11) NULL DEFAULT '0',
	`giristerminalno` VARCHAR(5) NULL DEFAULT NULL,
	`cikisterminalno` VARCHAR(5) NULL DEFAULT NULL,
	`giristerminal` VARCHAR(60) NULL DEFAULT NULL,
	`cikisterminal` VARCHAR(60) NULL DEFAULT NULL,
	`kapino` INT(11) NULL DEFAULT NULL,
	PRIMARY KEY (`id`),
	INDEX `personelid` (`personelid`, `giristarihi`, `girissaati`, `cikistarihi`, `cikissaati`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB;

alter table pts_raporsablonlari add `imza` TINYINT(1) NULL DEFAULT '0';
alter table pts_genelayarlar add `puantajkitle` INT(11) NULL DEFAULT NULL;

alter table kullanici add `yedekkonum` TINYINT(1) NULL DEFAULT '0' COMMENT '0=local 1=server';
alter table grup add `calisma4izin2` TINYINT(1) NULL DEFAULT '0' COMMENT '4 gun calisip 2 gun izin kullananlar';


alter table pts_genelayarlar add `kartnooto` TINYINT(1) NULL DEFAULT '0'  COMMENT 'yeni kayitta kartno yu otomatik arttirmak icin';
alter table personel add `birimid` INT(11) NULL DEFAULT NULL;
alter table personel add `takimid` INT(11) NULL DEFAULT NULL;
alter table personel add `subeid` INT(11) NULL DEFAULT NULL;


 
CREATE TABLE `birim` (
	`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
	`kod` VARCHAR(10) NULL DEFAULT NULL,
	`ad` VARCHAR(60) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=0;

CREATE TABLE `takim` (
	`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
	`kod` VARCHAR(10) NULL DEFAULT NULL,
	`ad` VARCHAR(60) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=0;

CREATE TABLE `sube` (
	`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
	`kod` VARCHAR(10) NULL DEFAULT NULL,
	`ad` VARCHAR(60) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='latin5_turkish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=0;


alter table pts_ziyaretci add `saat` TIME NULL DEFAULT NULL;

