CREATE TABLE IF NOT EXISTS `receipt_configs` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(128) NOT NULL,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `number_format` VARCHAR(64) NOT NULL DEFAULT 'PAR/%N/%M/%Y',
  `numbering_type` ENUM('monthly','yearly') NOT NULL DEFAULT 'monthly',
  `is_named` TINYINT(1) NOT NULL DEFAULT 0,
  `sale_date_source` ENUM('order_date','payment_date','issue_date') NOT NULL DEFAULT 'issue_date',
  `order_reference` ENUM('none','orderpro','integration') NOT NULL DEFAULT 'none',
  `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
