INSERT INTO `systemsettings` (`type`, `value`, `description`, `active`, `created`, `createdById`, `updated`, `updatedById`) VALUES
    ('get_invoice_due_date_after_shipped', 0, 'Get invoice due date base on shipment date after shipped / invoice date after converted to invoice', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10);

ALTER TABLE `termsrule` ADD COLUMN `monthly`  tinyint(1) NOT NULL AFTER `baseOnInvoice`;
CREATE INDEX `monthly` ON `termsrule`(`monthly`) USING BTREE ;

INSERT INTO `termsrule` (`name`, `nextMonth`, `baseOnInvoice`, `monthly`, `active`, `created`, `createdById`, `updated`, `updatedById`) VALUES
    ('end of the following month', 0, 1, 1, 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10);
