UPDATE `sys_config` SET `key` = '基础抵扣额' WHERE `owner` = 'system' AND `app` = 'hr' AND `module` = 'salary' AND `section` = 'exemption' AND `key` = '基础抵税额';
UPDATE `sys_config` SET `key` = '报销'       WHERE `owner` = 'system' AND `app` = 'hr' AND `module` = 'salary' AND `section` = 'exemption' AND `key` = '发票';
UPDATE `sys_config` SET `value` = REPLACE(`value`, 'benefit', 'performance') WHERE `owner` = 'system' AND `app` = 'hr' AND `module` = 'salary' AND `key` = 'basic';
UPDATE `ameba_statement` SET `category` = 'performance' WHERE `category` = 'benefit';
UPDATE `ameba_budget` SET `category` = 'performance' WHERE `category` = 'benefit';

ALTER TABLE `ameba_budget` ADD `tradeDept` mediumint(8) unsigned NOT NULL AFTER `amebaAccount`;
ALTER TABLE `oa_refund` ADD `refundCompany` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `oa_refund` ADD `type` enum('reimburse', 'deduction') NOT NULL DEFAULT 'reimburse' AFTER `refundCompany`;
ALTER TABLE `oa_refund` ADD `deductionMonth` char(6) NOT NULL AFTER `type`;
ALTER TABLE `sys_team`  ADD `rate` decimal(6,2) unsigned NOT NULL AFTER `contribution`;
ALTER TABLE `sys_company` CHANGE `name` `name` char(100) NOT NULL;
ALTER TABLE `sys_company` CHANGE `bankName` `bankName` char(100) NOT NULL;
ALTER TABLE `hr_salary` CHANGE `month` `month` char(6) NOT NULL;
ALTER TABLE `hr_salary` CHANGE `benefit` `performance` decimal(12,2) NOT NULL;
ALTER TABLE `hr_commissionrule` CHANGE `month` `month` char(6) NOT NULL;

-- DROP TABLE IF EXISTS `hr_bonus`;
CREATE TABLE IF NOT EXISTS `hr_bonus` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `account` char(30) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `performance` decimal(12,2) NOT NULL,
  `bonus` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `status` enum('wait', 'confirmed') NOT NULL DEFAULT 'wait',
  PRIMARY KEY (`id`),
  KEY `month` (`month`),
  KEY `account` (`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
