some progress and updates
This commit is contained in:
parent
5f7e68dfb1
commit
613321c07a
|
@ -1,148 +0,0 @@
|
|||
CREATE TABLE user_token (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, token VARCHAR(255) NOT NULL, token_id VARCHAR(255) DEFAULT NULL, INDEX IDX_BDF55A63A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, full_name VARCHAR(255) NOT NULL, date_register VARCHAR(50) NOT NULL, mobile VARCHAR(15) DEFAULT NULL, verify_code VARCHAR(255) DEFAULT NULL, active TINYINT(1) DEFAULT NULL, verify_code_time VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE business (id INT AUTO_INCREMENT NOT NULL, money_id INT DEFAULT NULL, owner_id INT NOT NULL, wallet_match_bank_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, legal_name VARCHAR(255) NOT NULL, field VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, shenasemeli VARCHAR(255) DEFAULT NULL, codeeghtesadi VARCHAR(255) DEFAULT NULL, shomaresabt VARCHAR(255) DEFAULT NULL, country VARCHAR(255) DEFAULT NULL, ostan VARCHAR(255) DEFAULT NULL, shahrestan VARCHAR(255) DEFAULT NULL, postalcode VARCHAR(255) DEFAULT NULL, tel VARCHAR(12) DEFAULT NULL, mobile VARCHAR(12) DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, wesite VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, maliyatafzode VARCHAR(255) NOT NULL, date_submit VARCHAR(255) NOT NULL, person_code BIGINT DEFAULT NULL, bank_code BIGINT DEFAULT NULL, receive_code VARCHAR(255) DEFAULT NULL, accounting_code VARCHAR(255) DEFAULT NULL, commodity_code BIGINT DEFAULT NULL, salary_code VARCHAR(255) DEFAULT NULL, cashdesk_code VARCHAR(255) DEFAULT NULL, zarinpal_code VARCHAR(255) DEFAULT NULL, store_online TINYINT(1) DEFAULT NULL, store_username VARCHAR(255) DEFAULT NULL, sms_charge VARCHAR(255) DEFAULT NULL, shortlinks TINYINT(1) DEFAULT NULL, wallet_enable TINYINT(1) DEFAULT NULL, storeroom_code VARCHAR(255) DEFAULT NULL, archive_size VARCHAR(255) DEFAULT NULL, INDEX IDX_8D36E38BF29332C (money_id), INDEX IDX_8D36E387E3C61F9 (owner_id), INDEX IDX_8D36E38574F80DE (wallet_match_bank_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE guide_content (id INT AUTO_INCREMENT NOT NULL, submiter_id INT NOT NULL, cat VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, body LONGTEXT DEFAULT NULL, date_submit VARCHAR(25) NOT NULL, url VARCHAR(255) NOT NULL, INDEX IDX_CAD3AA81A2251D63 (submiter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE stack_content (id INT AUTO_INCREMENT NOT NULL, submitter_id INT NOT NULL, cat_id INT NOT NULL, upper_id INT DEFAULT NULL, date_submit VARCHAR(50) NOT NULL, title VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, views BIGINT NOT NULL, url VARCHAR(255) NOT NULL, INDEX IDX_B5150B0C919E5513 (submitter_id), INDEX IDX_B5150B0CE6ADA943 (cat_id), INDEX IDX_B5150B0C6F3C117F (upper_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE blog_post (id INT AUTO_INCREMENT NOT NULL, submitter_id INT NOT NULL, cat_id INT NOT NULL, title VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, date_submit VARCHAR(50) NOT NULL, views BIGINT NOT NULL, img VARCHAR(255) DEFAULT NULL, url VARCHAR(255) NOT NULL, intero LONGTEXT NOT NULL, keywords VARCHAR(255) DEFAULT NULL, INDEX IDX_BA5AE01D919E5513 (submitter_id), INDEX IDX_BA5AE01DE6ADA943 (cat_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE blog_comment (id INT AUTO_INCREMENT NOT NULL, post_id INT NOT NULL, date_submit VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, publish TINYINT(1) DEFAULT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, website VARCHAR(255) DEFAULT NULL, INDEX IDX_7882EFEF4B89032C (post_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE log (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, bid_id INT DEFAULT NULL, doc_id INT DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, part VARCHAR(255) NOT NULL, des VARCHAR(255) NOT NULL, ipaddress VARCHAR(255) DEFAULT NULL, INDEX IDX_8F3F68C5A76ED395 (user_id), INDEX IDX_8F3F68C54D9866B8 (bid_id), INDEX IDX_8F3F68C5895648BC (doc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE permission (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, bid_id INT NOT NULL, owner TINYINT(1) DEFAULT NULL, settings TINYINT(1) DEFAULT NULL, person TINYINT(1) DEFAULT NULL, commodity TINYINT(1) DEFAULT NULL, getpay TINYINT(1) DEFAULT NULL, banks TINYINT(1) DEFAULT NULL, bank_transfer TINYINT(1) DEFAULT NULL, buy TINYINT(1) DEFAULT NULL, sell TINYINT(1) DEFAULT NULL, cost TINYINT(1) DEFAULT NULL, income TINYINT(1) DEFAULT NULL, accounting TINYINT(1) DEFAULT NULL, report TINYINT(1) DEFAULT NULL, log TINYINT(1) DEFAULT NULL, permission TINYINT(1) DEFAULT NULL, salary TINYINT(1) DEFAULT NULL, cashdesk TINYINT(1) DEFAULT NULL, plug_noghre_admin TINYINT(1) DEFAULT NULL, plug_noghre_sell TINYINT(1) DEFAULT NULL, plug_ccadmin TINYINT(1) DEFAULT NULL, store TINYINT(1) DEFAULT NULL, wallet TINYINT(1) DEFAULT NULL, archive_upload TINYINT(1) DEFAULT NULL, archive_mod TINYINT(1) DEFAULT NULL, archive_delete TINYINT(1) DEFAULT NULL, shareholder TINYINT(1) DEFAULT NULL, archive_view TINYINT(1) DEFAULT NULL, cheque TINYINT(1) DEFAULT NULL, INDEX IDX_E04992AAA76ED395 (user_id), INDEX IDX_E04992AA4D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE hesabdari_doc (id INT AUTO_INCREMENT NOT NULL, bid_id INT DEFAULT NULL, submitter_id INT NOT NULL, year_id INT NOT NULL, money_id INT NOT NULL, wallet_transaction_id INT DEFAULT NULL, date_submit VARCHAR(50) NOT NULL, date VARCHAR(50) NOT NULL, type VARCHAR(255) DEFAULT NULL, code BIGINT NOT NULL, des VARCHAR(255) DEFAULT NULL, amount VARCHAR(255) DEFAULT NULL, mdate VARCHAR(255) DEFAULT NULL, plugin VARCHAR(255) DEFAULT NULL, ref_data VARCHAR(255) DEFAULT NULL, shortlink VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, temp_status LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_81C3CD534D9866B8 (bid_id), INDEX IDX_81C3CD53919E5513 (submitter_id), INDEX IDX_81C3CD5340C1FEA7 (year_id), INDEX IDX_81C3CD53BF29332C (money_id), INDEX IDX_81C3CD53924C1837 (wallet_transaction_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE hesabdari_doc_hesabdari_doc (hesabdari_doc_source INT NOT NULL, hesabdari_doc_target INT NOT NULL, INDEX IDX_BE675746E2A225E5 (hesabdari_doc_source), INDEX IDX_BE675746FB47756A (hesabdari_doc_target), PRIMARY KEY(hesabdari_doc_source, hesabdari_doc_target)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE support (id INT AUTO_INCREMENT NOT NULL, submitter_id INT NOT NULL, main VARCHAR(255) DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, state VARCHAR(255) NOT NULL, INDEX IDX_8004EBA5919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE notification (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, bid_id INT DEFAULT NULL, url LONGTEXT DEFAULT NULL, icon VARCHAR(255) DEFAULT NULL, message VARCHAR(255) DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, viewed TINYINT(1) NOT NULL, INDEX IDX_BF5476CAA76ED395 (user_id), INDEX IDX_BF5476CA4D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE email_history (id INT AUTO_INCREMENT NOT NULL, submitter_id INT DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, title VARCHAR(255) DEFAULT NULL, body LONGTEXT DEFAULT NULL, INDEX IDX_9A7A1884919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE smspays (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, date_submit VARCHAR(255) NOT NULL, price VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, ref_id VARCHAR(255) DEFAULT NULL, card_pan VARCHAR(255) DEFAULT NULL, verify_code VARCHAR(255) DEFAULT NULL, gate_pay VARCHAR(255) NOT NULL, INDEX IDX_5F2F70E14D9866B8 (bid_id), INDEX IDX_5F2F70E1919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE wallet_transaction (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, amount VARCHAR(255) NOT NULL, shaba VARCHAR(255) DEFAULT NULL, bank VARCHAR(255) DEFAULT NULL, card_num VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, card_pan VARCHAR(255) DEFAULT NULL, ref_id VARCHAR(255) DEFAULT NULL, verify_code VARCHAR(255) DEFAULT NULL, gate_pay VARCHAR(255) DEFAULT NULL, transaction_id VARCHAR(255) DEFAULT NULL, INDEX IDX_7DAF9724D9866B8 (bid_id), INDEX IDX_7DAF972919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE storeroom_ticket (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, person_id INT DEFAULT NULL, doc_id INT DEFAULT NULL, year_id INT NOT NULL, storeroom_id INT NOT NULL, transfer_type_id INT NOT NULL, date VARCHAR(255) NOT NULL, date_submit VARCHAR(255) NOT NULL, transfer VARCHAR(255) DEFAULT NULL, receiver VARCHAR(255) DEFAULT NULL, code VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, referral VARCHAR(255) DEFAULT NULL, type_string VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, INDEX IDX_9B4CC0F74D9866B8 (bid_id), INDEX IDX_9B4CC0F7919E5513 (submitter_id), INDEX IDX_9B4CC0F7217BBB47 (person_id), INDEX IDX_9B4CC0F7895648BC (doc_id), INDEX IDX_9B4CC0F740C1FEA7 (year_id), INDEX IDX_9B4CC0F7C9330186 (storeroom_id), INDEX IDX_9B4CC0F77AF9FED8 (transfer_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE archive_file (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, date_submit VARCHAR(255) NOT NULL, date_mod VARCHAR(255) DEFAULT NULL, filename VARCHAR(255) NOT NULL, cat VARCHAR(255) NOT NULL, file_type VARCHAR(255) NOT NULL, public TINYINT(1) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, related_doc_type VARCHAR(255) NOT NULL, related_doc_code VARCHAR(255) DEFAULT NULL, file_size VARCHAR(255) DEFAULT NULL, INDEX IDX_BCBAE08B4D9866B8 (bid_id), INDEX IDX_BCBAE08B919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE archive_orders (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, date_submit VARCHAR(255) NOT NULL, order_size VARCHAR(255) NOT NULL, gate_pay VARCHAR(255) DEFAULT NULL, price VARCHAR(255) DEFAULT NULL, verify_code VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, ref_id VARCHAR(255) DEFAULT NULL, card_pan VARCHAR(255) DEFAULT NULL, expire_date VARCHAR(255) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, month VARCHAR(255) NOT NULL, INDEX IDX_182AE9FB4D9866B8 (bid_id), INDEX IDX_182AE9FB919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE hook (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, url LONGTEXT NOT NULL, password VARCHAR(255) NOT NULL, INDEX IDX_A45843554D9866B8 (bid_id), INDEX IDX_A4584355919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE cheque (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, bank_id INT DEFAULT NULL, person_id INT DEFAULT NULL, ref_id INT DEFAULT NULL, date_submit VARCHAR(50) NOT NULL, type VARCHAR(20) NOT NULL, sayad_num VARCHAR(50) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, date_stamp VARCHAR(50) NOT NULL, pay_date VARCHAR(50) DEFAULT NULL, number VARCHAR(255) NOT NULL, bank_oncheque VARCHAR(255) NOT NULL, amount VARCHAR(255) NOT NULL, status VARCHAR(255) DEFAULT NULL, locked TINYINT(1) DEFAULT NULL, date VARCHAR(255) DEFAULT NULL, rejected TINYINT(1) DEFAULT NULL, INDEX IDX_A0BBFDE94D9866B8 (bid_id), INDEX IDX_A0BBFDE9919E5513 (submitter_id), INDEX IDX_A0BBFDE911C8FB41 (bank_id), INDEX IDX_A0BBFDE9217BBB47 (person_id), INDEX IDX_A0BBFDE921B741A9 (ref_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE money (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE person (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, code BIGINT NOT NULL, nikename VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, tel VARCHAR(12) DEFAULT NULL, mobile VARCHAR(12) DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, plug_noghre_morsa TINYINT(1) DEFAULT NULL, plug_noghre_hakak TINYINT(1) DEFAULT NULL, plug_noghre_tarash TINYINT(1) DEFAULT NULL, employe TINYINT(1) DEFAULT NULL, plug_noghre_ghalam TINYINT(1) DEFAULT NULL, company VARCHAR(255) DEFAULT NULL, shenasemeli VARCHAR(255) DEFAULT NULL, codeeghtesadi VARCHAR(255) DEFAULT NULL, sabt VARCHAR(255) DEFAULT NULL, keshvar VARCHAR(255) DEFAULT NULL, ostan VARCHAR(255) DEFAULT NULL, shahr VARCHAR(255) DEFAULT NULL, postalcode VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, website VARCHAR(255) DEFAULT NULL, fax VARCHAR(255) DEFAULT NULL, birthday VARCHAR(255) DEFAULT NULL, speed_access TINYINT(1) DEFAULT NULL, INDEX IDX_34DCD1764D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE year (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, label VARCHAR(255) NOT NULL, head TINYINT(1) DEFAULT NULL, start VARCHAR(255) NOT NULL, end VARCHAR(255) NOT NULL, now VARCHAR(255) DEFAULT NULL, INDEX IDX_BB8273374D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE bank_account (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, card_num VARCHAR(255) DEFAULT NULL, shaba VARCHAR(255) DEFAULT NULL, account_num VARCHAR(255) DEFAULT NULL, owner VARCHAR(255) DEFAULT NULL, shobe VARCHAR(255) DEFAULT NULL, pos_num VARCHAR(255) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, mobile_internet_bank VARCHAR(25) DEFAULT NULL, code VARCHAR(255) NOT NULL, balance VARCHAR(255) DEFAULT NULL, INDEX IDX_53A23E0A4D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE hesabdari_row (id INT AUTO_INCREMENT NOT NULL, doc_id INT NOT NULL, ref_id INT NOT NULL, person_id INT DEFAULT NULL, bank_id INT DEFAULT NULL, bid_id INT NOT NULL, year_id INT NOT NULL, commodity_id INT DEFAULT NULL, salary_id INT DEFAULT NULL, cashdesk_id INT DEFAULT NULL, cheque_id INT DEFAULT NULL, bs VARCHAR(255) NOT NULL, bd VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, commdity_count VARCHAR(255) DEFAULT NULL, referral VARCHAR(255) DEFAULT NULL, ref_data VARCHAR(255) DEFAULT NULL, plugin VARCHAR(255) DEFAULT NULL, temp_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_83B2C6EC895648BC (doc_id), INDEX IDX_83B2C6EC21B741A9 (ref_id), INDEX IDX_83B2C6EC217BBB47 (person_id), INDEX IDX_83B2C6EC11C8FB41 (bank_id), INDEX IDX_83B2C6EC4D9866B8 (bid_id), INDEX IDX_83B2C6EC40C1FEA7 (year_id), INDEX IDX_83B2C6ECB4ACC212 (commodity_id), INDEX IDX_83B2C6ECB0FDF16E (salary_id), INDEX IDX_83B2C6ECBA216AA5 (cashdesk_id), INDEX IDX_83B2C6EC3DD3DB4B (cheque_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE salary (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, name VARCHAR(255) NOT NULL, des LONGTEXT DEFAULT NULL, code VARCHAR(255) NOT NULL, balance VARCHAR(255) DEFAULT NULL, INDEX IDX_9413BB714D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE cashdesk (id INT AUTO_INCREMENT NOT NULL, bid_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, des LONGTEXT DEFAULT NULL, code VARCHAR(255) NOT NULL, balance VARCHAR(255) DEFAULT NULL, INDEX IDX_165987F94D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE plugin (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, submitter_id INT NOT NULL, date_expire VARCHAR(255) DEFAULT NULL, gate_pay VARCHAR(255) DEFAULT NULL, price VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, verify_code VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, ref_id VARCHAR(255) DEFAULT NULL, card_pan VARCHAR(255) DEFAULT NULL, INDEX IDX_E96E27944D9866B8 (bid_id), INDEX IDX_E96E2794919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE plug_noghre_order (id INT AUTO_INCREMENT NOT NULL, doc_id INT NOT NULL, bid_id INT NOT NULL, morsa_id INT DEFAULT NULL, tarash_id INT DEFAULT NULL, hakak_id INT DEFAULT NULL, ghalam_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, delivery_date VARCHAR(255) DEFAULT NULL, place VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, negin VARCHAR(255) DEFAULT NULL, noghre_amount VARCHAR(255) DEFAULT NULL, negin_fee VARCHAR(255) DEFAULT NULL, ring_model VARCHAR(255) DEFAULT NULL, ring_size VARCHAR(255) DEFAULT NULL, des VARCHAR(255) DEFAULT NULL, noghre_fee VARCHAR(255) DEFAULT NULL, INDEX IDX_EEEE085E895648BC (doc_id), INDEX IDX_EEEE085E4D9866B8 (bid_id), INDEX IDX_EEEE085EB130EC9E (morsa_id), INDEX IDX_EEEE085E36B8627E (tarash_id), INDEX IDX_EEEE085EF8ABEE72 (hakak_id), INDEX IDX_EEEE085E7BECA6BC (ghalam_id), INDEX IDX_EEEE085E9395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE smssettings (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, send_after_sell TINYINT(1) DEFAULT NULL, send_after_sell_pay_online TINYINT(1) DEFAULT NULL, send_after_buy TINYINT(1) DEFAULT NULL, send_after_buy_to_user TINYINT(1) DEFAULT NULL, INDEX IDX_61178A624D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE commodity_drop (id INT AUTO_INCREMENT NOT NULL, bid_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, udprice VARCHAR(255) DEFAULT NULL, udprice_percent VARCHAR(255) DEFAULT NULL, can_edit TINYINT(1) DEFAULT NULL, INDEX IDX_14E674574D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE storeroom (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, name VARCHAR(255) NOT NULL, manager VARCHAR(255) DEFAULT NULL, adr VARCHAR(255) DEFAULT NULL, tel VARCHAR(255) DEFAULT NULL, active TINYINT(1) DEFAULT NULL, INDEX IDX_3E2092A84D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE storeroom_item (id INT AUTO_INCREMENT NOT NULL, ticket_id INT NOT NULL, commodity_id INT NOT NULL, bid_id INT NOT NULL, storeroom_id INT NOT NULL, type VARCHAR(255) NOT NULL, count VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, referal VARCHAR(255) DEFAULT NULL, INDEX IDX_6CA8F5E0700047D2 (ticket_id), INDEX IDX_6CA8F5E0B4ACC212 (commodity_id), INDEX IDX_6CA8F5E04D9866B8 (bid_id), INDEX IDX_6CA8F5E0C9330186 (storeroom_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE shareholder (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, person_id INT NOT NULL, percent INT NOT NULL, INDEX IDX_D5FE68CC4D9866B8 (bid_id), INDEX IDX_D5FE68CC217BBB47 (person_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE stack_cat (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE blog_cat (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE storeroom_transfer_type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE hesabdari_table (id INT AUTO_INCREMENT NOT NULL, upper_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, entity VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_40F7185C77153098 (code), INDEX IDX_40F7185C6F3C117F (upper_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE commodity_unit (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE commodity_drop_link (id INT AUTO_INCREMENT NOT NULL, commoditydrop_id INT NOT NULL, commodity_id INT NOT NULL, value VARCHAR(255) NOT NULL, INDEX IDX_8626B6BDC15B0809 (commoditydrop_id), INDEX IDX_8626B6BDB4ACC212 (commodity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE change_report (id INT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, date_submit VARCHAR(255) NOT NULL, version VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE plugin_prodect (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, timestamp VARCHAR(255) NOT NULL, timelabel VARCHAR(255) NOT NULL, price VARCHAR(255) NOT NULL, icon VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE commodity_cat (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, upper VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, root TINYINT(1) DEFAULT NULL, INDEX IDX_687F6B14D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE apitoken (id INT AUTO_INCREMENT NOT NULL, bid_id INT DEFAULT NULL, submitter_id INT NOT NULL, token VARCHAR(255) NOT NULL, date_expire VARCHAR(255) DEFAULT NULL, INDEX IDX_23E5A7D34D9866B8 (bid_id), INDEX IDX_23E5A7D3919E5513 (submitter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE settings (id INT AUTO_INCREMENT NOT NULL, active_send_sms TINYINT(1) DEFAULT NULL, zarinpal_merchant VARCHAR(255) DEFAULT NULL, app_site VARCHAR(255) DEFAULT NULL, storage_price VARCHAR(255) DEFAULT NULL, site_keywords LONGTEXT DEFAULT NULL, discription VARCHAR(255) DEFAULT NULL, scripts LONGTEXT DEFAULT NULL, footer_scripts LONGTEXT DEFAULT NULL, footer LONGTEXT DEFAULT NULL, active_sms_panel VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE registry (id INT AUTO_INCREMENT NOT NULL, root VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, value_of_key VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE statment (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) DEFAULT NULL, body LONGTEXT NOT NULL, date_submit VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE commodity (id INT AUTO_INCREMENT NOT NULL, unit_id INT NOT NULL, bid_id INT NOT NULL, cat_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, code BIGINT NOT NULL, price_buy VARCHAR(255) DEFAULT NULL, price_sell VARCHAR(255) DEFAULT NULL, khadamat TINYINT(1) DEFAULT NULL, order_point VARCHAR(255) DEFAULT NULL, commodity_count_check TINYINT(1) DEFAULT NULL, min_order_count VARCHAR(255) DEFAULT NULL, day_loading VARCHAR(255) DEFAULT NULL, speed_access TINYINT(1) DEFAULT NULL, INDEX IDX_5E8D2F74F8BD700D (unit_id), INDEX IDX_5E8D2F744D9866B8 (bid_id), INDEX IDX_5E8D2F74E6ADA943 (cat_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE pay_info_temp (id INT AUTO_INCREMENT NOT NULL, bid_id INT NOT NULL, doc_id INT DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, des VARCHAR(255) DEFAULT NULL, price VARCHAR(255) NOT NULL, status VARCHAR(255) DEFAULT NULL, verify_code VARCHAR(255) DEFAULT NULL, gate_pay VARCHAR(255) NOT NULL, ref_id VARCHAR(255) DEFAULT NULL, card_pan VARCHAR(255) DEFAULT NULL, INDEX IDX_7F36E8384D9866B8 (bid_id), INDEX IDX_7F36E838895648BC (doc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE printer_queue (id INT AUTO_INCREMENT NOT NULL, submitter_id INT NOT NULL, bid_id INT DEFAULT NULL, date_submit VARCHAR(255) NOT NULL, pid VARCHAR(255) NOT NULL, view LONGTEXT DEFAULT NULL, INDEX IDX_93F2764B919E5513 (submitter_id), INDEX IDX_93F2764B4D9866B8 (bid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE apidocument (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, date_submit VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL, available_at DATETIME NOT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
|
||||
ALTER TABLE user_token ADD CONSTRAINT FK_BDF55A63A76ED395 FOREIGN KEY (user_id) REFERENCES user (id);
|
||||
ALTER TABLE business ADD CONSTRAINT FK_8D36E38BF29332C FOREIGN KEY (money_id) REFERENCES money (id);
|
||||
ALTER TABLE business ADD CONSTRAINT FK_8D36E387E3C61F9 FOREIGN KEY (owner_id) REFERENCES user (id);
|
||||
ALTER TABLE business ADD CONSTRAINT FK_8D36E38574F80DE FOREIGN KEY (wallet_match_bank_id) REFERENCES bank_account (id);
|
||||
ALTER TABLE guide_content ADD CONSTRAINT FK_CAD3AA81A2251D63 FOREIGN KEY (submiter_id) REFERENCES user (id);
|
||||
ALTER TABLE stack_content ADD CONSTRAINT FK_B5150B0C919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE stack_content ADD CONSTRAINT FK_B5150B0CE6ADA943 FOREIGN KEY (cat_id) REFERENCES stack_cat (id);
|
||||
ALTER TABLE stack_content ADD CONSTRAINT FK_B5150B0C6F3C117F FOREIGN KEY (upper_id) REFERENCES stack_content (id);
|
||||
ALTER TABLE blog_post ADD CONSTRAINT FK_BA5AE01D919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE blog_post ADD CONSTRAINT FK_BA5AE01DE6ADA943 FOREIGN KEY (cat_id) REFERENCES blog_cat (id);
|
||||
ALTER TABLE blog_comment ADD CONSTRAINT FK_7882EFEF4B89032C FOREIGN KEY (post_id) REFERENCES blog_post (id);
|
||||
ALTER TABLE log ADD CONSTRAINT FK_8F3F68C5A76ED395 FOREIGN KEY (user_id) REFERENCES user (id);
|
||||
ALTER TABLE log ADD CONSTRAINT FK_8F3F68C54D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE log ADD CONSTRAINT FK_8F3F68C5895648BC FOREIGN KEY (doc_id) REFERENCES hesabdari_doc (id);
|
||||
ALTER TABLE permission ADD CONSTRAINT FK_E04992AAA76ED395 FOREIGN KEY (user_id) REFERENCES user (id);
|
||||
ALTER TABLE permission ADD CONSTRAINT FK_E04992AA4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE hesabdari_doc ADD CONSTRAINT FK_81C3CD534D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE hesabdari_doc ADD CONSTRAINT FK_81C3CD53919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE hesabdari_doc ADD CONSTRAINT FK_81C3CD5340C1FEA7 FOREIGN KEY (year_id) REFERENCES year (id);
|
||||
ALTER TABLE hesabdari_doc ADD CONSTRAINT FK_81C3CD53BF29332C FOREIGN KEY (money_id) REFERENCES money (id);
|
||||
ALTER TABLE hesabdari_doc ADD CONSTRAINT FK_81C3CD53924C1837 FOREIGN KEY (wallet_transaction_id) REFERENCES wallet_transaction (id);
|
||||
ALTER TABLE hesabdari_doc_hesabdari_doc ADD CONSTRAINT FK_BE675746E2A225E5 FOREIGN KEY (hesabdari_doc_source) REFERENCES hesabdari_doc (id) ON DELETE CASCADE;
|
||||
ALTER TABLE hesabdari_doc_hesabdari_doc ADD CONSTRAINT FK_BE675746FB47756A FOREIGN KEY (hesabdari_doc_target) REFERENCES hesabdari_doc (id) ON DELETE CASCADE;
|
||||
ALTER TABLE support ADD CONSTRAINT FK_8004EBA5919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE notification ADD CONSTRAINT FK_BF5476CAA76ED395 FOREIGN KEY (user_id) REFERENCES user (id);
|
||||
ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE email_history ADD CONSTRAINT FK_9A7A1884919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE smspays ADD CONSTRAINT FK_5F2F70E14D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE smspays ADD CONSTRAINT FK_5F2F70E1919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE wallet_transaction ADD CONSTRAINT FK_7DAF9724D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE wallet_transaction ADD CONSTRAINT FK_7DAF972919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F74D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F7919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F7217BBB47 FOREIGN KEY (person_id) REFERENCES person (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F7895648BC FOREIGN KEY (doc_id) REFERENCES hesabdari_doc (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F740C1FEA7 FOREIGN KEY (year_id) REFERENCES year (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F7C9330186 FOREIGN KEY (storeroom_id) REFERENCES storeroom (id);
|
||||
ALTER TABLE storeroom_ticket ADD CONSTRAINT FK_9B4CC0F77AF9FED8 FOREIGN KEY (transfer_type_id) REFERENCES storeroom_transfer_type (id);
|
||||
ALTER TABLE archive_file ADD CONSTRAINT FK_BCBAE08B4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE archive_file ADD CONSTRAINT FK_BCBAE08B919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE archive_orders ADD CONSTRAINT FK_182AE9FB4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE archive_orders ADD CONSTRAINT FK_182AE9FB919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE hook ADD CONSTRAINT FK_A45843554D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE hook ADD CONSTRAINT FK_A4584355919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE cheque ADD CONSTRAINT FK_A0BBFDE94D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE cheque ADD CONSTRAINT FK_A0BBFDE9919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE cheque ADD CONSTRAINT FK_A0BBFDE911C8FB41 FOREIGN KEY (bank_id) REFERENCES bank_account (id);
|
||||
ALTER TABLE cheque ADD CONSTRAINT FK_A0BBFDE9217BBB47 FOREIGN KEY (person_id) REFERENCES person (id);
|
||||
ALTER TABLE cheque ADD CONSTRAINT FK_A0BBFDE921B741A9 FOREIGN KEY (ref_id) REFERENCES hesabdari_table (id);
|
||||
ALTER TABLE person ADD CONSTRAINT FK_34DCD1764D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE year ADD CONSTRAINT FK_BB8273374D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE bank_account ADD CONSTRAINT FK_53A23E0A4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC895648BC FOREIGN KEY (doc_id) REFERENCES hesabdari_doc (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC21B741A9 FOREIGN KEY (ref_id) REFERENCES hesabdari_table (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC217BBB47 FOREIGN KEY (person_id) REFERENCES person (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC11C8FB41 FOREIGN KEY (bank_id) REFERENCES bank_account (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC40C1FEA7 FOREIGN KEY (year_id) REFERENCES year (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6ECB4ACC212 FOREIGN KEY (commodity_id) REFERENCES commodity (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6ECB0FDF16E FOREIGN KEY (salary_id) REFERENCES salary (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6ECBA216AA5 FOREIGN KEY (cashdesk_id) REFERENCES cashdesk (id);
|
||||
ALTER TABLE hesabdari_row ADD CONSTRAINT FK_83B2C6EC3DD3DB4B FOREIGN KEY (cheque_id) REFERENCES cheque (id);
|
||||
ALTER TABLE salary ADD CONSTRAINT FK_9413BB714D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE cashdesk ADD CONSTRAINT FK_165987F94D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE plugin ADD CONSTRAINT FK_E96E27944D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE plugin ADD CONSTRAINT FK_E96E2794919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085E895648BC FOREIGN KEY (doc_id) REFERENCES hesabdari_doc (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085E4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085EB130EC9E FOREIGN KEY (morsa_id) REFERENCES person (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085E36B8627E FOREIGN KEY (tarash_id) REFERENCES person (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085EF8ABEE72 FOREIGN KEY (hakak_id) REFERENCES person (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085E7BECA6BC FOREIGN KEY (ghalam_id) REFERENCES person (id);
|
||||
ALTER TABLE plug_noghre_order ADD CONSTRAINT FK_EEEE085E9395C3F3 FOREIGN KEY (customer_id) REFERENCES person (id);
|
||||
ALTER TABLE smssettings ADD CONSTRAINT FK_61178A624D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE commodity_drop ADD CONSTRAINT FK_14E674574D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE storeroom ADD CONSTRAINT FK_3E2092A84D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE storeroom_item ADD CONSTRAINT FK_6CA8F5E0700047D2 FOREIGN KEY (ticket_id) REFERENCES storeroom_ticket (id);
|
||||
ALTER TABLE storeroom_item ADD CONSTRAINT FK_6CA8F5E0B4ACC212 FOREIGN KEY (commodity_id) REFERENCES commodity (id);
|
||||
ALTER TABLE storeroom_item ADD CONSTRAINT FK_6CA8F5E04D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE storeroom_item ADD CONSTRAINT FK_6CA8F5E0C9330186 FOREIGN KEY (storeroom_id) REFERENCES storeroom (id);
|
||||
ALTER TABLE shareholder ADD CONSTRAINT FK_D5FE68CC4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE shareholder ADD CONSTRAINT FK_D5FE68CC217BBB47 FOREIGN KEY (person_id) REFERENCES person (id);
|
||||
ALTER TABLE hesabdari_table ADD CONSTRAINT FK_40F7185C6F3C117F FOREIGN KEY (upper_id) REFERENCES hesabdari_table (id);
|
||||
ALTER TABLE commodity_drop_link ADD CONSTRAINT FK_8626B6BDC15B0809 FOREIGN KEY (commoditydrop_id) REFERENCES commodity_drop (id);
|
||||
ALTER TABLE commodity_drop_link ADD CONSTRAINT FK_8626B6BDB4ACC212 FOREIGN KEY (commodity_id) REFERENCES commodity (id);
|
||||
ALTER TABLE commodity_cat ADD CONSTRAINT FK_687F6B14D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE apitoken ADD CONSTRAINT FK_23E5A7D34D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE apitoken ADD CONSTRAINT FK_23E5A7D3919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE commodity ADD CONSTRAINT FK_5E8D2F74F8BD700D FOREIGN KEY (unit_id) REFERENCES commodity_unit (id);
|
||||
ALTER TABLE commodity ADD CONSTRAINT FK_5E8D2F744D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE commodity ADD CONSTRAINT FK_5E8D2F74E6ADA943 FOREIGN KEY (cat_id) REFERENCES commodity_cat (id);
|
||||
ALTER TABLE pay_info_temp ADD CONSTRAINT FK_7F36E8384D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
||||
ALTER TABLE pay_info_temp ADD CONSTRAINT FK_7F36E838895648BC FOREIGN KEY (doc_id) REFERENCES hesabdari_doc (id);
|
||||
ALTER TABLE printer_queue ADD CONSTRAINT FK_93F2764B919E5513 FOREIGN KEY (submitter_id) REFERENCES user (id);
|
||||
ALTER TABLE printer_queue ADD CONSTRAINT FK_93F2764B4D9866B8 FOREIGN KEY (bid_id) REFERENCES business (id);
|
|
@ -6,6 +6,7 @@ use App\Service\Log;
|
|||
use App\Service\Access;
|
||||
use App\Service\JsonResp;
|
||||
use App\Entity\HesabdariDoc;
|
||||
use App\Entity\PersonType;
|
||||
use App\Entity\StoreroomTicket;
|
||||
use App\Service\Explore as ServiceExplore;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
|
|
@ -2,49 +2,50 @@
|
|||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Service\Log;
|
||||
use App\Service\Jdate;
|
||||
use App\Service\Access;
|
||||
use App\Entity\Business;
|
||||
use App\Entity\Commodity;
|
||||
use App\Entity\Storeroom;
|
||||
use App\Service\Provider;
|
||||
use App\Entity\CommodityCat;
|
||||
use App\Entity\HesabdariRow;
|
||||
use App\Entity\CommodityDrop;
|
||||
use App\Entity\CommodityUnit;
|
||||
use App\Entity\HesabdariRow;
|
||||
use App\Entity\Storeroom;
|
||||
use App\Entity\StoreroomItem;
|
||||
use App\Service\Access;
|
||||
use App\Service\Jdate;
|
||||
use App\Service\Log;
|
||||
use App\Service\Provider;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
class CommodityController extends AbstractController
|
||||
{
|
||||
#[Route('/api/commodity/list', name: 'app_commodity_list')]
|
||||
public function app_commodity_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_list(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
if(!$access->hasRole('commodity'))
|
||||
if (!$access->hasRole('commodity'))
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if(array_key_exists('speedAccess',$params)){
|
||||
if (array_key_exists('speedAccess', $params)) {
|
||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid'=>$request->headers->get('activeBid'),
|
||||
'speedAccess'=>true
|
||||
'bid' => $request->headers->get('activeBid'),
|
||||
'speedAccess' => true
|
||||
]);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid'=>$request->headers->get('activeBid')
|
||||
'bid' => $request->headers->get('activeBid')
|
||||
]);
|
||||
}
|
||||
$res = [];
|
||||
foreach ($items as $item){
|
||||
foreach ($items as $item) {
|
||||
$temp = [];
|
||||
$temp['id'] = $item->getId();
|
||||
$temp['name'] = $item->getName();
|
||||
|
@ -55,10 +56,10 @@ class CommodityController extends AbstractController
|
|||
$temp['priceSell'] = $item->getPriceSell();
|
||||
$temp['code'] = $item->getCode();
|
||||
$temp['cat'] = null;
|
||||
if($item->getCat())
|
||||
if ($item->getCat())
|
||||
$temp['cat'] = $item->getCat()->getName();
|
||||
$temp['khadamat'] = false;
|
||||
if($item->isKhadamat())
|
||||
if ($item->isKhadamat())
|
||||
$temp['khadamat'] = true;
|
||||
|
||||
$temp['commodityCountCheck'] = $item->isCommodityCountCheck();
|
||||
|
@ -69,87 +70,135 @@ class CommodityController extends AbstractController
|
|||
}
|
||||
return $this->json($res);
|
||||
}
|
||||
#[Route('/api/commodity/list/print', name: 'app_commodity_list_print')]
|
||||
public function app_commodity_list_print(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route('/api/commodity/list/excel', name: 'app_commodity_list_excel')]
|
||||
public function app_commodity_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid'=>$request->headers->get('activeBid')
|
||||
]);
|
||||
$pid = $provider->createPrint(
|
||||
$acc['bid'],
|
||||
$this->getUser(),
|
||||
$this->renderView('pdf/commodity.html.twig',[
|
||||
'page_title'=>'فهرست کالا و خدمات',
|
||||
'bid'=>$acc['bid'],
|
||||
'persons'=>$items
|
||||
]));
|
||||
return $this->json(['id'=>$pid]);
|
||||
}
|
||||
#[Route('/api/commodity/info/{code}', name: 'app_commodity_info')]
|
||||
public function app_commodity_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'code'=>$code
|
||||
]);
|
||||
$data->setUnit($data->getUnit()->getName());
|
||||
$res = $provider->Entity2ArrayJustIncludes($data,['isSpeedAccess','isCommodityCountCheck','getName','getUnit','getPriceBuy','getPriceSell','getCat','getOrderPoint','getdes','getId','getDayLoading','isKhadamat','getCode','getMinOrderCount','getLabel'],1);
|
||||
$res['cat'] = '';
|
||||
if($data->getCat())
|
||||
$res['cat'] = $data->getCat()->getId();
|
||||
return $this->json($res);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/mod/{code}', name: 'app_commodity_mod')]
|
||||
public function app_commodity_mod(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if(!array_key_exists('name',$params))
|
||||
return $this->json(['result'=>-1]);
|
||||
if(count_chars(trim($params['name'])) == 0)
|
||||
return $this->json(['result'=>3]);
|
||||
if($code == 0){
|
||||
if (!array_key_exists('items', $params)) {
|
||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
} else {
|
||||
$items = [];
|
||||
foreach ($params['items'] as $param) {
|
||||
$prs = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'id' => $param['id'],
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
if ($prs)
|
||||
$items[] = $prs;
|
||||
}
|
||||
}
|
||||
return new BinaryFileResponse($provider->createExcell($items));
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/list/print', name: 'app_commodity_list_print')]
|
||||
public function app_commodity_list_print(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if (!array_key_exists('items', $params)) {
|
||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid' => $request->headers->get('activeBid')
|
||||
]);
|
||||
} else {
|
||||
$items = [];
|
||||
foreach ($params['items'] as $param) {
|
||||
$prs = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'id' => $param['id'],
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
if ($prs)
|
||||
$items[] = $prs;
|
||||
}
|
||||
}
|
||||
|
||||
$pid = $provider->createPrint(
|
||||
$acc['bid'],
|
||||
$this->getUser(),
|
||||
$this->renderView('pdf/commodity.html.twig', [
|
||||
'page_title' => 'فهرست کالا و خدمات',
|
||||
'bid' => $acc['bid'],
|
||||
'persons' => $items
|
||||
])
|
||||
);
|
||||
return $this->json(['id' => $pid]);
|
||||
}
|
||||
#[Route('/api/commodity/info/{code}', name: 'app_commodity_info')]
|
||||
public function app_commodity_info($code, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'code' => $code
|
||||
]);
|
||||
$data->setUnit($data->getUnit()->getName());
|
||||
$res = $provider->Entity2ArrayJustIncludes($data, ['isSpeedAccess', 'isCommodityCountCheck', 'getName', 'getUnit', 'getPriceBuy', 'getPriceSell', 'getCat', 'getOrderPoint', 'getdes', 'getId', 'getDayLoading', 'isKhadamat', 'getCode', 'getMinOrderCount', 'getLabel'], 1);
|
||||
$res['cat'] = '';
|
||||
if ($data->getCat())
|
||||
$res['cat'] = $data->getCat()->getId();
|
||||
return $this->json($res);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/mod/{code}', name: 'app_commodity_mod')]
|
||||
public function app_commodity_mod(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if (!array_key_exists('name', $params))
|
||||
return $this->json(['result' => -1]);
|
||||
if (count_chars(trim($params['name'])) == 0)
|
||||
return $this->json(['result' => 3]);
|
||||
if ($code == 0) {
|
||||
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'name'=>$params['name']
|
||||
'name' => $params['name']
|
||||
]);
|
||||
//check exist before
|
||||
if($data)
|
||||
return $this->json(['result'=>2]);
|
||||
if ($data)
|
||||
return $this->json(['result' => 2]);
|
||||
$data = new Commodity();
|
||||
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'),'Commodity'));
|
||||
}
|
||||
else{
|
||||
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'Commodity'));
|
||||
} else {
|
||||
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'code'=>$code
|
||||
'bid' => $acc['bid'],
|
||||
'code' => $code
|
||||
]);
|
||||
if(!$data)
|
||||
if (!$data)
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
$unit = $entityManager->getRepository(CommodityUnit::class)->findOneBy(['name'=>$params['unit']]);
|
||||
if(!$unit)
|
||||
$unit = $entityManager->getRepository(CommodityUnit::class)->findOneBy(['name' => $params['unit']]);
|
||||
if (!$unit)
|
||||
throw $this->createNotFoundException('unit not fount!');
|
||||
$data->setUnit($unit);
|
||||
$data->setBid($acc['bid']);
|
||||
$data->setname($params['name']);
|
||||
if($params['khadamat'] == 'true') $data->setKhadamat(true);
|
||||
if ($params['khadamat'] == 'true') $data->setKhadamat(true);
|
||||
else $data->setKhadamat(false);
|
||||
$data->setDes($params['des']);
|
||||
$data->setPriceSell($params['priceSell']);
|
||||
$data->setPriceBuy($params['priceBuy']);
|
||||
if(array_key_exists('commodityCountCheck',$params)){
|
||||
if (array_key_exists('commodityCountCheck', $params)) {
|
||||
$data->setCommodityCountCheck($params['commodityCountCheck']);
|
||||
}
|
||||
$data->setMinOrderCount($params['minOrderCount']);
|
||||
|
@ -157,14 +206,14 @@ class CommodityController extends AbstractController
|
|||
$data->setDayLoading($params['dayLoading']);
|
||||
$data->setOrderPoint($params['orderPoint']);
|
||||
//set cat
|
||||
if(array_key_exists('cat',$params)){
|
||||
if($params['cat'] != ''){
|
||||
if(is_int($params['cat']))
|
||||
if (array_key_exists('cat', $params)) {
|
||||
if ($params['cat'] != '') {
|
||||
if (is_int($params['cat']))
|
||||
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']);
|
||||
else
|
||||
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']['id']);
|
||||
if($cat){
|
||||
if($cat->getBid() == $acc['bid']){
|
||||
if ($cat) {
|
||||
if ($cat->getBid() == $acc['bid']) {
|
||||
$data->setCat($cat);
|
||||
}
|
||||
}
|
||||
|
@ -172,64 +221,63 @@ class CommodityController extends AbstractController
|
|||
}
|
||||
$entityManager->persist($data);
|
||||
$entityManager->flush();
|
||||
$log->insert('کالا و خدمات','کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
|
||||
$log->insert('کالا و خدمات', 'کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
|
||||
return $this->json(['result' => 1]);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/units', name: 'app_commodity_units')]
|
||||
public function app_commodity_units(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_units(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
if(!$access->hasRole('commodity'))
|
||||
if (!$access->hasRole('commodity'))
|
||||
throw $this->createAccessDeniedException();
|
||||
$items = $entityManager->getRepository(CommodityUnit::class)->findAll();
|
||||
return $this->json($items);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/drop/list', name: 'app_commodity_drop_list')]
|
||||
public function app_commodity_drop_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_drop_list(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
if(!$access->hasRole('commodity'))
|
||||
if (!$access->hasRole('commodity'))
|
||||
throw $this->createAccessDeniedException();
|
||||
$items = $entityManager->getRepository(CommodityDrop::class)->findBy([
|
||||
'bid'=>$request->headers->get('activeBid')
|
||||
'bid' => $request->headers->get('activeBid')
|
||||
]);
|
||||
$generalItems = $entityManager->getRepository(CommodityDrop::class)->findBy([
|
||||
'bid'=>null
|
||||
'bid' => null
|
||||
]);
|
||||
|
||||
return $this->json($provider->ArrayEntity2Array(array_merge($items,$generalItems),0));
|
||||
return $this->json($provider->ArrayEntity2Array(array_merge($items, $generalItems), 0));
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/drop/mod/{code}', name: 'app_commodity_drop_mod')]
|
||||
public function app_commodity_drop_mod(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||
public function app_commodity_drop_mod(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if(!array_key_exists('name',$params))
|
||||
return $this->json(['result'=>-1]);
|
||||
if(count_chars(trim($params['name'])) == 0)
|
||||
return $this->json(['result'=>3]);
|
||||
if($code == 0){
|
||||
if (!array_key_exists('name', $params))
|
||||
return $this->json(['result' => -1]);
|
||||
if (count_chars(trim($params['name'])) == 0)
|
||||
return $this->json(['result' => 3]);
|
||||
if ($code == 0) {
|
||||
$data = $entityManager->getRepository(CommodityDrop::class)->findOneBy([
|
||||
'name'=>$params['name'],
|
||||
'bid'=>$acc['bid']
|
||||
'name' => $params['name'],
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
//check exist before
|
||||
if($data)
|
||||
return $this->json(['result'=>2]);
|
||||
if ($data)
|
||||
return $this->json(['result' => 2]);
|
||||
$data = new CommodityDrop();
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$data = $entityManager->getRepository(CommodityDrop::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'id'=>$code
|
||||
'bid' => $acc['bid'],
|
||||
'id' => $code
|
||||
]);
|
||||
if(!$data)
|
||||
if (!$data)
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
$data->setName($params['name']);
|
||||
|
@ -237,7 +285,7 @@ class CommodityController extends AbstractController
|
|||
$data->setCanEdit(true);
|
||||
$entityManager->persist($data);
|
||||
$entityManager->flush();
|
||||
$log->insert('کالا و خدمات','ویژگی کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
|
||||
$log->insert('کالا و خدمات', 'ویژگی کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
|
||||
return $this->json(['result' => 1]);
|
||||
}
|
||||
|
||||
|
@ -245,94 +293,93 @@ class CommodityController extends AbstractController
|
|||
* @throws \ReflectionException
|
||||
*/
|
||||
#[Route('/api/commodity/drop/info/{code}', name: 'app_commodity_drop_info')]
|
||||
public function app_commodity_drop_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_drop_info($code, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$data = $entityManager->getRepository(CommodityDrop::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'id'=>$code
|
||||
'bid' => $acc['bid'],
|
||||
'id' => $code
|
||||
]);
|
||||
return $this->json($provider->Entity2Array($data,0));
|
||||
return $this->json($provider->Entity2Array($data, 0));
|
||||
}
|
||||
#[Route('/api/commodity/cat/get/line', name: 'app_commodity_cat_get_line')]
|
||||
public function app_commodity_cat_get_line(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_cat_get_line(Jdate $jdate, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$temp =[];
|
||||
$temp = [];
|
||||
$nodes = $entityManager->getRepository(CommodityCat::class)->findBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'bid' => $acc['bid'],
|
||||
]);
|
||||
if(count($nodes) == 0)
|
||||
$nodes = $this->createDefaultCat($acc['bid'],$entityManager);
|
||||
return $this->json($provider->ArrayEntity2Array($nodes,0));
|
||||
if (count($nodes) == 0)
|
||||
$nodes = $this->createDefaultCat($acc['bid'], $entityManager);
|
||||
return $this->json($provider->ArrayEntity2Array($nodes, 0));
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/cat/get', name: 'app_commodity_cat_get')]
|
||||
public function app_commodity_cat_get(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_cat_get(Jdate $jdate, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$temp =[];
|
||||
$temp = [];
|
||||
$nodes = $entityManager->getRepository(CommodityCat::class)->findBy([
|
||||
'bid'=>$acc['bid']
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
if(count($nodes) == 0)
|
||||
$nodes = $this->createDefaultCat($acc['bid'],$entityManager);
|
||||
foreach ($nodes as $node){
|
||||
if($this->hasChild($entityManager,$node)){
|
||||
$temp[$node->getId()]=[
|
||||
'text'=>$node->getName(),
|
||||
'children'=>$this->getChildsLabel($entityManager,$node)
|
||||
if (count($nodes) == 0)
|
||||
$nodes = $this->createDefaultCat($acc['bid'], $entityManager);
|
||||
foreach ($nodes as $node) {
|
||||
if ($this->hasChild($entityManager, $node)) {
|
||||
$temp[$node->getId()] = [
|
||||
'text' => $node->getName(),
|
||||
'children' => $this->getChildsLabel($entityManager, $node)
|
||||
];
|
||||
}
|
||||
else{
|
||||
$temp[$node->getId()]=[
|
||||
'text'=>$node->getName(),
|
||||
} else {
|
||||
$temp[$node->getId()] = [
|
||||
'text' => $node->getName(),
|
||||
];
|
||||
}
|
||||
}
|
||||
$root = $entityManager->getRepository(CommodityCat::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'root'=>true
|
||||
'bid' => $acc['bid'],
|
||||
'root' => true
|
||||
]);
|
||||
return $this->json(['items'=>$temp,'root'=>$root->getId()]);
|
||||
return $this->json(['items' => $temp, 'root' => $root->getId()]);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/cat/childs', name: 'app_commodity_cat_childs')]
|
||||
public function app_commodity_cat_childs(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_cat_childs(Jdate $jdate, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
$items= $entityManager->getRepository(CommodityCat::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'root'=>true
|
||||
$items = $entityManager->getRepository(CommodityCat::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'root' => true
|
||||
]);
|
||||
return $this->json($this->getChilds($entityManager,$items));
|
||||
return $this->json($this->getChilds($entityManager, $items));
|
||||
}
|
||||
#[Route('/api/commodity/cat/insert', name: 'app_commodity_cat_insert')]
|
||||
public function app_commodity_cat_insert(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_cat_insert(Jdate $jdate, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if(!array_key_exists('upper',$params) || !array_key_exists('text',$params))
|
||||
return $this->json(['result'=>-1]);
|
||||
if (!array_key_exists('upper', $params) || !array_key_exists('text', $params))
|
||||
return $this->json(['result' => -1]);
|
||||
$upper = $entityManager->getRepository(CommodityCat::class)->find($params['upper']);
|
||||
if($upper){
|
||||
if($upper->getBid() == $acc['bid']){
|
||||
if ($upper) {
|
||||
if ($upper->getBid() == $acc['bid']) {
|
||||
$cat = new CommodityCat();
|
||||
$cat->setBid($acc['bid']);
|
||||
$cat->setRoot(false);
|
||||
|
@ -340,40 +387,41 @@ class CommodityController extends AbstractController
|
|||
$cat->setUpper($upper->getId());
|
||||
$entityManager->persist($cat);
|
||||
$entityManager->flush();
|
||||
return $this->json(['result'=>1,'id'=>$cat->getId()]);
|
||||
return $this->json(['result' => 1, 'id' => $cat->getId()]);
|
||||
}
|
||||
}
|
||||
return $this->json(['result'=>1]);
|
||||
return $this->json(['result' => 1]);
|
||||
}
|
||||
#[Route('/api/commodity/cat/edit', name: 'app_commodity_cat_edit')]
|
||||
public function app_commodity_cat_edit(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_cat_edit(Jdate $jdate, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
if(!array_key_exists('id',$params) || !array_key_exists('text',$params))
|
||||
return $this->json(['result'=>-1]);
|
||||
if (!array_key_exists('id', $params) || !array_key_exists('text', $params))
|
||||
return $this->json(['result' => -1]);
|
||||
$node = $entityManager->getRepository(CommodityCat::class)->find($params['id']);
|
||||
if($node){
|
||||
if($node->getBid() == $acc['bid']){
|
||||
if ($node) {
|
||||
if ($node->getBid() == $acc['bid']) {
|
||||
$node->setName($params['text']);
|
||||
$entityManager->persist($node);
|
||||
$entityManager->flush();
|
||||
return $this->json(['result'=>1,'id'=>$node->getId()]);
|
||||
return $this->json(['result' => 1, 'id' => $node->getId()]);
|
||||
}
|
||||
}
|
||||
return $this->json(['result'=>1]);
|
||||
return $this->json(['result' => 1]);
|
||||
}
|
||||
private function getChildsLabel(EntityManagerInterface $entityManager, mixed $node){
|
||||
private function getChildsLabel(EntityManagerInterface $entityManager, mixed $node)
|
||||
{
|
||||
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
|
||||
'upper'=>$node
|
||||
'upper' => $node
|
||||
]);
|
||||
$temp = [];
|
||||
foreach ($childs as $child){
|
||||
foreach ($childs as $child) {
|
||||
$temp[] = $child->getId();
|
||||
}
|
||||
return $temp;
|
||||
|
@ -381,37 +429,37 @@ class CommodityController extends AbstractController
|
|||
|
||||
private function hasChild(EntityManagerInterface $entityManager, mixed $node)
|
||||
{
|
||||
if(count($entityManager->getRepository(CommodityCat::class)->findBy([
|
||||
'upper'=>$node
|
||||
]))!= 0)
|
||||
if (count($entityManager->getRepository(CommodityCat::class)->findBy([
|
||||
'upper' => $node
|
||||
])) != 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getChilds(EntityManagerInterface $entityManager, mixed $node){
|
||||
private function getChilds(EntityManagerInterface $entityManager, mixed $node)
|
||||
{
|
||||
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
|
||||
'upper'=>$node
|
||||
'upper' => $node
|
||||
]);
|
||||
$temp = [];
|
||||
foreach ($childs as $child){
|
||||
if($this->hasChild($entityManager,$child)){
|
||||
$temp[]=[
|
||||
'id'=>$child->getId(),
|
||||
'label'=>$child->getName(),
|
||||
'children'=>$this->getChilds($entityManager,$child)
|
||||
foreach ($childs as $child) {
|
||||
if ($this->hasChild($entityManager, $child)) {
|
||||
$temp[] = [
|
||||
'id' => $child->getId(),
|
||||
'label' => $child->getName(),
|
||||
'children' => $this->getChilds($entityManager, $child)
|
||||
];
|
||||
}
|
||||
else{
|
||||
$temp[]=[
|
||||
'id'=>$child->getId(),
|
||||
'label'=>$child->getName(),
|
||||
} else {
|
||||
$temp[] = [
|
||||
'id' => $child->getId(),
|
||||
'label' => $child->getName(),
|
||||
];
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
public function createDefaultCat(Business $bid,EntityManagerInterface $en): array
|
||||
public function createDefaultCat(Business $bid, EntityManagerInterface $en): array
|
||||
{
|
||||
$item = new CommodityCat();
|
||||
$item->setName('دسته بندی ها');
|
||||
|
@ -427,14 +475,14 @@ class CommodityController extends AbstractController
|
|||
$child->setName('بدون دستهبندی');
|
||||
$en->persist($child);
|
||||
$en->flush();
|
||||
return [$item,$child];
|
||||
return [$item, $child];
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/import/excel', name: 'app_commodity_import_excel')]
|
||||
public function app_commodity_import_excel(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
public function app_commodity_import_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$file = $request->files->get('file');
|
||||
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
|
||||
|
@ -443,32 +491,32 @@ class CommodityController extends AbstractController
|
|||
$sheet = $spreadsheet->getSheet($spreadsheet->getFirstSheetIndex());
|
||||
$data = $sheet->toArray();
|
||||
unset($data[0]);
|
||||
|
||||
foreach($data as $item){
|
||||
|
||||
foreach ($data as $item) {
|
||||
//load cat
|
||||
$unit = $entityManager->getRepository(commodity::class)->findOneBy([
|
||||
'name'=>$item[7],
|
||||
'name' => $item[7],
|
||||
]);
|
||||
if(!$unit){
|
||||
if (!$unit) {
|
||||
$unit = $entityManager->getRepository(CommodityUnit::class)->findAll()[0];
|
||||
}
|
||||
|
||||
$commodity = $entityManager->getRepository(commodity::class)->findOneBy([
|
||||
'name'=>$item[2],
|
||||
'bid' =>$acc['bid']
|
||||
'name' => $item[2],
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
$cat = $entityManager->getRepository(CommodityCat::class)->findOneBy([
|
||||
'name'=>$item[8],
|
||||
'bid' =>$acc['bid']
|
||||
'name' => $item[8],
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
|
||||
$rootcat = $entityManager->getRepository(CommodityCat::class)->findOneBy([
|
||||
'name'=>'دسته بندی ها',
|
||||
'bid' =>$acc['bid'],
|
||||
'root'=>'1',
|
||||
'upper'=>null
|
||||
'name' => 'دسته بندی ها',
|
||||
'bid' => $acc['bid'],
|
||||
'root' => '1',
|
||||
'upper' => null
|
||||
]);
|
||||
if(!$cat){
|
||||
if (!$cat) {
|
||||
$cat = new CommodityCat();
|
||||
$cat->setBid($acc['bid']);
|
||||
$cat->setName($item[8]);
|
||||
|
@ -478,66 +526,61 @@ class CommodityController extends AbstractController
|
|||
$entityManager->flush();
|
||||
}
|
||||
//check exist before
|
||||
if(!$commodity){
|
||||
|
||||
if (!$commodity) {
|
||||
$commodity = new commodity();
|
||||
|
||||
}
|
||||
$commodity->setCode($provider->getAccountingCode($request->headers->get('activeBid'),'commodity'));
|
||||
$commodity->setName($item[2]);
|
||||
$commodity->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'commodity'));
|
||||
$commodity->setBid($acc['bid']);
|
||||
$commodity->setUnit($unit);
|
||||
$commodity->setCat($cat);
|
||||
$commodity->setOrderPoint(0);
|
||||
$commodity->setDayLoading(0);
|
||||
if(array_key_exists(3,$item))
|
||||
$commodity->setPriceSell($item[3]);
|
||||
if(array_key_exists(4,$item))
|
||||
$commodity->setPriceBuy($item[4]);
|
||||
if(array_key_exists(1,$item))
|
||||
$commodity->setSpeedAccess($item[1]);
|
||||
if(array_key_exists(5,$item))
|
||||
$commodity->setMinOrderCount($item[5]);
|
||||
if(array_key_exists(6,$item))
|
||||
$commodity->setDes($item[6]);
|
||||
if(array_key_exists(0,$item)){
|
||||
$commodity->setKhadamat(true);
|
||||
if($item[0] == '1'){
|
||||
$commodity->setKhadamat(false);
|
||||
}
|
||||
}
|
||||
$commodity->setName($item[2]);
|
||||
$commodity->setUnit($unit);
|
||||
$commodity->setCat($cat);
|
||||
$commodity->setOrderPoint(0);
|
||||
$commodity->setDayLoading(0);
|
||||
if (array_key_exists(3, $item))
|
||||
$commodity->setPriceSell($item[3]);
|
||||
if (array_key_exists(4, $item))
|
||||
$commodity->setPriceBuy($item[4]);
|
||||
if (array_key_exists(1, $item))
|
||||
$commodity->setSpeedAccess($item[1]);
|
||||
if (array_key_exists(5, $item))
|
||||
$commodity->setMinOrderCount($item[5]);
|
||||
if (array_key_exists(6, $item))
|
||||
$commodity->setDes($item[6]);
|
||||
if (array_key_exists(0, $item)) {
|
||||
$commodity->setKhadamat(true);
|
||||
if ($item[0] == '1') {
|
||||
$commodity->setKhadamat(false);
|
||||
}
|
||||
$entityManager->persist($commodity);
|
||||
$entityManager->flush();
|
||||
}
|
||||
$entityManager->persist($commodity);
|
||||
$entityManager->flush();
|
||||
}
|
||||
$log->insert('کالا/خدمات','تعداد '. count($data) . ' کالا یا خدمات به صورت گروهی وارد شد.',$this->getUser(),$request->headers->get('activeBid'));
|
||||
$log->insert('کالا/خدمات', 'تعداد ' . count($data) . ' کالا یا خدمات به صورت گروهی وارد شد.', $this->getUser(), $request->headers->get('activeBid'));
|
||||
return $this->json(['result' => 1]);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/delete/{code}', name: 'app_commodity_delete')]
|
||||
public function app_commodity_delete(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||
public function app_commodity_delete(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('commodity');
|
||||
if(!$acc)
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
$commodity = $entityManager->getRepository(Commodity::class)->findOneBy(['bid'=>$acc['bid'],'code'=>$code]);
|
||||
if(!$commodity)
|
||||
$commodity = $entityManager->getRepository(Commodity::class)->findOneBy(['bid' => $acc['bid'], 'code' => $code]);
|
||||
if (!$commodity)
|
||||
throw $this->createNotFoundException();
|
||||
//check accounting docs
|
||||
$docs = $entityManager->getRepository(HesabdariRow::class)->findby(['bid'=>$acc['bid'], 'commodity'=>$commodity]);
|
||||
if(count($docs) > 0)
|
||||
$docs = $entityManager->getRepository(HesabdariRow::class)->findby(['bid' => $acc['bid'], 'commodity' => $commodity]);
|
||||
if (count($docs) > 0)
|
||||
return $this->json(['result' => 2]);
|
||||
//check for storeroom docs
|
||||
$storeDocs = $entityManager->getRepository(StoreroomItem::class)->findby(['bid'=>$acc['bid'], 'commodity'=>$commodity]);
|
||||
if(count($storeDocs) > 0)
|
||||
$storeDocs = $entityManager->getRepository(StoreroomItem::class)->findby(['bid' => $acc['bid'], 'commodity' => $commodity]);
|
||||
if (count($storeDocs) > 0)
|
||||
return $this->json(['result' => 2]);
|
||||
|
||||
$comName = $commodity->getName();
|
||||
$entityManager->remove($commodity);
|
||||
$log->insert('کالا/خدمات',' کالا / خدمات با نام '. $comName . ' حذف شد. ',$this->getUser(),$acc['bid']->getId());
|
||||
$log->insert('کالا/خدمات', ' کالا / خدمات با نام ' . $comName . ' حذف شد. ', $this->getUser(), $acc['bid']->getId());
|
||||
return $this->json(['result' => 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -67,6 +67,9 @@ class ReportController extends AbstractController
|
|||
'name' => $item->getCommodity()->getName(),
|
||||
'unit' => $item->getCommodity()->getUnit()->getName(),
|
||||
'count' => $item->getCommdityCount(),
|
||||
'date' => $item->getDoc()->getDate(),
|
||||
'docCode' => $item->getDoc()->getCode(),
|
||||
'type' => $item->getDoc()->getType()
|
||||
];
|
||||
if ($params['type'] == 'buy') {
|
||||
$temp['priceAll'] = $item->getBd();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use App\Entity\BankAccount;
|
||||
|
@ -16,53 +17,57 @@ use App\Entity\Person;
|
|||
use App\Entity\PersonType;
|
||||
use App\Entity\Salary;
|
||||
|
||||
class Explore{
|
||||
public static function ExplorePersonType(PersonType $type){
|
||||
class Explore
|
||||
{
|
||||
public static function ExplorePersonType(PersonType $type)
|
||||
{
|
||||
return [
|
||||
'label'=>$type->getLabel(),
|
||||
'code'=>$type->getCode(),
|
||||
'checked'=>false
|
||||
'label' => $type->getLabel(),
|
||||
'code' => $type->getCode(),
|
||||
'checked' => false
|
||||
];
|
||||
}
|
||||
|
||||
public static function ExplorePersonTypes($types){
|
||||
|
||||
public static function ExplorePersonTypes($types)
|
||||
{
|
||||
$result = [];
|
||||
foreach($types as $type)
|
||||
foreach ($types as $type)
|
||||
$result[] = self::ExplorePersonType($type);
|
||||
return $result;
|
||||
}
|
||||
public static function ExploreSellDoc(HesabdariDoc $hesabdariDoc){
|
||||
public static function ExploreSellDoc(HesabdariDoc $hesabdariDoc)
|
||||
{
|
||||
$result = self::ExploreHesabdariDoc($hesabdariDoc);
|
||||
$person = [];
|
||||
$commodities = [];
|
||||
foreach($hesabdariDoc->getHesabdariRows() as $item){
|
||||
if($item->getPerson()){
|
||||
foreach ($hesabdariDoc->getHesabdariRows() as $item) {
|
||||
if ($item->getPerson()) {
|
||||
$person = self::ExplorePerson($item->getPerson());
|
||||
}
|
||||
elseif($item->getCommodity()){
|
||||
$commodities[] = Explore::ExploreCommodity($item->getCommodity(),$item->getCommdityCount(),$item->getDes());
|
||||
} elseif ($item->getCommodity()) {
|
||||
$commodities[] = Explore::ExploreCommodity($item->getCommodity(), $item->getCommdityCount(), $item->getDes());
|
||||
}
|
||||
}
|
||||
$result['person'] = $person;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function ExploreBuyDoc(HesabdariDoc $hesabdariDoc){
|
||||
public static function ExploreBuyDoc(HesabdariDoc $hesabdariDoc)
|
||||
{
|
||||
$result = self::ExploreHesabdariDoc($hesabdariDoc);
|
||||
$person = [];
|
||||
$commodities = [];
|
||||
foreach($hesabdariDoc->getHesabdariRows() as $item){
|
||||
if($item->getPerson()){
|
||||
foreach ($hesabdariDoc->getHesabdariRows() as $item) {
|
||||
if ($item->getPerson()) {
|
||||
$person = self::ExplorePerson($item->getPerson());
|
||||
}
|
||||
elseif($item->getCommodity()){
|
||||
$commodities[] = Explore::ExploreCommodity($item->getCommodity(),$item->getCommdityCount(),$item->getDes());
|
||||
} elseif ($item->getCommodity()) {
|
||||
$commodities[] = Explore::ExploreCommodity($item->getCommodity(), $item->getCommdityCount(), $item->getDes());
|
||||
}
|
||||
}
|
||||
$result['person'] = $person;
|
||||
return $result;
|
||||
}
|
||||
public static function ExploreHesabdariDoc(HesabdariDoc $doc){
|
||||
public static function ExploreHesabdariDoc(HesabdariDoc $doc)
|
||||
{
|
||||
return [
|
||||
'id' => $doc->getId(),
|
||||
'update' => $doc->getCode(),
|
||||
|
@ -81,14 +86,16 @@ class Explore{
|
|||
];
|
||||
}
|
||||
|
||||
public static function ExploreHesabdariRows($rows){
|
||||
public static function ExploreHesabdariRows($rows)
|
||||
{
|
||||
$result = [];
|
||||
foreach($rows as $row){
|
||||
foreach ($rows as $row) {
|
||||
$result[] = self::ExploreHesabdariRow($row);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public static function ExploreHesabdariRow(HesabdariRow $row){
|
||||
public static function ExploreHesabdariRow(HesabdariRow $row)
|
||||
{
|
||||
return [
|
||||
'id' => $row->getId(),
|
||||
'bid' => self::ExploreBid($row->getBid()),
|
||||
|
@ -103,12 +110,13 @@ class Explore{
|
|||
'des' => $row->getDes(),
|
||||
'plugin' => $row->getPlugin(),
|
||||
'commodity_count' => $row->getCommdityCount(),
|
||||
'commodity' => self::ExploreCommodity($row->getCommodity(),$row->getCommdityCount(),$row->getDes())
|
||||
'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes())
|
||||
];
|
||||
}
|
||||
|
||||
public static function ExploreCommodity(Commodity | null $item, int | null $count = 0,string $des = ''){
|
||||
if($item)
|
||||
public static function ExploreCommodity(Commodity | null $item, int | null $count = 0, string $des = '')
|
||||
{
|
||||
if ($item)
|
||||
return [
|
||||
'id' => $item->getId(),
|
||||
'code' => $item->getCode(),
|
||||
|
@ -120,14 +128,15 @@ class Explore{
|
|||
'speed_access' => $item->isSpeedAccess(),
|
||||
//most be completed
|
||||
'count' => $count,
|
||||
'unit' =>$item->getUnit()->getName(),
|
||||
'des' =>$des
|
||||
'unit' => $item->getUnit()->getName(),
|
||||
'des' => $des
|
||||
];
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function ExploreBank(BankAccount | null $item){
|
||||
if($item)
|
||||
public static function ExploreBank(BankAccount | null $item)
|
||||
{
|
||||
if ($item)
|
||||
return [
|
||||
'id' => $item->getId(),
|
||||
'code' => $item->getCode(),
|
||||
|
@ -137,8 +146,9 @@ class Explore{
|
|||
return null;
|
||||
}
|
||||
|
||||
public static function ExploreCashdesk(Cashdesk | null $item){
|
||||
if($item)
|
||||
public static function ExploreCashdesk(Cashdesk | null $item)
|
||||
{
|
||||
if ($item)
|
||||
return [
|
||||
'id' => $item->getId(),
|
||||
'code' => $item->getCode(),
|
||||
|
@ -147,8 +157,9 @@ class Explore{
|
|||
];
|
||||
return null;
|
||||
}
|
||||
public static function ExploreSalary(Salary | null $item){
|
||||
if($item)
|
||||
public static function ExploreSalary(Salary | null $item)
|
||||
{
|
||||
if ($item)
|
||||
return [
|
||||
'id' => $item->getId(),
|
||||
'code' => $item->getCode(),
|
||||
|
@ -157,8 +168,9 @@ class Explore{
|
|||
];
|
||||
return null;
|
||||
}
|
||||
public static function ExplorePerson(Person | null $person,array $typesAll){
|
||||
if($person){
|
||||
public static function ExplorePerson(Person | null $person, array $typesAll = [])
|
||||
{
|
||||
if ($person) {
|
||||
$res = [
|
||||
'id' => $person->getId(),
|
||||
'code' => $person->getCode(),
|
||||
|
@ -167,7 +179,7 @@ class Explore{
|
|||
'tel' => $person->getTel(),
|
||||
'mobile' => $person->getmobile(),
|
||||
'mobile2' => $person->getMobile2(),
|
||||
'des' =>$person->getDes(),
|
||||
'des' => $person->getDes(),
|
||||
'company' => $person->getCompany(),
|
||||
'shenasemeli' => $person->getShenasemeli(),
|
||||
'sabt' => $person->getSabt(),
|
||||
|
@ -180,42 +192,47 @@ class Explore{
|
|||
'website' => $person->getWebsite(),
|
||||
'fax' => $person->getFax(),
|
||||
'birthday' => $person->getBirthday(),
|
||||
'speedAccess'=>$person->isSpeedAccess(),
|
||||
'speedAccess' => $person->isSpeedAccess(),
|
||||
'address' => $person->getAddress(),
|
||||
];
|
||||
$res['accounts'] = self::ExplorePersonCards($person);
|
||||
$res['types'] = self::ExplorePersonTypes($typesAll);
|
||||
|
||||
foreach($res['types'] as $key=>$item){
|
||||
foreach($person->getType() as $type){
|
||||
if($item['code'] == $type->getCode())
|
||||
$res['types'][$key]['checked'] = true;
|
||||
if (count($typesAll) != 0) {
|
||||
$res['types'] = self::ExplorePersonTypes($typesAll);
|
||||
foreach ($res['types'] as $key => $item) {
|
||||
foreach ($person->getType() as $type) {
|
||||
if ($item['code'] == $type->getCode())
|
||||
$res['types'][$key]['checked'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static function ExplorePersons($items,$types){
|
||||
public static function ExplorePersons($items, $types)
|
||||
{
|
||||
$result = [];
|
||||
foreach($items as $item)
|
||||
$result[] = self::ExplorePerson($item,$types);
|
||||
foreach ($items as $item)
|
||||
$result[] = self::ExplorePerson($item, $types);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function ExplorePersonCards(Person $person){
|
||||
|
||||
public static function ExplorePersonCards(Person $person)
|
||||
{
|
||||
$res = [];
|
||||
foreach($person->getPersonCards() as $item){
|
||||
foreach ($person->getPersonCards() as $item) {
|
||||
$res[] = [
|
||||
'bank'=>$item->getBank(),
|
||||
'shabaNum'=>$item->getShabaNum(),
|
||||
'cardNum'=>$item->getCardNum(),
|
||||
'accountNum'=>$item->getAccountNum()
|
||||
'bank' => $item->getBank(),
|
||||
'shabaNum' => $item->getShabaNum(),
|
||||
'cardNum' => $item->getCardNum(),
|
||||
'accountNum' => $item->getAccountNum()
|
||||
];
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public static function ExploreHesabdariTable(HesabdariTable $table){
|
||||
public static function ExploreHesabdariTable(HesabdariTable $table)
|
||||
{
|
||||
return [
|
||||
'id' => $table->getId(),
|
||||
'upper_id' => $table->getUpper()->getId(),
|
||||
|
@ -224,14 +241,16 @@ class Explore{
|
|||
'code' => $table->getCode()
|
||||
];
|
||||
}
|
||||
public static function ExploreMoney(Money $money){
|
||||
public static function ExploreMoney(Money $money)
|
||||
{
|
||||
return [
|
||||
'id' => $money->getId(),
|
||||
'label' => $money->getLabel(),
|
||||
'name' => $money->getName(),
|
||||
];
|
||||
}
|
||||
public static function ExploreYear(Year $year){
|
||||
public static function ExploreYear(Year $year)
|
||||
{
|
||||
return [
|
||||
'id' => $year->getId(),
|
||||
'label' => $year->getLabel(),
|
||||
|
@ -242,14 +261,16 @@ class Explore{
|
|||
];
|
||||
}
|
||||
|
||||
public static function ExploreUser(User $user){
|
||||
public static function ExploreUser(User $user)
|
||||
{
|
||||
return [
|
||||
'id' => $user->getId(),
|
||||
'name' => $user->getFullName()
|
||||
];
|
||||
}
|
||||
|
||||
public static function ExploreBid(Business $bid){
|
||||
public static function ExploreBid(Business $bid)
|
||||
{
|
||||
return [
|
||||
'id' => $bid->getId(),
|
||||
'name' => $bid->getName(),
|
||||
|
@ -257,49 +278,51 @@ class Explore{
|
|||
];
|
||||
}
|
||||
|
||||
public static function ExploreBuyDocsList(array $items){
|
||||
public static function ExploreBuyDocsList(array $items)
|
||||
{
|
||||
$result = [];
|
||||
foreach($items as $item){
|
||||
foreach ($items as $item) {
|
||||
$result[] = [
|
||||
'id'=>$item->getId(),
|
||||
'date'=>$item->getDate(),
|
||||
'des'=>$item->getDes(),
|
||||
'id' => $item->getId(),
|
||||
'date' => $item->getDate(),
|
||||
'des' => $item->getDes(),
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function SerializeCheque(Cheque | null $cheque){
|
||||
if(!$cheque)
|
||||
public static function SerializeCheque(Cheque | null $cheque)
|
||||
{
|
||||
if (!$cheque)
|
||||
return null;
|
||||
$jdate = new Jdate;
|
||||
$label = '';
|
||||
if($cheque->getType() == 'input')
|
||||
if ($cheque->getType() == 'input')
|
||||
$label = 'چک شماره ' . $cheque->getNumber() . ' مربوط به ' . $cheque->getPerson()->getNikename() . ' با مبلغ ' . $cheque->getAmount();
|
||||
return [
|
||||
'id' => $cheque->getId(),
|
||||
'number'=> $cheque->getNumber(),
|
||||
'sayadNum'=>$cheque->getSayadNum(),
|
||||
'chequeBank'=>$cheque->getBankOncheque(),
|
||||
'person'=>self::ExplorePerson($cheque->getPerson()),
|
||||
'bank'=>self::ExploreBank($cheque->getBank()),
|
||||
'des'=>$cheque->getDes(),
|
||||
'datePay'=>$cheque->getPayDate(),
|
||||
'type'=>$cheque->getType(),
|
||||
'amount'=>$cheque->getAmount(),
|
||||
'status'=>$cheque->getStatus(),
|
||||
'date'=>$cheque->getDate(),
|
||||
'locked'=>$cheque->isLocked(),
|
||||
'rejected'=>$cheque->isRejected(),
|
||||
'number' => $cheque->getNumber(),
|
||||
'sayadNum' => $cheque->getSayadNum(),
|
||||
'chequeBank' => $cheque->getBankOncheque(),
|
||||
'person' => self::ExplorePerson($cheque->getPerson()),
|
||||
'bank' => self::ExploreBank($cheque->getBank()),
|
||||
'des' => $cheque->getDes(),
|
||||
'datePay' => $cheque->getPayDate(),
|
||||
'type' => $cheque->getType(),
|
||||
'amount' => $cheque->getAmount(),
|
||||
'status' => $cheque->getStatus(),
|
||||
'date' => $cheque->getDate(),
|
||||
'locked' => $cheque->isLocked(),
|
||||
'rejected' => $cheque->isRejected(),
|
||||
'label' => $label
|
||||
];
|
||||
}
|
||||
|
||||
public static function SerializeCheques(array $cheques){
|
||||
public static function SerializeCheques(array $cheques)
|
||||
{
|
||||
$result = [];
|
||||
foreach($cheques as $cheque)
|
||||
foreach ($cheques as $cheque)
|
||||
$result[] = self::SerializeCheque($cheque);
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue