-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               8.0.29 - MySQL Community Server - GPL
-- Server OS:                    Win64
-- HeidiSQL Version:             11.2.0.6213
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

-- Dumping structure for table hgagent.stock_returns
CREATE TABLE IF NOT EXISTS `stock_returns` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ref_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `return_date` date NOT NULL,
  `remark` longtext COLLATE utf8mb4_unicode_ci,
  `status` tinyint NOT NULL DEFAULT '1' COMMENT '0:Inactive,1:Active, 2:In progress, 3:Complete',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `delivery_order_id` bigint unsigned DEFAULT NULL,
  `supplier_id` bigint unsigned DEFAULT NULL,
  `warehouse_id` bigint unsigned DEFAULT NULL,
  `stock_transfer_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_returns_employee_id_foreign` (`employee_id`),
  KEY `stock_returns_delivery_order_id_foreign` (`delivery_order_id`),
  KEY `stock_returns_supplier_id_foreign` (`supplier_id`),
  KEY `stock_returns_warehouse_id_foreign` (`warehouse_id`),
  KEY `stock_returns_stock_transfer_id_foreign` (`stock_transfer_id`),
  CONSTRAINT `stock_returns_delivery_order_id_foreign` FOREIGN KEY (`delivery_order_id`) REFERENCES `delivery_orders` (`id`),
  CONSTRAINT `stock_returns_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `stock_returns_stock_transfer_id_foreign` FOREIGN KEY (`stock_transfer_id`) REFERENCES `stock_transfers` (`id`),
  CONSTRAINT `stock_returns_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`),
  CONSTRAINT `stock_returns_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- Dumping data for table hgagent.stock_returns: ~1 rows (approximately)
DELETE FROM `stock_returns`;
/*!40000 ALTER TABLE `stock_returns` DISABLE KEYS */;
INSERT INTO `stock_returns` (`id`, `ref_no`, `return_date`, `remark`, `status`, `deleted_at`, `created_at`, `updated_at`, `employee_id`, `delivery_order_id`, `supplier_id`, `warehouse_id`, `stock_transfer_id`) VALUES
	(1, 'SR-EC00002-00001', '2022-05-31', NULL, 1, NULL, '2022-05-31 17:49:38', '2022-05-31 17:57:16', 2, NULL, 1, 1, 1),
	(2, 'SR-EC00002-00002', '2022-05-25', NULL, 1, NULL, '2022-05-31 17:59:14', '2022-05-31 18:09:17', 2, NULL, 1, 2, 1),
	(3, 'SR-EC00002-00003', '2022-05-31', NULL, 1, NULL, '2022-05-31 18:01:12', '2022-05-31 18:05:17', 5, NULL, 1, 2, 1);
/*!40000 ALTER TABLE `stock_returns` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
