update plugins sync and database default file for init

This commit is contained in:
Hesabix 2025-07-23 14:21:39 +00:00
parent aa02ea0925
commit a638f22e3c
5 changed files with 594 additions and 47 deletions

10
.env.local.php Normal file
View file

@ -0,0 +1,10 @@
<?php
return [
'APP_ENV' => 'prod',
'APP_SECRET' => 'f56179673fa562596e7fc565778a60f1',
'MESSENGER_TRANSPORT_DSN' => 'doctrine://default?auto_setup=0',
'MAILER_DSN' => 'null://null',
'CORS_ALLOW_ORIGIN' => '*',
'LOCK_DSN' => 'flock',
'DATABASE_URL' => 'mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4',
];

View file

@ -3,8 +3,8 @@
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 21, 2025 at 08:34 PM
-- Server version: 8.0.41-0ubuntu0.24.04.1
-- Generation Time: Jul 23, 2025 at 02:10 PM
-- Server version: 8.0.42-0ubuntu0.24.04.2
-- PHP Version: 8.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@ -18,7 +18,7 @@ SET time_zone = "+00:00";
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `hesabix`
-- Database: `hesabix_next_hesabix_ir`
--
-- --------------------------------------------------------
@ -45,6 +45,58 @@ CREATE TABLE `accounting_package_order` (
-- --------------------------------------------------------
--
-- Table structure for table `account_to_sheba_inquiry`
--
CREATE TABLE `account_to_sheba_inquiry` (
`id` int NOT NULL,
`cache_key` varchar(50) NOT NULL,
`sheba_data` json NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `aiconversation`
--
CREATE TABLE `aiconversation` (
`id` int NOT NULL,
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` int NOT NULL,
`updated_at` int NOT NULL,
`is_active` tinyint(1) DEFAULT NULL,
`deleted` tinyint(1) DEFAULT NULL,
`user_id` int NOT NULL,
`business_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `aimessage`
--
CREATE TABLE `aimessage` (
`id` int NOT NULL,
`role` varchar(20) NOT NULL,
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` int NOT NULL,
`input_tokens` int DEFAULT NULL,
`output_tokens` int DEFAULT NULL,
`input_cost` double DEFAULT NULL,
`output_cost` double DEFAULT NULL,
`total_cost` double DEFAULT NULL,
`model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`agent_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`conversation_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `apitoken`
--
@ -54,7 +106,8 @@ CREATE TABLE `apitoken` (
`bid_id` int DEFAULT NULL,
`submitter_id` int NOT NULL,
`token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`date_expire` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
`date_expire` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`is_for_ai` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
@ -104,6 +157,22 @@ CREATE TABLE `archive_orders` (
-- --------------------------------------------------------
--
-- Table structure for table `back_built_module`
--
CREATE TABLE `back_built_module` (
`id` int NOT NULL,
`date_submit` varchar(40) NOT NULL,
`code` longtext,
`locked` tinyint(1) DEFAULT NULL,
`public` tinyint(1) DEFAULT NULL,
`type` varchar(120) NOT NULL,
`submitter_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `bank_account`
--
@ -191,6 +260,19 @@ CREATE TABLE `business_money` (
-- --------------------------------------------------------
--
-- Table structure for table `card_to_sheba_inquiry`
--
CREATE TABLE `card_to_sheba_inquiry` (
`id` int NOT NULL,
`card_number` varchar(16) NOT NULL,
`sheba_data` json NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cashdesk`
--
@ -243,7 +325,10 @@ CREATE TABLE `cheque` (
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`locked` tinyint(1) DEFAULT NULL,
`date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`rejected` tinyint(1) DEFAULT NULL
`rejected` tinyint(1) DEFAULT NULL,
`transfered` tinyint(1) DEFAULT NULL,
`transfer_date` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`money_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
@ -430,19 +515,22 @@ CREATE TABLE `hesabdari_doc` (
`date_submit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`code` bigint NOT NULL,
`code` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
`des` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`amount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`amount` decimal(30,0) DEFAULT NULL,
`mdate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`plugin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`ref_data` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`shortlink` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`wallet_transaction_id` int DEFAULT NULL,
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`temp_status` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '(DC2Type:array)',
`temp_status` json DEFAULT NULL,
`invoice_label_id` int DEFAULT NULL,
`project_id` int DEFAULT NULL,
`salesman_id` int DEFAULT NULL
`salesman_id` int DEFAULT NULL,
`tax_percent` double DEFAULT NULL,
`discount_type` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`discount_percent` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
@ -474,16 +562,18 @@ CREATE TABLE `hesabdari_row` (
`bid_id` int NOT NULL,
`year_id` int NOT NULL,
`commodity_id` int DEFAULT NULL,
`commdity_count` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`commdity_count` decimal(20,4) DEFAULT NULL,
`salary_id` int DEFAULT NULL,
`cashdesk_id` int DEFAULT NULL,
`referral` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`ref_data` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`plugin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`temp_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '(DC2Type:array)',
`temp_data` json DEFAULT NULL,
`cheque_id` int DEFAULT NULL,
`discount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`tax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
`tax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`discount_type` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
`discount_percent` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
@ -702,9 +792,9 @@ CREATE TABLE `messenger_messages` (
`body` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`headers` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`queue_name` varchar(190) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
`available_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
`delivered_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)'
`created_at` datetime NOT NULL,
`available_at` datetime NOT NULL,
`delivered_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
@ -851,7 +941,13 @@ CREATE TABLE `permission` (
`plug_accpro_rfsell` tinyint(1) DEFAULT NULL,
`plug_accpro_accounting` tinyint(1) DEFAULT NULL,
`plug_accpro_close_year` tinyint(1) DEFAULT NULL,
`plug_repservice` tinyint(1) DEFAULT NULL
`plug_repservice` tinyint(1) DEFAULT NULL,
`plug_accpro_presell` tinyint(1) DEFAULT NULL,
`plug_hrm_docs` tinyint(1) DEFAULT NULL,
`plug_ghesta_manager` tinyint(1) DEFAULT NULL,
`plug_tax_settings` tinyint(1) DEFAULT NULL,
`inquiry` tinyint(1) DEFAULT NULL,
`ai` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
@ -1015,6 +1111,117 @@ INSERT INTO `plugin_prodect` (`id`, `name`, `code`, `timestamp`, `timelabel`, `p
-- --------------------------------------------------------
--
-- Table structure for table `plugin_taxsettings_keys`
--
CREATE TABLE `plugin_taxsettings_keys` (
`id` int NOT NULL,
`business_id` int NOT NULL,
`user_id` int NOT NULL,
`private_key` longtext,
`tax_memory_id` varchar(64) DEFAULT NULL,
`economic_code` varchar(64) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `plugin_tax_invoice`
--
CREATE TABLE `plugin_tax_invoice` (
`id` int NOT NULL,
`invoice_code` varchar(255) NOT NULL,
`tax_system_invoice_number` varchar(255) DEFAULT NULL,
`tax_system_reference_number` varchar(255) DEFAULT NULL,
`status` varchar(255) NOT NULL,
`response_data` longtext,
`error_message` longtext,
`created_at` datetime NOT NULL,
`sent_at` datetime DEFAULT NULL,
`confirmed_at` datetime DEFAULT NULL,
`amount` decimal(30,0) NOT NULL,
`customer_name` varchar(255) DEFAULT NULL,
`customer_id` varchar(255) DEFAULT NULL,
`invoice_type` varchar(50) DEFAULT NULL,
`business_id` int NOT NULL,
`user_id` int NOT NULL,
`invoice_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `plug_ghesta_doc`
--
CREATE TABLE `plug_ghesta_doc` (
`id` int NOT NULL,
`date_submit` varchar(25) NOT NULL,
`count` bigint NOT NULL,
`profit_percent` bigint NOT NULL,
`profit_amount` varchar(255) DEFAULT NULL,
`profit_type` varchar(30) DEFAULT NULL,
`days_pay` double DEFAULT NULL,
`bid_id` int NOT NULL,
`submitter_id` int DEFAULT NULL,
`person_id` int NOT NULL,
`main_doc_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `plug_ghesta_item`
--
CREATE TABLE `plug_ghesta_item` (
`id` int NOT NULL,
`date` varchar(25) NOT NULL,
`amount` varchar(120) NOT NULL,
`num` int NOT NULL,
`doc_id` int NOT NULL,
`hesabdari_doc_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `plug_hrm_doc`
--
CREATE TABLE `plug_hrm_doc` (
`id` int NOT NULL,
`description` varchar(255) NOT NULL,
`date` varchar(10) NOT NULL,
`create_date` int NOT NULL,
`business_id` int NOT NULL,
`creator_id` int NOT NULL,
`hesabdari_doc_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `plug_hrm_doc_item`
--
CREATE TABLE `plug_hrm_doc_item` (
`id` int NOT NULL,
`base_salary` int NOT NULL,
`overtime` int NOT NULL,
`shift` int NOT NULL,
`night` int NOT NULL,
`description` varchar(255) DEFAULT NULL,
`doc_id` int NOT NULL,
`person_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `plug_noghre_order`
--
@ -1092,6 +1299,20 @@ INSERT INTO `plug_repservice_order_state` (`id`, `label`, `code`) VALUES
-- --------------------------------------------------------
--
-- Table structure for table `postal_code_inquiry`
--
CREATE TABLE `postal_code_inquiry` (
`id` int NOT NULL,
`postal_code` varchar(10) NOT NULL,
`address_data` json NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `pre_invoice_doc`
--
@ -1113,7 +1334,13 @@ CREATE TABLE `pre_invoice_doc` (
`plugin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ref_data` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`shortlink` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`tax_percent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`total_discount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`total_discount_percent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`shipping_cost` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`show_percent_discount` tinyint(1) DEFAULT NULL,
`show_total_percent_discount` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
@ -1125,19 +1352,16 @@ CREATE TABLE `pre_invoice_doc` (
CREATE TABLE `pre_invoice_item` (
`id` int NOT NULL,
`commodity_id` int NOT NULL,
`person_id` int DEFAULT NULL,
`bank_id` int DEFAULT NULL,
`cashdesk_id` int DEFAULT NULL,
`salary_id` int DEFAULT NULL,
`bid_id` int NOT NULL,
`year_id` int NOT NULL,
`ref_id_id` int NOT NULL,
`commodity_count` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bs` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bd` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`des` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`discount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`tax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
`tax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`discount_percent` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`discount_amount` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`show_percent_discount` tinyint(1) DEFAULT NULL,
`doc_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
@ -1254,7 +1478,11 @@ CREATE TABLE `print_options` (
`repservice_paper` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fastsell_invoice` tinyint(1) DEFAULT NULL,
`fastsell_pdf` tinyint(1) DEFAULT NULL,
`fastsell_cashdesk_ticket` tinyint(1) DEFAULT NULL
`fastsell_cashdesk_ticket` tinyint(1) DEFAULT NULL,
`left_footer` longtext COLLATE utf8mb4_unicode_ci,
`right_footer` longtext COLLATE utf8mb4_unicode_ci,
`sell_invoice_index` tinyint(1) DEFAULT NULL,
`sell_business_stamp` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
@ -1292,7 +1520,7 @@ CREATE TABLE `registry` (
`id` int NOT NULL,
`root` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`value_of_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
`value_of_key` longtext COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
@ -1603,6 +1831,28 @@ ALTER TABLE `accounting_package_order`
ADD KEY `IDX_CAA1774D4D9866B8` (`bid_id`),
ADD KEY `IDX_CAA1774D919E5513` (`submitter_id`);
--
-- Indexes for table `account_to_sheba_inquiry`
--
ALTER TABLE `account_to_sheba_inquiry`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UNIQ_3B99BD82763247D7` (`cache_key`);
--
-- Indexes for table `aiconversation`
--
ALTER TABLE `aiconversation`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_B85427A8A76ED395` (`user_id`),
ADD KEY `IDX_B85427A8A89DB457` (`business_id`);
--
-- Indexes for table `aimessage`
--
ALTER TABLE `aimessage`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_4964D5D89AC0396` (`conversation_id`);
--
-- Indexes for table `apitoken`
--
@ -1627,6 +1877,13 @@ ALTER TABLE `archive_orders`
ADD KEY `IDX_182AE9FB4D9866B8` (`bid_id`),
ADD KEY `IDX_182AE9FB919E5513` (`submitter_id`);
--
-- Indexes for table `back_built_module`
--
ALTER TABLE `back_built_module`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_DB9B83EB919E5513` (`submitter_id`);
--
-- Indexes for table `bank_account`
--
@ -1652,6 +1909,13 @@ ALTER TABLE `business_money`
ADD KEY `IDX_C93EF45BA89DB457` (`business_id`),
ADD KEY `IDX_C93EF45BBF29332C` (`money_id`);
--
-- Indexes for table `card_to_sheba_inquiry`
--
ALTER TABLE `card_to_sheba_inquiry`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UNIQ_CE18D9D4E4AF4C20` (`card_number`);
--
-- Indexes for table `cashdesk`
--
@ -1675,7 +1939,8 @@ ALTER TABLE `cheque`
ADD KEY `IDX_A0BBFDE9919E5513` (`submitter_id`),
ADD KEY `IDX_A0BBFDE911C8FB41` (`bank_id`),
ADD KEY `IDX_A0BBFDE9217BBB47` (`person_id`),
ADD KEY `IDX_A0BBFDE921B741A9` (`ref_id`);
ADD KEY `IDX_A0BBFDE921B741A9` (`ref_id`),
ADD KEY `IDX_A0BBFDE9BF29332C` (`money_id`);
--
-- Indexes for table `commodity`
@ -1914,6 +2179,56 @@ ALTER TABLE `plugin`
ALTER TABLE `plugin_prodect`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `plugin_taxsettings_keys`
--
ALTER TABLE `plugin_taxsettings_keys`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `plugin_tax_invoice`
--
ALTER TABLE `plugin_tax_invoice`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_165525F4A89DB457` (`business_id`),
ADD KEY `IDX_165525F4A76ED395` (`user_id`),
ADD KEY `IDX_165525F42989F1FD` (`invoice_id`);
--
-- Indexes for table `plug_ghesta_doc`
--
ALTER TABLE `plug_ghesta_doc`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_2874D6C94D9866B8` (`bid_id`),
ADD KEY `IDX_2874D6C9919E5513` (`submitter_id`),
ADD KEY `IDX_2874D6C9217BBB47` (`person_id`),
ADD KEY `IDX_2874D6C9164AF0AA` (`main_doc_id`);
--
-- Indexes for table `plug_ghesta_item`
--
ALTER TABLE `plug_ghesta_item`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_B7D2CF60895648BC` (`doc_id`),
ADD KEY `IDX_B7D2CF6074826F51` (`hesabdari_doc_id`);
--
-- Indexes for table `plug_hrm_doc`
--
ALTER TABLE `plug_hrm_doc`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_D44A2689A89DB457` (`business_id`),
ADD KEY `IDX_D44A268961220EA6` (`creator_id`),
ADD KEY `IDX_D44A268974826F51` (`hesabdari_doc_id`);
--
-- Indexes for table `plug_hrm_doc_item`
--
ALTER TABLE `plug_hrm_doc_item`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_E3C87F09895648BC` (`doc_id`),
ADD KEY `IDX_E3C87F09217BBB47` (`person_id`);
--
-- Indexes for table `plug_noghre_order`
--
@ -1944,6 +2259,13 @@ ALTER TABLE `plug_repservice_order`
ALTER TABLE `plug_repservice_order_state`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `postal_code_inquiry`
--
ALTER TABLE `postal_code_inquiry`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UNIQ_E5578D40EA98E376` (`postal_code`);
--
-- Indexes for table `pre_invoice_doc`
--
@ -1963,13 +2285,7 @@ ALTER TABLE `pre_invoice_doc`
ALTER TABLE `pre_invoice_item`
ADD PRIMARY KEY (`id`),
ADD KEY `IDX_DD881165B4ACC212` (`commodity_id`),
ADD KEY `IDX_DD881165217BBB47` (`person_id`),
ADD KEY `IDX_DD88116511C8FB41` (`bank_id`),
ADD KEY `IDX_DD881165BA216AA5` (`cashdesk_id`),
ADD KEY `IDX_DD881165B0FDF16E` (`salary_id`),
ADD KEY `IDX_DD8811654D9866B8` (`bid_id`),
ADD KEY `IDX_DD88116540C1FEA7` (`year_id`),
ADD KEY `IDX_DD881165C8FFB95` (`ref_id_id`);
ADD KEY `IDX_DD881165895648BC` (`doc_id`);
--
-- Indexes for table `price_list`
@ -2163,6 +2479,24 @@ ALTER TABLE `year`
ALTER TABLE `accounting_package_order`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `account_to_sheba_inquiry`
--
ALTER TABLE `account_to_sheba_inquiry`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `aiconversation`
--
ALTER TABLE `aiconversation`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `aimessage`
--
ALTER TABLE `aimessage`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `apitoken`
--
@ -2181,6 +2515,12 @@ ALTER TABLE `archive_file`
ALTER TABLE `archive_orders`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `back_built_module`
--
ALTER TABLE `back_built_module`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bank_account`
--
@ -2193,6 +2533,12 @@ ALTER TABLE `bank_account`
ALTER TABLE `business`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `card_to_sheba_inquiry`
--
ALTER TABLE `card_to_sheba_inquiry`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cashdesk`
--
@ -2367,6 +2713,42 @@ ALTER TABLE `plugin`
ALTER TABLE `plugin_prodect`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `plugin_taxsettings_keys`
--
ALTER TABLE `plugin_taxsettings_keys`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `plugin_tax_invoice`
--
ALTER TABLE `plugin_tax_invoice`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `plug_ghesta_doc`
--
ALTER TABLE `plug_ghesta_doc`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `plug_ghesta_item`
--
ALTER TABLE `plug_ghesta_item`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `plug_hrm_doc`
--
ALTER TABLE `plug_hrm_doc`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `plug_hrm_doc_item`
--
ALTER TABLE `plug_hrm_doc_item`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `plug_noghre_order`
--
@ -2385,6 +2767,12 @@ ALTER TABLE `plug_repservice_order`
ALTER TABLE `plug_repservice_order_state`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `postal_code_inquiry`
--
ALTER TABLE `postal_code_inquiry`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pre_invoice_doc`
--
@ -2552,6 +2940,19 @@ ALTER TABLE `accounting_package_order`
ADD CONSTRAINT `FK_CAA1774D4D9866B8` FOREIGN KEY (`bid_id`) REFERENCES `business` (`id`),
ADD CONSTRAINT `FK_CAA1774D919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `aiconversation`
--
ALTER TABLE `aiconversation`
ADD CONSTRAINT `FK_B85427A8A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_B85427A8A89DB457` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`);
--
-- Constraints for table `aimessage`
--
ALTER TABLE `aimessage`
ADD CONSTRAINT `FK_4964D5D89AC0396` FOREIGN KEY (`conversation_id`) REFERENCES `aiconversation` (`id`);
--
-- Constraints for table `apitoken`
--
@ -2573,6 +2974,12 @@ ALTER TABLE `archive_orders`
ADD CONSTRAINT `FK_182AE9FB4D9866B8` FOREIGN KEY (`bid_id`) REFERENCES `business` (`id`),
ADD CONSTRAINT `FK_182AE9FB919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `back_built_module`
--
ALTER TABLE `back_built_module`
ADD CONSTRAINT `FK_DB9B83EB919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `bank_account`
--
@ -2610,7 +3017,8 @@ ALTER TABLE `cheque`
ADD CONSTRAINT `FK_A0BBFDE9217BBB47` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`),
ADD CONSTRAINT `FK_A0BBFDE921B741A9` FOREIGN KEY (`ref_id`) REFERENCES `hesabdari_table` (`id`),
ADD CONSTRAINT `FK_A0BBFDE94D9866B8` FOREIGN KEY (`bid_id`) REFERENCES `business` (`id`),
ADD CONSTRAINT `FK_A0BBFDE9919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`);
ADD CONSTRAINT `FK_A0BBFDE9919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_A0BBFDE9BF29332C` FOREIGN KEY (`money_id`) REFERENCES `money` (`id`);
--
-- Constraints for table `commodity`
@ -2669,8 +3077,8 @@ ALTER TABLE `hesabdari_doc`
-- Constraints for table `hesabdari_doc_hesabdari_doc`
--
ALTER TABLE `hesabdari_doc_hesabdari_doc`
ADD CONSTRAINT `FK_BE675746E2A225E5` FOREIGN KEY (`hesabdari_doc_source`) REFERENCES `hesabdari_doc` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `FK_BE675746FB47756A` FOREIGN KEY (`hesabdari_doc_target`) REFERENCES `hesabdari_doc` (`id`) ON DELETE CASCADE;
ADD CONSTRAINT `FK_BE675746E2A225E5` FOREIGN KEY (`hesabdari_doc_source`) REFERENCES `hesabdari_doc` (`id`),
ADD CONSTRAINT `FK_BE675746FB47756A` FOREIGN KEY (`hesabdari_doc_target`) REFERENCES `hesabdari_doc` (`id`);
--
-- Constraints for table `hesabdari_row`
@ -2781,6 +3189,45 @@ ALTER TABLE `plugin`
ADD CONSTRAINT `FK_E96E27944D9866B8` FOREIGN KEY (`bid_id`) REFERENCES `business` (`id`),
ADD CONSTRAINT `FK_E96E2794919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `plugin_tax_invoice`
--
ALTER TABLE `plugin_tax_invoice`
ADD CONSTRAINT `FK_165525F42989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `hesabdari_doc` (`id`),
ADD CONSTRAINT `FK_165525F4A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_165525F4A89DB457` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`);
--
-- Constraints for table `plug_ghesta_doc`
--
ALTER TABLE `plug_ghesta_doc`
ADD CONSTRAINT `FK_2874D6C9164AF0AA` FOREIGN KEY (`main_doc_id`) REFERENCES `hesabdari_doc` (`id`),
ADD CONSTRAINT `FK_2874D6C9217BBB47` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`),
ADD CONSTRAINT `FK_2874D6C94D9866B8` FOREIGN KEY (`bid_id`) REFERENCES `business` (`id`),
ADD CONSTRAINT `FK_2874D6C9919E5513` FOREIGN KEY (`submitter_id`) REFERENCES `user` (`id`);
--
-- Constraints for table `plug_ghesta_item`
--
ALTER TABLE `plug_ghesta_item`
ADD CONSTRAINT `FK_B7D2CF6074826F51` FOREIGN KEY (`hesabdari_doc_id`) REFERENCES `hesabdari_doc` (`id`),
ADD CONSTRAINT `FK_B7D2CF60895648BC` FOREIGN KEY (`doc_id`) REFERENCES `plug_ghesta_doc` (`id`);
--
-- Constraints for table `plug_hrm_doc`
--
ALTER TABLE `plug_hrm_doc`
ADD CONSTRAINT `FK_D44A268961220EA6` FOREIGN KEY (`creator_id`) REFERENCES `user` (`id`),
ADD CONSTRAINT `FK_D44A268974826F51` FOREIGN KEY (`hesabdari_doc_id`) REFERENCES `hesabdari_doc` (`id`),
ADD CONSTRAINT `FK_D44A2689A89DB457` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`);
--
-- Constraints for table `plug_hrm_doc_item`
--
ALTER TABLE `plug_hrm_doc_item`
ADD CONSTRAINT `FK_E3C87F09217BBB47` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`),
ADD CONSTRAINT `FK_E3C87F09895648BC` FOREIGN KEY (`doc_id`) REFERENCES `plug_hrm_doc` (`id`);
--
-- Constraints for table `plug_noghre_order`
--
@ -2819,14 +3266,8 @@ ALTER TABLE `pre_invoice_doc`
-- Constraints for table `pre_invoice_item`
--
ALTER TABLE `pre_invoice_item`
ADD CONSTRAINT `FK_DD88116511C8FB41` FOREIGN KEY (`bank_id`) REFERENCES `bank_account` (`id`),
ADD CONSTRAINT `FK_DD881165217BBB47` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`),
ADD CONSTRAINT `FK_DD88116540C1FEA7` FOREIGN KEY (`year_id`) REFERENCES `year` (`id`),
ADD CONSTRAINT `FK_DD8811654D9866B8` FOREIGN KEY (`bid_id`) REFERENCES `business` (`id`),
ADD CONSTRAINT `FK_DD881165B0FDF16E` FOREIGN KEY (`salary_id`) REFERENCES `salary` (`id`),
ADD CONSTRAINT `FK_DD881165B4ACC212` FOREIGN KEY (`commodity_id`) REFERENCES `commodity` (`id`),
ADD CONSTRAINT `FK_DD881165BA216AA5` FOREIGN KEY (`cashdesk_id`) REFERENCES `cashdesk` (`id`),
ADD CONSTRAINT `FK_DD881165C8FFB95` FOREIGN KEY (`ref_id_id`) REFERENCES `hesabdari_table` (`id`);
ADD CONSTRAINT `FK_DD881165895648BC` FOREIGN KEY (`doc_id`) REFERENCES `pre_invoice_doc` (`id`),
ADD CONSTRAINT `FK_DD881165B4ACC212` FOREIGN KEY (`commodity_id`) REFERENCES `commodity` (`id`);
--
-- Constraints for table `price_list`

View file

@ -429,4 +429,65 @@ class PluginController extends AbstractController
return $this->json($result);
}
#[Route('/api/admin/plugins/sync', name: 'api_admin_plugins_sync', methods: ["POST"])]
public function api_admin_plugins_sync(EntityManagerInterface $entityManager): JsonResponse
{
$pluginData = [
[
'name' => 'بسته حسابداری پیشرفته',
'code' => 'accpro',
'timestamp' => '32104000',
'timelabel' => 'یک سال',
'price' => '200000',
'icon' => 'accpro.png',
'defaultOn' => null,
],
[
'name' => 'افزونه مدیریت تعمیرگاه(تعمیرکاران)',
'code' => 'repservice',
'timestamp' => '32104000',
'timelabel' => 'یک سال',
'price' => '200000',
'icon' => 'repservice.jpg',
'defaultOn' => null,
],
[
'name' => 'افزونه فروش اقساطی',
'code' => 'ghesta',
'timestamp' => '32104000',
'timelabel' => 'یک سال',
'price' => '95000',
'icon' => 'ghesta.png',
'defaultOn' => null,
],
[
'name' => 'سامانه مودیان',
'code' => 'taxsettings',
'timestamp' => '32104000',
'timelabel' => 'یک سال',
'price' => '200000',
'icon' => ' taxplugin.jpg',
'defaultOn' => null,
],
];
$repo = $entityManager->getRepository(PluginProdect::class);
foreach ($pluginData as $data) {
$exists = $repo->findOneBy(['code' => $data['code']]);
if (!$exists) {
$plugin = new PluginProdect();
$plugin->setName($data['name'])
->setCode($data['code'])
->setTimestamp($data['timestamp'])
->setTimelabel($data['timelabel'])
->setPrice($data['price'])
->setIcon($data['icon'])
->setDefaultOn($data['defaultOn']);
$entityManager->persist($plugin);
}
}
$entityManager->flush();
return $this->json(['status' => 'done']);
}
}

View file

@ -897,6 +897,9 @@ setup_web_ui() {
fi
log_message "INFO" "Web UI setup completed"
# رفع مشکل دسترسی esbuild (اضافه شده توسط AI)
find "$webui_path/node_modules" -type f -path '*/bin/esbuild' -exec chmod +x {} \;
}
# Function to set Apache ownership

View file

@ -1,9 +1,11 @@
<script>
import axios from "axios";
import Swal from "sweetalert2";
import Snackbar from '@/components/Snackbar.vue';
export default {
name: "plugins",
components: { Snackbar },
data: () => {
return {
dialog: false,
@ -25,7 +27,12 @@ export default {
{ text: "دوره اعتبار(ثانیه)", value: "time" },
{ text: "برچسب زمان", value: "timeLabel" },
{ text: "ویرایش", value: "operation" },
]
],
snackbar: {
show: false,
color: '',
text: ''
}
}
},
methods: {
@ -81,6 +88,26 @@ export default {
this.loading = false;
this.dialog = false;
}
},
async syncPlugins() {
this.loading = true;
try {
await axios.post('/api/admin/plugins/sync');
this.snackbar = {
show: true,
color: 'success',
text: 'همگام‌سازی افزونه‌ها با موفقیت انجام شد.'
};
await this.loadData();
} catch (error) {
this.snackbar = {
show: true,
color: 'error',
text: 'خطا در همگام‌سازی افزونه‌ها!'
};
}
this.loading = false;
}
},
beforeMount() {
@ -92,6 +119,10 @@ export default {
<template>
<v-toolbar color="toolbar" :title="$t('dialog.plugins') + ' : (' + items.length + ')'">
<v-spacer></v-spacer>
<v-btn color="primary" :loading="loading" @click="syncPlugins" class="ml-2">
<v-icon left>mdi-sync</v-icon>
همگامسازی افزونهها
</v-btn>
</v-toolbar>
<v-container class="pa-0 ma-0">
<v-card :loading="loading ? 'red' : null" :disabled="loading">
@ -169,6 +200,7 @@ export default {
</v-form>
</v-card>
</v-dialog>
<Snackbar v-model="snackbar.show" :color="snackbar.color" :text="snackbar.text" />
</template>
<style scoped></style>