Advertisement
agusheriyanto

[kas] alter 2022-06-21

Jun 24th, 2022 (edited)
188
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE `rm_purchasing_req` (
  2.   `rm_purchasing_req_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  3.   `rm_purchasing_req_code` varchar(50) NOT NULL,
  4.   `rm_purchasing_req_delivery_address` text,
  5.   `rm_purchasing_req_date` date NOT NULL,
  6.   `rm_purchasing_req_note` text,
  7.   `rm_purchasing_req_status` enum('closed','open') NOT NULL DEFAULT 'open' COMMENT 'penanda data request yang muncul ketika create po',
  8.   `rm_purchasing_req_input_datetime` datetime NOT NULL,
  9.   `rm_purchasing_req_input_admin_id` int(10) unsigned NOT NULL,
  10.   PRIMARY KEY (`rm_purchasing_req_id`),
  11.   UNIQUE KEY `rm_purchasing_req_code` (`rm_purchasing_req_code`)
  12. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='tabel request pembelian barang';
  13.  
  14. CREATE TABLE `rm_purchasing_req_detail` (
  15.   `rm_purchasing_req_detail_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  16.   `rm_purchasing_req_detail_rm_purchasing_req_id` int(10) unsigned NOT NULL,
  17.   `rm_purchasing_req_detail_raw_material_id` int(10) unsigned NOT NULL,
  18.   `rm_purchasing_req_detail_raw_material_code` varchar(20) NOT NULL,
  19.   `rm_purchasing_req_detail_raw_material_name` varchar(255) DEFAULT NULL,
  20.   `rm_purchasing_req_detail_raw_material_unit` varchar(20) DEFAULT NULL,
  21.   `rm_purchasing_req_detail_quantity` decimal(15,2) NOT NULL DEFAULT '0.00',
  22.   PRIMARY KEY (`rm_purchasing_req_detail_id`)
  23. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='tabel request detail pembelian barang';
  24.  
  25. ALTER TABLE `rm_purchasing`
  26. ADD `rm_purcashing_rm_purchasing_req_id` INT(10)  UNSIGNED  NOT NULL  COMMENT 'id request pembelian'  AFTER `rm_purchasing_id`,
  27. ADD `rm_purchasing_extra_discount_type` ENUM('percent','value')  NULL  DEFAULT NULL  AFTER `rm_purchasing_total_price`,
  28. ADD `rm_purchasing_extra_discount_percent` DECIMAL(5,2)  NOT NULL  DEFAULT '0.00'  AFTER `rm_purchasing_extra_discount_type`,
  29. CHANGE `rm_purchasing_extra_discount` `rm_purchasing_extra_discount_value` DECIMAL(15,2)  NOT NULL  DEFAULT '0.00';
  30.  
  31. ALTER TABLE `rm_purchasing_detail`
  32. ADD `rm_purchasing_detail_subtotal_price` DECIMAL(15,2)  NOT NULL  DEFAULT '0.00'  AFTER `rm_purchasing_detail_unit_price`,
  33. ADD `rm_purchasing_detail_discount_type` ENUM('percent','value')  NULL  DEFAULT NULL  AFTER `rm_purchasing_detail_subtotal_price`,
  34. ADD `rm_purchasing_detail_discount_percent` DECIMAL(5,2)  NOT NULL  DEFAULT '0.00'  AFTER `rm_purchasing_detail_discount_type`,
  35. ADD `rm_purchasing_detail_discount_value` DECIMAL(15,2)  NOT NULL  DEFAULT '0.00'  AFTER `rm_purchasing_detail_discount_percent`,
  36. ADD `rm_purchasing_detail_subtotal_nett_price` DECIMAL(15,2)  NOT NULL  DEFAULT '0.00'  AFTER `rm_purchasing_detail_discount_value`;
  37.  
  38.  
  39. CREATE TABLE `rm_purchasing_config` (
  40.   `rm_purchasing_config_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  41.   `rm_purchasing_config_admin_group_id` int(10) unsigned NOT NULL,
  42.   `rm_purchasing_config_value_min` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT 'nilai minimal data muncul, jika nol maka tidak ada batas minimal',
  43.   `rm_purchasing_config_value_max` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT 'nilai maksimal data muncul, jika nol maka tidak ada batas maksimal',
  44.   PRIMARY KEY (`rm_purchasing_config_id`)
  45. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='tabel konfigurasi approval pembelian barang berdasarkan nilai pembelian';
Advertisement
RAW Paste Data Copied
Advertisement