-- Evrak ücreti ve manuel gider tablosu
ALTER TABLE `arac_evraklari` ADD COLUMN `ucret` decimal(10,2) DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `arac_giderleri` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `arac_id` int(11) NOT NULL,
  `tarih` date NOT NULL,
  `tutar` decimal(10,2) NOT NULL DEFAULT 0,
  `aciklama` varchar(255) DEFAULT NULL,
  `firma_id` int(11) DEFAULT 1,
  `olusturma_tarihi` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `arac_id` (`arac_id`),
  KEY `firma_id` (`firma_id`),
  CONSTRAINT `fk_gider_arac` FOREIGN KEY (`arac_id`) REFERENCES `araclar` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
