-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `check`
--

-- --------------------------------------------------------

--
-- Table structure for table `balances`
--

CREATE TABLE `balances` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `transaction_id` bigint(20) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `opening_balance` double(15,2) DEFAULT NULL,
  `closing_balance` double(15,2) DEFAULT NULL,
  `commission` double(15,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `expense_type_id` bigint(20) DEFAULT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amount` double(8,2) DEFAULT NULL,
  `note` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `expense_types`
--

CREATE TABLE `expense_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `connection` text COLLATE utf8_unicode_ci NOT NULL,
  `queue` text COLLATE utf8_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `opening_balance_inr` double(15,4) NOT NULL DEFAULT 0.0000,
  `opening_balance_aed` double(15,4) NOT NULL DEFAULT 0.0000,
  `opening_balance_usd` double(15,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `group_closing_balances`
--

CREATE TABLE `group_closing_balances` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `group_id` int(11) NOT NULL,
  `closing_balance_inr` double(15,4) DEFAULT NULL,
  `closing_balance_aed` double(15,4) DEFAULT NULL,
  `closing_balance_usd` double(15,4) DEFAULT NULL,
  `closing_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `int_transactions`
--

CREATE TABLE `int_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  `client_name` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
  `currency` tinyint(4) NOT NULL COMMENT '1=Indian, 2=USD',
  `amount` double(15,4) NOT NULL,
  `inr_conversation_rate` double(15,4) DEFAULT NULL,
  `usd_conversation_rate` double(15,4) DEFAULT NULL,
  `aed_amount` double(15,4) NOT NULL,
  `s_aed_amount` double(15,4) DEFAULT NULL,
  `s_inr_amount` double(15,4) DEFAULT NULL,
  `s_usd_amount` double(15,2) DEFAULT NULL,
  `s_usd_inr_amount` double(15,2) DEFAULT NULL,
  `usd_amount` double(15,4) DEFAULT NULL,
  `inr_amount` double(15,4) DEFAULT NULL,
  `created_at` date NOT NULL,
  `payment_mode` char(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci DEFAULT NULL,
  `type` tinyint(4) DEFAULT NULL COMMENT '1=Cut,2=Book',
  `payment_received` tinyint(4) DEFAULT NULL COMMENT '1=Yes,0=No',
  `payment_given` tinyint(4) DEFAULT NULL COMMENT '1=Yes,2=No',
  `opening_balance_inr` double(15,4) NOT NULL DEFAULT 0.0000,
  `opening_balance_aed` double(15,4) NOT NULL DEFAULT 0.0000,
  `opening_balance_usd` double(15,4) NOT NULL DEFAULT 0.0000,
  `closing_balance_inr` double(15,4) NOT NULL DEFAULT 0.0000,
  `closing_balance_aed` double(15,4) NOT NULL DEFAULT 0.0000,
  `closing_balance_usd` double(15,4) NOT NULL DEFAULT 0.0000,
  `created_date_time` datetime DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(13, '2021_02_03_000000_create_failed_jobs_table', 1),
(14, '2021_02_03_000000_create_users_table', 1),
(15, '2021_02_03_100000_create_password_resets_table', 1),
(16, '2021_07_08_121847_create_settings_table', 1),
(17, '2021_08_04_093714_create_balances_table', 1),
(18, '2021_08_04_093722_create_expenses_table', 1),
(19, '2021_08_04_093724_create_expense_types_table', 1),
(20, '2021_08_04_093726_create_groups_table', 1),
(21, '2021_08_04_093728_create_group_closing_balances_table', 1),
(22, '2021_08_04_093730_create_int_transactions_table', 1),
(23, '2021_08_04_093737_create_payments_table', 1),
(24, '2021_08_04_104206_create_transactions_table', 1);

-- --------------------------------------------------------

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `group_id` int(11) DEFAULT NULL,
  `amount` double(15,4) NOT NULL,
  `client_name` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
  `opening_balance_inr` double(15,4) NOT NULL,
  `opening_balance_aed` double(15,4) NOT NULL,
  `opening_balance_usd` double(15,4) NOT NULL,
  `closing_balance_inr` double(15,4) NOT NULL,
  `closing_balance_aed` double(15,4) NOT NULL,
  `closing_balance_usd` double(15,4) NOT NULL,
  `created_at` date NOT NULL,
  `created_date_time` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `type` enum('BOOLEAN','NUMBER','DATE','TEXT','SELECT','FILE','TEXTAREA') COLLATE utf8_unicode_ci DEFAULT NULL,
  `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `value` longtext COLLATE utf8_unicode_ci DEFAULT NULL,
  `hidden` varchar(191) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `code`, `type`, `label`, `value`, `hidden`, `created_at`, `updated_at`) VALUES
(1, 'application_logo', 'FILE', 'Application logo', 'VfCEKcFE0t.jpg', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(2, 'application_title', 'TEXT', 'Application Title', 'SMN', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(3, 'favicon_logo', 'FILE', 'Favicon Logo', 'quTPXQDbDe.png', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(4, 'copyright', 'TEXT', 'Copy Right', 'SMN', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(5, 'indian_balance', 'TEXT', 'Indian Balance', '0', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(6, 'dubai_balance', 'TEXT', 'Dubai Balance', '0', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(7, 'conversation_rate', 'TEXT', 'Conversation Rate', '4325', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(8, 'usd_balance', 'TEXT', 'Usd Balance', '0', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(9, 'conversation_rate_inr', 'TEXT', 'Conversation Rate Inr', '4818', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(10, 'conversation_rate_usd', 'TEXT', 'Conversation Rate Usd', '3.6725', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(11, 'conversation_rate_aed_to_inr', 'TEXT', 'Conversation Rate Aed To Inr', '4818', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31'),
(12, 'conversation_rate_aed_to_usd', 'TEXT', 'Conversation Rate Aed To Usd', '3.6725', '0', '2021-08-04 08:14:31', '2021-08-04 08:14:31');

-- --------------------------------------------------------

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_by` bigint(20) DEFAULT NULL,
  `accepted_by` bigint(20) DEFAULT NULL,
  `from_user_id` bigint(20) DEFAULT NULL,
  `to_user_id` bigint(20) DEFAULT NULL,
  `from_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `from_commission_amount` double(15,2) DEFAULT NULL,
  `from_commission` double(8,2) DEFAULT NULL,
  `from_current_balance` double(15,2) DEFAULT NULL,
  `from_total_balance` double(15,2) DEFAULT NULL,
  `from_closing_balance` double(15,2) DEFAULT NULL,
  `amount` double(15,2) DEFAULT NULL,
  `to_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `to_commission_amount` double(15,2) DEFAULT NULL,
  `to_commission` double(15,2) DEFAULT NULL,
  `to_current_balance` double(15,2) DEFAULT NULL,
  `to_total_balance` double(15,2) DEFAULT NULL,
  `to_closing_balance` double(15,2) DEFAULT NULL,
  `profit` double(15,2) DEFAULT NULL,
  `transaction_profit` double(15,2) DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sender_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sender_contact` bigint(20) DEFAULT NULL,
  `receiver_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `receiver_contact` bigint(20) DEFAULT NULL,
  `transaction_type` enum('1','2','3','4') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1' COMMENT '1=Auto, 2=Manual, 3=Normal',
  `status` enum('1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1' COMMENT '1=Placed,2=Approved,3=Rejected',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`id`, `created_by`, `accepted_by`, `from_user_id`, `to_user_id`, `from_name`, `from_commission_amount`, `from_commission`, `from_current_balance`, `from_total_balance`, `from_closing_balance`, `amount`, `to_name`, `to_commission_amount`, `to_commission`, `to_current_balance`, `to_total_balance`, `to_closing_balance`, `profit`, `transaction_profit`, `remarks`, `sender_name`, `sender_contact`, `receiver_name`, `receiver_contact`, `transaction_type`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, NULL, 2, 3, 'ahat kalyan', NULL, 100.50, 0.00, 100.50, 100.50, NULL, 'afnan kalyna', NULL, 100.30, 0.00, 100.30, -100.30, 0.20, 0.20, 'REMARKS', 'SENDER NAME', 8488080145, 'RECEIVER NAME', 9537981170, '4', '2', '2021-08-10 07:53:19', '2021-08-10 07:53:19', NULL),
(2, 1, NULL, 4, 5, 'vijay ahemadnagar', NULL, 100.50, 0.00, 10055.00, 10055.00, NULL, 'ajit thane', NULL, 100.30, 0.00, 10032.50, -10032.50, 22.50, 22.50, 'REMARKS', 'SENDER NAME', 8488080145, 'RECEIVER NAME', 9537981170, '4', '2', '2021-08-10 07:56:16', '2021-08-10 07:56:16', NULL),
(3, 1, NULL, 4, 5, 'vijay ahemadnagar', NULL, 10.05, 10055.00, 10055.00, 20110.00, NULL, 'ajit thane', NULL, 10.03, -10032.50, 10032.50, -20065.00, 22.50, 22.50, 'REMARKS', 'SENDER NAME', 8488080145, 'RECEIVER NAME', 9537981170, '4', '2', '2021-08-10 07:59:25', '2021-08-10 07:59:25', NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `balances`
--
ALTER TABLE `balances`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `expense_types`
--
ALTER TABLE `expense_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `groups`
--
ALTER TABLE `groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `group_closing_balances`
--
ALTER TABLE `group_closing_balances`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `int_transactions`
--
ALTER TABLE `int_transactions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `balances`
--
ALTER TABLE `balances`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expenses`
--
ALTER TABLE `expenses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expense_types`
--
ALTER TABLE `expense_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `groups`
--
ALTER TABLE `groups`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `group_closing_balances`
--
ALTER TABLE `group_closing_balances`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `int_transactions`
--
ALTER TABLE `int_transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;

