

CREATE TABLE `bluelogis_software_product_info` (
  `id` int NOT NULL,
  `product_name` text,
  `product_version` text,
  `product_logo` text,
  `product_title` text,
  `product_processflow_kblink` text CHARACTER SET latin1 COLLATE latin1_swedish_ci
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `bluelogis_software_product_info` (`id`, `product_name`, `product_version`, `product_logo`, `product_title`, `product_processflow_kblink`) VALUES
(1, 'BlueLogis NX', 'Version 5.1', 'logo.jpg', 'NVOCC ERP - BLUELOGIS CONSULTING', 'https://crm.bluelogis.app/crm/knowledge-base/article/bluelogis-nx-principal-software-process-flow');
ALTER TABLE `bluelogis_software_product_info`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `bluelogis_software_product_info`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

CREATE TABLE `user_softwareproduct_list` (
  `id` int NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `product_name` text,
  `product_desc` text,
  `product_url` text,
  `company` varchar(20) DEFAULT NULL,
  `location` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `user_softwareproduct_list` (`id`, `username`, `product_name`, `product_desc`, `product_url`, `company`, `location`) VALUES
(1, 'admin_bluelogis', 'BlueLogis NX', 'NVOCC Principal ERP  Module', 'https://aaratrans.bluelogis.app/nx/app', NULL, NULL);
ALTER TABLE `user_softwareproduct_list`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_softwareproduct_list_index` (`username`,`location`);
ALTER TABLE `user_softwareproduct_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;


CREATE TABLE `user_location_list` (
  `id` int NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `company` varchar(20) DEFAULT NULL,
  `company_alias` text,
  `location` varchar(20) DEFAULT NULL,
  `ip` text,
  `ua` text,
  `ekey` text,
  `company_id` text,
  `location_id` text,
  `created_by` text,
  `created_date` timestamp NULL DEFAULT NULL,
  `modified_by` text,
  `modified_date` timestamp NULL DEFAULT NULL,
  `temp_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `user_location_list` (`id`, `username`, `company`, `company_alias`, `location`, `ip`, `ua`, `ekey`, `company_id`, `location_id`, `created_by`, `created_date`, `modified_by`, `modified_date`, `temp_code`) VALUES
(1, 'admin_bluelogis', 'TAURUS', 'TAURUS', 'MUMBAI', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 'admin_bluelogis', 'TAURUS', 'TAURUS', 'DUBAI', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
ALTER TABLE `user_location_list`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_location_list_index` (`username`,`location`);
ALTER TABLE `user_location_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;


CREATE TABLE `validation_setup` (
  `id` int NOT NULL,
  `name` text,
  `value` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `validation_setup` (`id`, `name`, `value`) VALUES
(10, 'VALIDATE_SRR_MRG', 'YES'),
(11, 'VALIDATE_FETCH_FEEDERRATE', 'YES'),
(12, 'CONTAINER_WISE_INCOME_COST_ENTRY', 'YES'),
(13, 'INCOME_COST_SAME_LINE', 'NO'),
(14, 'FETCH_INLAND_HAULAGE_CHARGES', 'YES'),
(15, 'FETCH_TERMINAL_HANDLING_CHARGES', 'YES'),
(16, 'TRANSHIPMENT_TWO_VOYAGE_REQUIRED', 'YES');

ALTER TABLE `validation_setup`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `validation_setup`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

ALTER TABLE `page_list` ADD `page_url1` TEXT NULL AFTER `page_url`;
ALTER TABLE `page_list` ADD `ip` TEXT NULL AFTER `id`, ADD `ua` TEXT NULL AFTER `ip`, ADD `ekey` TEXT NULL AFTER `ua`, ADD `temp_code` TEXT NULL AFTER `ekey`, ADD `created_by` TEXT NULL AFTER `temp_code`, ADD `page_description` TEXT NULL AFTER `created_by`, ADD `kb_link` TEXT NULL AFTER `page_description`;

ALTER TABLE `mt_order_entry` ADD `export_order_no` TEXT NULL AFTER `order_no`;
ALTER TABLE `mt_order_entry` ADD `quote_id` TEXT NULL AFTER `cargo_type`;
ALTER TABLE `mt_order_entry` ADD `customer_id` TEXT NULL AFTER `customer`, ADD `customer_name` TEXT NULL AFTER `customer_id`;
ALTER TABLE `mt_order_entry` ADD `depot_name` TEXT NULL AFTER `depot`;
ALTER TABLE `mt_order_entry` ADD `shipper_name` TEXT NULL AFTER `shipper`, ADD `shipper_id` TEXT NULL AFTER `shipper_name`;
ALTER TABLE `mt_order_entry` ADD `consignee_name` TEXT NULL AFTER `consignee`, ADD `consignee_id` TEXT NULL AFTER `consignee_name`;

ALTER TABLE `mt_order_entry` ADD `pol_terminal` text;
ALTER TABLE `mt_order_entry` ADD `srr_no` text;
ALTER TABLE `mt_order_entry` ADD `srr_id` text;
ALTER TABLE `mt_order_entry` ADD `pod_agent` text;
ALTER TABLE `mt_order_entry` ADD `booking_party_name` text;
ALTER TABLE `mt_order_entry` ADD `booking_party` text;
ALTER TABLE `mt_order_entry` ADD `booking_party_id` text;
ALTER TABLE `mt_order_entry` ADD `can_issue_do` text;
ALTER TABLE `mt_order_entry` ADD `approved_remarks` text;
ALTER TABLE `mt_order_entry` ADD `approved_by` text;
ALTER TABLE `mt_order_entry` ADD `approved_date` date DEFAULT NULL;
ALTER TABLE `mt_order_entry` ADD `narration` text;
ALTER TABLE `mt_order_entry` ADD `notes` text;
ALTER TABLE `mt_order_entry` ADD `gross_weight` text;
ALTER TABLE `mt_order_entry` ADD `airlines` text;
ALTER TABLE `mt_order_entry` ADD `dimensions` text;
ALTER TABLE `mt_order_entry` ADD `chargeable_weight` text;
ALTER TABLE `mt_order_entry` ADD `no_of_pieces` text;
ALTER TABLE `mt_order_entry` ADD `hbl_no` text;
ALTER TABLE `mt_order_entry` ADD `order_hbl_no` text;
ALTER TABLE `mt_order_entry` ADD `secondary_salesman` text;
ALTER TABLE `mt_order_entry` ADD `do_attempted` text;
ALTER TABLE `mt_order_entry` ADD `eta_report` text;
ALTER TABLE `mt_order_entry` ADD `etd_report` text;
ALTER TABLE `mt_order_entry` ADD `export_bl_no` text;
ALTER TABLE `mt_order_entry` ADD `ts_converted` int NOT NULL DEFAULT '0';
ALTER TABLE `mt_order_entry` ADD `ts2_converted` int NOT NULL DEFAULT '0';
ALTER TABLE `mt_order_entry` ADD `ts3_converted` int NOT NULL DEFAULT '0';
ALTER TABLE `mt_order_entry` ADD `type_of_booking` text;
ALTER TABLE `mt_order_entry` ADD `pot_agent` text;
ALTER TABLE `mt_order_entry` ADD `pot2` text;
ALTER TABLE `mt_order_entry` ADD `pot2_agent` text;
ALTER TABLE `mt_order_entry` ADD `pot3` text;
ALTER TABLE `mt_order_entry` ADD `pot3_agent` text;
ALTER TABLE `mt_order_entry` ADD `cs_person` text;
ALTER TABLE `mt_order_entry` ADD `salesman` text;
ALTER TABLE `mt_order_entry` ADD `loading_terminal` text;
ALTER TABLE `mt_order_entry` ADD `si_cutoff` date DEFAULT NULL;
ALTER TABLE `mt_order_entry` ADD `vgm_cutoff` date DEFAULT NULL;
ALTER TABLE `mt_order_entry` ADD `receival_date` date DEFAULT NUL;

ALTER TABLE `mt_order_route` ADD `location_id` text;
ALTER TABLE `mt_order_route` ADD `company_id` text;
ALTER TABLE `mt_order_route` ADD `ts1` text;
ALTER TABLE `mt_order_route` ADD `ts2` text;
ALTER TABLE `mt_order_route` ADD `ts3` text;
ALTER TABLE `mt_order_route` ADD `provider_name` text;
ALTER TABLE `mt_order_route` ADD `terminal` text;

ALTER TABLE `mt_order_container_detail` ADD `company_id` text;
ALTER TABLE `mt_order_container_detail` ADD `location_id` text;
ALTER TABLE `mt_order_container_detail` ADD `tare_wgt` text;
ALTER TABLE `mt_order_container_detail` ADD `vgm_wgt` text;
ALTER TABLE `mt_order_container_detail` ADD `gross_weight` text;
ALTER TABLE `mt_order_container_detail` ADD `cro_no` text;

ALTER TABLE `mt_order_cargo` ADD `slot_feeder` TEXT NULL AFTER `main_commodity`;
ALTER TABLE `mt_order_cargo` ADD `company_id` text;
ALTER TABLE `mt_order_cargo` ADD `location_id` text;
ALTER TABLE `mt_order_cargo` ADD `mrg_no` text;
ALTER TABLE `mt_order_cargo` ADD `mrg_id` text;
ALTER TABLE `mt_order_cargo` ADD `un_no` text;
ALTER TABLE `mt_order_cargo` ADD `class` text;
ALTER TABLE `mt_order_cargo` ADD `packing_group` text;
ALTER TABLE `mt_order_cargo` ADD `min_temp` text;
ALTER TABLE `mt_order_cargo` ADD `max_temp` text;
ALTER TABLE `mt_order_cargo` ADD `oog` text;
ALTER TABLE `mt_order_cargo` ADD `oh` text;
ALTER TABLE `mt_order_cargo` ADD `ow` text;
ALTER TABLE `mt_order_cargo` ADD `ol` text;
ALTER TABLE `mt_order_cargo` ADD `ventilation` text;
ALTER TABLE `mt_order_cargo` ADD `humidity` text;

ALTER TABLE `mt_order_cost` ADD `accrual` TEXT NULL AFTER `cost_base_amount`;
ALTER TABLE `mt_order_cost` ADD `wip` TEXT NULL AFTER `selling_base_amount`, ADD `reversed_wip` TEXT NULL AFTER `wip`, ADD `is_amount_changed` TEXT NULL AFTER `reversed_wip`, ADD `order_income_parent_id` TEXT NULL AFTER `is_amount_changed`, ADD `charge_desc1` TEXT NULL AFTER `order_income_parent_id`, ADD `reversed_acr` TEXT NULL AFTER `charge_desc1`;
ALTER TABLE `mt_order_cost` ADD `created_date_actual` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `created_date`;
ALTER TABLE `mt_order_cost` ADD `inv_pay_date` TEXT NULL AFTER `inv_pay_no`, ADD `is_rev` TEXT NULL AFTER `inv_pay_date`, ADD `is_rev_cost` TEXT NULL AFTER `is_rev`, ADD `inv_pay_rev_date` TEXT NULL AFTER `is_rev_cost`, ADD `inv_pay_rev_no` TEXT NULL AFTER `inv_pay_rev_date`;
ALTER TABLE `mt_order_cost` ADD `inv_rev` TEXT NULL AFTER `company_id`;
ALTER TABLE `mt_order_cost` ADD `billing_party_name` TEXT NULL AFTER `billing_party`;
ALTER TABLE `mt_order_cost` ADD `mrg_no` text;
ALTER TABLE `mt_order_cost` ADD `mrg_id` text;
ALTER TABLE `mt_order_cost` ADD `aloc_id` text;
ALTER TABLE `mt_order_cost` ADD `buy_order_cost_id` text;
ALTER TABLE `mt_order_cost` ADD `buy_qty` text;
ALTER TABLE `mt_order_cost` ADD `buy_currency` text;
ALTER TABLE `mt_order_cost` ADD `buy_ex_rate` text;
ALTER TABLE `mt_order_cost` ADD `buy_rate_cost` text;
ALTER TABLE `mt_order_cost` ADD `buy_cost_amount` text;
ALTER TABLE `mt_order_cost` ADD `buy_cost_base_amount` text;
ALTER TABLE `mt_order_cost` ADD `buy_billing_party` text;
ALTER TABLE `mt_order_cost` ADD `buy_billing_party_name` text;

ALTER TABLE `mt_master` ADD `value2` TEXT NULL AFTER `value`;
ALTER TABLE `mt_master` ADD `created_by` text AFTER `location_id`;
ALTER TABLE `mt_master` ADD `ip` text AFTER `created_by`;
ALTER TABLE `mt_master` ADD `ua` text AFTER `ip`;
ALTER TABLE `mt_master` ADD `ekey` text AFTER `ua`;
ALTER TABLE `mt_master` ADD `temp_code` text AFTER `ekey`;

ALTER TABLE `mt_voyage` ADD `igm_no` text;
ALTER TABLE `mt_voyage` ADD `igm_date` text;
ALTER TABLE `mt_voyage` ADD `cy_open_date` text;
ALTER TABLE `mt_voyage` ADD `doc_cut_off_date` text;
ALTER TABLE `mt_voyage` ADD `vgm_cut_off_date` text;
ALTER TABLE `mt_voyage` ADD `custom_code` text;
ALTER TABLE `mt_voyage` ADD `terminal_code` text;
ALTER TABLE `mt_voyage` ADD `arrival_port` text;
ALTER TABLE `mt_voyage` ADD `arrival_date` text;
ALTER TABLE `mt_voyage` ADD `via_no` text;
ALTER TABLE `mt_voyage` ADD `voyage_type1` text;
ALTER TABLE `mt_voyage` ADD `rotation_date` text;

ALTER TABLE `mt_bp_address` ADD `gst_number` text;
ALTER TABLE `mt_bp_address` ADD `pan_number` text;
ALTER TABLE `mt_bp_address` ADD `tan_number` text;
ALTER TABLE `mt_bp_address` ADD `sez_type` text;
ALTER TABLE `mt_bp_address` ADD `sez_tax` text;
ALTER TABLE `mt_bp_address` ADD `over_sea_customer` text;
ALTER TABLE `mt_bp_address` ADD `unregistered` text;
ALTER TABLE `mt_bp_address` ADD `over_sea_tax` text;
ALTER TABLE `mt_bp_address` ADD `is_inr_tax_breakup` text;
ALTER TABLE `mt_bp_address` ADD `unregistered_tax` text;

ALTER TABLE `mt_charge_group_detail` ADD `tax_rate` text;
ALTER TABLE `mt_charge_group_detail` ADD `company_id` text;
ALTER TABLE `mt_charge_group_detail` ADD `created_by` text;
ALTER TABLE `mt_charge_group_detail` ADD `modified_by` text;
ALTER TABLE `mt_charge_group_detail` ADD `modified_date` text;

ALTER TABLE `mt_manifest_entry` ADD `hbl_no` TEXT NULL AFTER `bl_no`;
ALTER TABLE `mt_manifest_entry` ADD `customer_name` TEXT NULL AFTER `customer`, ADD `customer_addr` TEXT NULL AFTER `customer_name`, ADD `customer_id` TEXT NULL AFTER `customer_addr`;
ALTER TABLE `mt_manifest_entry` ADD `cfs` text;
ALTER TABLE `mt_manifest_entry` ADD `line_no` text;
ALTER TABLE `mt_manifest_entry` ADD `igm_no` text;
ALTER TABLE `mt_manifest_entry` ADD `sez_icd` text;
ALTER TABLE `mt_manifest_entry` ADD `icd` text;
ALTER TABLE `mt_manifest_entry` ADD `soc_containers` text;
ALTER TABLE `mt_manifest_entry` ADD `delivery_type` text;
ALTER TABLE `mt_manifest_entry` ADD `cargo_movement` text;
ALTER TABLE `mt_manifest_entry` ADD `cargo_item_type` text;
ALTER TABLE `mt_manifest_entry` ADD `mode_of_transport` text;
ALTER TABLE `mt_manifest_entry` ADD `do_status` varchar(10) NOT NULL DEFAULT 'UNFREEZE';
ALTER TABLE `mt_manifest_entry` ADD `pol_terminal` text;
ALTER TABLE `mt_manifest_entry` ADD `cs_person` text;
ALTER TABLE `mt_manifest_entry` ADD `mbl_date` text;

ALTER TABLE `mt_manifest_entry` ADD `import_converted` int NOT NULL DEFAULT '0';
ALTER TABLE `mt_manifest_entry` ADD `bl_type` text;
ALTER TABLE `mt_manifest_entry` ADD `bl_status` text;
ALTER TABLE `mt_manifest_entry` ADD `mbl_shipment_terms` text;
ALTER TABLE `mt_manifest_entry` ADD `eta` text;
ALTER TABLE `mt_manifest_entry` ADD `etd` text;
ALTER TABLE `mt_manifest_entry` ADD `eline` text;
ALTER TABLE `mt_manifest_entry` ADD `eline_name` text;
ALTER TABLE `mt_manifest_entry` ADD `sub_line_no` text;
ALTER TABLE `mt_manifest_entry` ADD `poo` text;
ALTER TABLE `mt_manifest_entry` ADD `pol` text;
ALTER TABLE `mt_manifest_entry` ADD `pod` text;
ALTER TABLE `mt_manifest_entry` ADD `pof` text;
ALTER TABLE `mt_manifest_entry` ADD `detention_free_days` text;
ALTER TABLE `mt_manifest_entry` ADD `demurage_free_days` text;
ALTER TABLE `mt_manifest_entry` ADD `pod_detention_free_days` text;
ALTER TABLE `mt_manifest_entry` ADD `pod_demurage_free_days` text;
ALTER TABLE `mt_manifest_entry` ADD `additional_booking_no` varchar(200) DEFAULT NULL;
ALTER TABLE `mt_manifest_entry` ADD `freight_payable_at` text;
ALTER TABLE `mt_manifest_entry` ADD `freight_terms` text;
ALTER TABLE `mt_manifest_entry` ADD `agent_bl_no` text;
ALTER TABLE `mt_manifest_entry` ADD `cha` text;
ALTER TABLE `mt_manifest_entry` ADD `cha_name` text;
ALTER TABLE `mt_manifest_entry` ADD `cha_id` text;
ALTER TABLE `mt_manifest_entry` ADD `bl_issue_agent_code` text;
ALTER TABLE `mt_manifest_entry` ADD `delivery_agent_code` text;

CREATE TABLE `cs_person_list` (
  `id` int NOT NULL,
  `name` text,
  `email` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `cs_person_list` (`id`, `name`, `email`) VALUES
(1, 'NA', NULL);
ALTER TABLE `cs_person_list`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `cs_person_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

  CREATE TABLE `voyage_pod_list` (
  `id` int NOT NULL,
  `voyage_id` text,
  `pod` text,
  `terminal_code` text,
  `eta` text,
  `igm_no` text,
  `igm_date` text,
  `line_voyage` text,
  `ip` text,
  `ua` text,
  `ekey` text,
  `created_by` text,
  `created_date` timestamp NULL DEFAULT NULL,
  `modified_by` text,
  `modified_date` timestamp NULL DEFAULT NULL,
  `temp_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `voyage_pod_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `voyage_pod_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `mt_business_partner` ADD `cargo_movement` text;
ALTER TABLE `mt_business_partner` ADD `mode_of_transport` text;
ALTER TABLE `mt_business_partner` ADD `sez_customer` text;
ALTER TABLE `mt_business_partner` ADD `over_sea_customer` text;
ALTER TABLE `mt_business_partner` ADD `cfs_bond_no` text;
ALTER TABLE `mt_business_partner` ADD `cfs_5digit_code` text;
ALTER TABLE `mt_business_partner` ADD `cfs_10digit_code` text;
ALTER TABLE `mt_business_partner` ADD `tan_no` text;
ALTER TABLE `mt_business_partner` ADD `tds` text;
ALTER TABLE `mt_business_partner` ADD `msme` text;
ALTER TABLE `mt_business_partner` ADD `unregistered` text;
ALTER TABLE `mt_business_partner` ADD `approved` text;
ALTER TABLE `mt_business_partner` ADD `edi_port_code` text;
ALTER TABLE `mt_business_partner` ADD `carrier_no` text;
ALTER TABLE `mt_business_partner` ADD `gatein_ports` text;
ALTER TABLE `mt_business_partner` ADD `approve_remarks` text;
ALTER TABLE `mt_business_partner` ADD `approved_date` text;
ALTER TABLE `mt_business_partner` ADD `approved_by` text;
ALTER TABLE `mt_business_partner` ADD `short_code` text;
ALTER TABLE `mt_business_partner` ADD `tag1` text;
ALTER TABLE `mt_business_partner` ADD `tds_sec` text;
ALTER TABLE `mt_business_partner` ADD `over_sea_tax` text;
ALTER TABLE `mt_business_partner` ADD `cfs_location` text;
ALTER TABLE `mt_business_partner` ADD `dpd_cfs` text;
ALTER TABLE `mt_business_partner` ADD `import_credit_limit` text;
ALTER TABLE `mt_business_partner` ADD `export_credit_limit` text;
ALTER TABLE `mt_business_partner` ADD `credit_application_status` text;
ALTER TABLE `mt_business_partner` ADD `customer_type` text;

ALTER TABLE `mt_manifest_entry_container` ADD `stowage_no` TEXT NULL AFTER `un_no`, ADD `imco_class` TEXT NULL AFTER `stowage_no`;
ALTER TABLE `mt_manifest_entry_container` ADD `weight_mts` text;
ALTER TABLE `mt_manifest_entry_container` ADD `iso_code` text;
ALTER TABLE `mt_manifest_entry_container` ADD `shipment_type` text;
ALTER TABLE `mt_manifest_entry_container` ADD `vgm_wgt` text;
ALTER TABLE `mt_manifest_entry_container` ADD `tare_wgt` text;
ALTER TABLE `mt_manifest_entry_container` ADD `shipper_seal_no` text;

ALTER TABLE `mt_manifest_entry_route` ADD `eline_name` TEXT NULL AFTER `eline`;
ALTER TABLE `mt_manifest_entry_route` ADD `pol_terminal` TEXT NULL AFTER `modified_date`;

ALTER TABLE `mt_manifest_entry_party` ADD `party` TEXT NULL AFTER `party_name`;
ALTER TABLE `mt_manifest_entry_party` ADD `gstin` TEXT NULL AFTER `temp_code`, ADD `address_id` TEXT NULL AFTER `gstin`;

ALTER TABLE `mt_manifest_entry_cargo` ADD `unit_type` TEXT NULL AFTER `main_commodity`, ADD `booked_qty` TEXT NULL AFTER `unit_type`;
ALTER TABLE `mt_manifest_entry_cargo` ADD `company_id` text;
ALTER TABLE `mt_manifest_entry_cargo` ADD `location_id` text;
ALTER TABLE `mt_manifest_entry_cargo` ADD `marks` text;
ALTER TABLE `mt_manifest_entry_cargo` ADD `description` text;
ALTER TABLE `mt_manifest_entry_cargo` ADD `shipping_bl_no` text;
ALTER TABLE `mt_manifest_entry_cargo` ADD `shipping_bl_date` date DEFAULT NULL;
ALTER TABLE `mt_manifest_entry_cargo` ADD `sb_received` text;


CREATE TABLE `mt_manifest_entry_hbl` (
  `id` int NOT NULL,
  `mnf_entry_pk` text,
  `equipment_serial` text,
  `hbl_no` text,
  `ip` text,
  `ua` text,
  `ekey` text,
  `temp_code` text,
  `created_by` text,
  `created_date` text,
  `line_no` text,
  `sub_line_no` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `mt_manifest_entry_hbl`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `mt_manifest_entry_hbl`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `mt_container_master` ADD `pl_no` TEXT NULL AFTER `purchaseprice`;
ALTER TABLE `mt_container_master` ADD `manufacturer` TEXT NULL AFTER `supplier`;
ALTER TABLE `mt_container_master` ADD `bl_no` text;
ALTER TABLE `mt_container_master` ADD `seal_no` text;
ALTER TABLE `mt_container_master` ADD `stowage_no` text;
ALTER TABLE `mt_container_master` ADD `imco_class` text;
ALTER TABLE `mt_container_master` ADD `un_no` text;
ALTER TABLE `mt_container_master` ADD `curr_agent` text;
ALTER TABLE `mt_container_master` ADD `hire_date` text;
ALTER TABLE `mt_container_master` ADD `payload_capacity` text;
ALTER TABLE `mt_container_master` ADD `payload_capacity_kgs` text;
ALTER TABLE `mt_container_master` ADD `pick_yard_location` text;
ALTER TABLE `mt_container_master` ADD `agent` text;
ALTER TABLE `mt_container_master` ADD `curr_event_date` timestamp NULL DEFAULT NULL;  

ALTER TABLE `mt_event_updation` ADD `agent_name` TEXT NULL AFTER `container_condition`, ADD `agent_id` TEXT NULL AFTER `agent_name`;

ALTER TABLE `user_master` ADD `is_agent` TEXT NULL AFTER `deleted`, ADD `agent_bp_code` TEXT NULL AFTER `is_agent`;

CREATE TABLE `srr_cargo` (
  `id` int NOT NULL,
  `unit_type` text,
  `booked_qty` text,
  `balance_qty` text,
  `srr_id` text,
  `main_commodity` text,
  `slot_feeder` text,
  `equipment_serial` text,
  `package_type` text,
  `no_of_packages` text,
  `gross_weight` text,
  `weight_uom` text,
  `volume` text,
  `volume_uom` text,
  `dangerous` text,
  `reefer` text,
  `oversize` text,
  `ip` text,
  `ua` text,
  `created_by` text,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ekey` text,
  `temp_code` text,
  `company_id` text,
  `location_id` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `srr_cargo`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `srr_cargo`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

CREATE TABLE `srr_rates_list` (
  `id` int NOT NULL,
  `srr_id` text,
  `charge_code` text,
  `charge_name` text,
  `basis_type` text,
  `requested_rate` text,
  `counter_rate` text,
  `approved_rate` text,
  `collect_port` text,
  `remarks` text,
  `ip` text,
  `ua` text,
  `ekey` text,
  `company_id` text,
  `location_id` text,
  `created_by` text,
  `created_date` timestamp NULL DEFAULT NULL,
  `modified_by` text,
  `modified_date` timestamp NULL DEFAULT NULL,
  `temp_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `srr_rates_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `srr_rates_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

CREATE TABLE `mrg_list` (
  `id` int NOT NULL,
  `mrg_no` text,
  `size_type` text,
  `poo` text,
  `pol` text,
  `pod` text,
  `final_pod` text,
  `final_destination` text,
  `from_date` date DEFAULT NULL,
  `to_date` date DEFAULT NULL,
  `rate` text,
  `pol_reefer_plugin_free_days` text,
  `pod_reefer_plugin_free_days` text,
  `pol_demurrage_free_days` text,
  `pod_demurrage_free_days` text,
  `pol_detention_free_days` text,
  `pod_detention_free_days` text,
  `feeder` text,
  `collect_port` text,
  `uid` text,
  `temp_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `mrg_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `mrg_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

CREATE TABLE `load_port_tariff` (
  `id` int NOT NULL,
  `charge_no` text,
  `port` text,
  `terminal` varchar(20) DEFAULT 'ALL',
  `charge` text,
  `container_type` text,
  `dangerous` text,
  `reefer` text,
  `oversize` text,
  `basis_type` text,
  `currency` text,
  `rate` text,
  `cost` text,
  `principal_rev` text,
  `agent_rev` text,
  `pay_at` text,
  `ip` text,
  `ua` text,
  `ekey` text,
  `temp_code` text,
  `location_id` text,
  `company_id` text,
  `modified_date` date DEFAULT NULL,
  `modified_by` text,
  `created_by` text,
  `created_date` date DEFAULT NULL,
  `mandatory` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

ALTER TABLE `load_port_tariff`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `load_port_tariff`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `mt_delivery_order` ADD `status` text;
ALTER TABLE `mt_delivery_order` ADD `empty_return_id` text;
ALTER TABLE `mt_delivery_order` ADD `empty_return` text;
ALTER TABLE `mt_delivery_order` ADD `empty_return_name` text;
ALTER TABLE `mt_delivery_order` ADD `empty_return_address` text;
ALTER TABLE `mt_delivery_order` ADD `cha` text;
ALTER TABLE `mt_delivery_order` ADD `cha_name` text;
ALTER TABLE `mt_delivery_order` ADD `do_status` text;
ALTER TABLE `mt_delivery_order` ADD `approved_by` text;
ALTER TABLE `mt_delivery_order` ADD `approved_date` text;
ALTER TABLE `mt_delivery_order` ADD `eq_sno` text;
ALTER TABLE `mt_delivery_order` ADD `dock_delivery` text;
ALTER TABLE `mt_delivery_order` ADD `bl_type` text;  

ALTER TABLE `mt_erc` ADD `order_id` TEXT NULL AFTER `service_order`;
ALTER TABLE `mt_erc` ADD `depot_name` TEXT NULL AFTER `release_from`, ADD `depot_address` TEXT NULL AFTER `depot_name`, ADD `depot_id` TEXT NULL AFTER `depot_address`;
ALTER TABLE `mt_erc` ADD `cro_type` text;
ALTER TABLE `mt_erc` ADD `balance_qty_txt` text;
ALTER TABLE `mt_erc` ADD `surveyor_code` text;
ALTER TABLE `mt_erc` ADD `terminal` text;

CREATE TABLE `mt_erc_equip_detail_open` (
  `id` int NOT NULL,
  `erc_id` text,
  `equipment_type` text,
  `qty` text,
  `balance_qty` text,
  `status` text,
  `remarks` text,
  `location_id` text,
  `company_id` text,
  `created_by` text,
  `created_date` timestamp NULL DEFAULT NULL,
  `ip` text,
  `ua` text,
  `ekey` text,
  `temp_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `mt_erc_equip_detail_open`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `mt_erc_equip_detail_open`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `import_bl_containers` ADD `seal_no` text;
ALTER TABLE `import_bl_containers` ADD `stowage_no` text;
ALTER TABLE `import_bl_containers` ADD `imco_class` text;
ALTER TABLE `import_bl_containers` ADD `imdg_un_code` text;
ALTER TABLE `import_bl_containers` ADD `ip` text;
ALTER TABLE `import_bl_containers` ADD `ua` text;
ALTER TABLE `import_bl_containers` ADD `ekey` text;
ALTER TABLE `import_bl_containers` ADD `created_by` text;
ALTER TABLE `import_bl_containers` ADD `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE `import_bl_containers` ADD `gw` text;
ALTER TABLE `import_bl_containers` ADD `tw` text;
ALTER TABLE `import_bl_containers` ADD `no_of_pkgs` text;
ALTER TABLE `import_bl_containers` ADD `pkg_type` text;
ALTER TABLE `import_bl_containers` ADD `temp` text;
ALTER TABLE `import_bl_containers` ADD `voyage` text;
ALTER TABLE `import_bl_containers` ADD `vessel` text;
ALTER TABLE `import_bl_containers` ADD `equipment_serial` text;
ALTER TABLE `import_bl_containers` ADD `hbl_no` text;
ALTER TABLE `import_bl_containers` ADD `exl_upd_pk` text;
ALTER TABLE `import_bl_containers` ADD `company_id` text;
ALTER TABLE `import_bl_containers` ADD `cg_id` text;
ALTER TABLE `import_bl_containers` ADD `uid` text;
ALTER TABLE `import_bl_containers` ADD `weight_mts` text;
ALTER TABLE `import_bl_containers` ADD `iso_code` text;

ALTER TABLE `mt_ship_ar_header` ADD `igst_5` text;
ALTER TABLE `mt_ship_ar_header` ADD `cgst_25` text;
ALTER TABLE `mt_ship_ar_header` ADD `sgst_25` text;
ALTER TABLE `mt_ship_ar_header` ADD `igst_18` text;
ALTER TABLE `mt_ship_ar_header` ADD `cgst_9` text;
ALTER TABLE `mt_ship_ar_header` ADD `sgst_9` text;
ALTER TABLE `mt_ship_ar_header` ADD `irn_resp1` text;
ALTER TABLE `mt_ship_ar_header` ADD `irn_resp1_time` timestamp NULL DEFAULT NULL;
ALTER TABLE `mt_ship_ar_header` ADD `irn_no` text;
ALTER TABLE `mt_ship_ar_header` ADD `ack_dt` text;
ALTER TABLE `mt_ship_ar_header` ADD `ack_no` text;
ALTER TABLE `mt_ship_ar_header` ADD `qr_str` text;
ALTER TABLE `mt_ship_ar_header` ADD `singed_invoice` text;
ALTER TABLE `mt_ship_ar_header` ADD `output_response` json DEFAULT NULL;
ALTER TABLE `mt_ship_ar_header` ADD `irn_by` text;
ALTER TABLE `mt_ship_ar_header` ADD `irn_date` timestamp NULL DEFAULT NULL;
ALTER TABLE `mt_ship_ar_header` ADD `error_details` text;
ALTER TABLE `mt_ship_ar_header` ADD `gst_number` text;
ALTER TABLE `mt_ship_ar_header` ADD `gst_row_id` text;
ALTER TABLE `mt_ship_ar_header` ADD `rcm` text;
ALTER TABLE `mt_ship_ar_header` ADD `is_freight` text;
ALTER TABLE `mt_ship_ar_header` ADD `is_freight_usd` text;
ALTER TABLE `mt_ship_ar_header` ADD `inv_rev` varchar(3) DEFAULT 'NO';
ALTER TABLE `mt_ship_ar_header` ADD `inv_rev_by` text;
ALTER TABLE `mt_ship_ar_header` ADD `inv_rev_date` timestamp NULL DEFAULT NULL;
ALTER TABLE `mt_ship_ar_header` ADD `round_off_amt` text;
ALTER TABLE `mt_ship_ar_header` ADD `is_rcm` text;
ALTER TABLE `mt_ship_ar_header` ADD `local_bank_code` text;
ALTER TABLE `mt_ship_ar_header` ADD `foreign_bank_code` text;


CREATE TABLE `invoice_print` (
  `id` int NOT NULL,
  `invoice_id` text,
  `charge_desc` text,
  `basis_type` text,
  `currency` text,
  `qty` text,
  `rate` text,
  `ex_rate` text,
  `amount` text,
  `tax` text,
  `status` text,
  `ip` text,
  `ua` text,
  `created_by` text,
  `created_date` timestamp NULL DEFAULT NULL,
  `ekey` text,
  `temp_code` text,
  `company_id` text,
  `location_id` text
) ENGINE=InnoDB;

ALTER TABLE `invoice_print`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `invoice_print`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

CREATE TABLE `mt_ap_header` (
  `id` int NOT NULL,
  `aph_company` text,
  `aph_internal_number` int DEFAULT NULL,
  `aph_code` text,
  `aph_name` text,
  `aph_group` text,
  `aph_document_base` text,
  `aph_document_type` text,
  `aph_document_number` varchar(30) DEFAULT NULL,
  `aph_limit_base` text,
  `aph_document_date` date DEFAULT NULL,
  `aph_gl_date` date DEFAULT NULL,
  `aph_age_date` date DEFAULT NULL,
  `aph_due_date` date DEFAULT NULL,
  `aph_other_reference` text,
  `aph_currency` text,
  `aph_exchange_rate` text,
  `aph_foreign_amount` text,
  `aph_local_amount` text,
  `aph_narration` text,
  `aph_post_date` date DEFAULT NULL,
  `aph_created_date` date DEFAULT NULL,
  `aph_created_by` text,
  `aph_status` text,
  `aph_notes` text,
  `aph_account` text,
  `aph_total_discount` text,
  `aph_total_tax` text,
  `aph_loc_reference` text,
  `aph_dtos` text,
  `aph_rcm` text,
  `aph_location` text,
  `location_id` text,
  `company_id` text,
  `created_by` text,
  `created_date` timestamp NULL DEFAULT NULL,
  `ip` text,
  `ua` text,
  `ekey` text,
  `uid` text,
  `temp_code` text,
  `modified_date` timestamp NULL DEFAULT NULL,
  `modified_by` text,
  `child` json DEFAULT NULL,
  `lpo_order` text,
  `ref_inv_no` text,
  `ref_inv_date` text,
  `collection_by` text,
  `exl_upd_pk` text,
  `igst` text,
  `gst_percent` text,
  `cgst` text,
  `sgst` text,
  `order_no` text,
  `temp_code2` text,
  `bl_no` text,
  `voyage` text,
  `vessel` text,
  `tds_percentage` text,
  `tds_appl_amt` text,
  `igst_5` text,
  `cgst_25` text,
  `sgst_25` text,
  `igst_12` text,
  `cgst_6` text,
  `sgst_6` text,
  `igst_18` text,
  `cgst_9` text,
  `sgst_9` text,
  `igst_28` text,
  `cgst_14` text,
  `sgst_14` text,
  `place_of_supply` text,
  `place_of_supply_name` text,
  `fin_year` text,
  `supplier_bill_no` text,
  `supplier_bill_date` text,
  `tds_section` text,
  `voucher_type` text,
  `gst_number` text,
  `gst_row_id` text,
  `is_rcm` varchar(3) DEFAULT NULL,
  `job_list` json DEFAULT NULL,
  `job_expense` text,
  `mbl_no` text,
  `round_off_amt` text,
  `approved` text,
  `approved_by` text,
  `approved_date` timestamp NULL DEFAULT NULL,
  `from_doc` text,
  `send_for_payment` text,
  `utr_ref` text,
  `amount_paid` text,
  `tds_deducted_amount` text,
  `other_remarks` text,
  `payment_entered_by` text,
  `payment_entered_date` timestamp NULL DEFAULT NULL,
  `draft_no` text,
  `prod_type` text,
  `location` text,
  `department` text,
  `is_overseas` text,
  `file_id` text,
  `is_rev` varchar(3) DEFAULT NULL,
  `reversed_by` text,
  `reversed_date` timestamp NULL DEFAULT NULL,
  `rev_doc_no` text,
  `rev_doc_id` text,
  `original_voucher` text,
  `original_id` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `mt_ap_header`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `aph_document_number` (`aph_document_number`);
ALTER TABLE `mt_ap_header`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;  

CREATE TABLE `cro_autogen` (
  `id` int NOT NULL,
  `temp_code` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `order_no` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `container_no` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `created_by` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `created_date` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `inv_type` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `is_over_seas` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `company_id` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `location_id` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `fin_year` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `indian_year` text CHARACTER SET latin1 COLLATE latin1_swedish_ci
) ENGINE=InnoDB;

ALTER TABLE `cro_autogen`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `cro_autogen`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;
  
ALTER TABLE `location_master` ADD address4 TEXT NULL AFTER `address3`;
ALTER TABLE `location_master` ADD address5 TEXT NULL AFTER `address4`;
ALTER TABLE `location_master` ADD `country_2digits` text;
ALTER TABLE `location_master` ADD `country_3chars` text;
ALTER TABLE `location_master` ADD `no_of_license` text;
ALTER TABLE `location_master` ADD `created_by` text;
ALTER TABLE `location_master` ADD `created_date` text;
ALTER TABLE `location_master` ADD `ip` text;
ALTER TABLE `location_master` ADD `ua` text;
ALTER TABLE `location_master` ADD `ekey` text;
ALTER TABLE `location_master` ADD `temp_code` text;
ALTER TABLE `location_master` ADD `loc_number` varchar(10) DEFAULT NULL;
ALTER TABLE `location_master` ADD `pan` text;
ALTER TABLE `location_master` ADD `gstin` text;
ALTER TABLE `location_master` ADD `cin` text;
ALTER TABLE `location_master` ADD `tax_no` text;
ALTER TABLE `location_master` ADD `terms_conditions` text;
ALTER TABLE `location_master` ADD `default_local_bank_code` text;
ALTER TABLE `location_master` ADD `default_foreign_bank_code` text;

CREATE TABLE `mrg_no_autogen` (
  `id` int(11) NOT NULL,
  `company_name` text,
  `location_name` text,
  `doc_date` text,
  `doc_type` text,
  `order_id` int(11) DEFAULT NULL,
  `order_no` text,
  `created_by` text,
  `created_date` text,
  `temp_code` text
) ENGINE=InnoDB;

ALTER TABLE `mrg_no_autogen`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `mrg_no_autogen`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `bl_principal_list` ADD `file_url` TEXT NULL AFTER `full_name`;
ALTER TABLE `bl_principal_list` ADD `logo_file_url` TEXT NULL AFTER `logo_filename`;
ALTER TABLE `bl_principal_list` ADD `ip` text;
ALTER TABLE `bl_principal_list` ADD `ua` text;
ALTER TABLE `bl_principal_list` ADD `ekey` text;
ALTER TABLE `bl_principal_list` ADD `temp_code` text;
ALTER TABLE `bl_principal_list` ADD `bp_name` text;
ALTER TABLE `bl_principal_list` ADD `bp_code` text;


CREATE TABLE `gst_code_list` (
  `id` int NOT NULL,
  `state_name` text,
  `gst_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `gst_code_list` (`id`, `state_name`, `gst_code`) VALUES
(1, 'Jammu & Kashmir', '01'),
(2, 'Himachal Pradesh', '02'),
(3, 'Punjab', '03'),
(4, 'Chandigarh', '04'),
(5, 'Uttarakhand', '05'),
(6, 'Haryana', '06'),
(7, 'Delhi', '07'),
(8, 'Rajasthan', '08'),
(9, 'Uttar Pradesh', '09'),
(10, 'Bihar', '10'),
(11, 'Sikkim', '11'),
(12, 'Arunanchal Pradesh', '12'),
(13, 'Nagaland', '13'),
(14, 'Manipur', '14'),
(15, 'Mizoram', '15'),
(16, 'Tripura', '16'),
(17, 'Meghalaya', '17'),
(18, 'Assam', '18'),
(19, 'West Bengal', '19'),
(20, 'Jharkhand', '20'),
(21, 'Odisha', '21'),
(22, 'Chattisgarh', '22'),
(23, 'Madhya Pradesh', '23'),
(24, 'Gujarat', '24'),
(25, 'Dadra And Nagar Haveli And Daman And Diu', '26'),
(26, 'Maharashtra', '27'),
(27, 'Andhra Pradesh', '28'),
(28, 'Karnataka', '29'),
(29, 'Goa', '30'),
(30, 'Lakshadweep', '31'),
(31, 'Kerela', '32'),
(32, 'Tamil Nadu', '33'),
(33, 'Puducherry', '34'),
(34, 'Andaman and Nicobar Islands', '35'),
(35, 'Telangana', '36'),
(36, 'Andhra Pradesh', '37'),
(37, 'Ladakh', '38'),
(38, 'UAE', '96');

ALTER TABLE `gst_code_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `gst_code_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

CREATE TABLE `bl_gst_lut` (
  `id` int NOT NULL,
  `lut_no` text,
  `status` varchar(45) DEFAULT NULL,
  `prepared_by` text,
  `lut_date` date DEFAULT NULL,
  `valid_from` date DEFAULT NULL,
  `valid_to` date DEFAULT NULL,
  `location_id` text,
  `company_id` text,
  `created_by` text,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ip` text,
  `ua` text,
  `ekey` text,
  `modified_by` text,
  `modified_date` timestamp NULL DEFAULT NULL,
  `cancelled_by` text,
  `cancelled_date` timestamp NULL DEFAULT NULL,
  `approved_date` timestamp NULL DEFAULT NULL,
  `approved_by` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `bl_gst_lut` (`id`, `lut_no`, `status`, `prepared_by`, `lut_date`, `valid_from`, `valid_to`, `location_id`, `company_id`, `created_by`, `created_date`, `ip`, `ua`, `ekey`, `modified_by`, `modified_date`, `cancelled_by`, `cancelled_date`, `approved_date`, `approved_by`) VALUES
(1, 'AD330823000335K', 'ACTIVE', 'REAGAN', NULL, '2023-08-01', '2024-03-31', 'MUMBAI', 'SPARXX', 'ADMIN', '2023-08-07 11:03:15', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

ALTER TABLE `bl_gst_lut`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `bl_gst_lut`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;  

CREATE TABLE `custom_number_format_master_types` (
  `id` int NOT NULL,
  `type` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `custom_number_format_master_types` (`id`, `type`) VALUES
(1, 'BUSINESS PARTNER'),
(2, 'ENQUIRY'),
(3, 'QUOTE'),
(4, 'EXPORT BOOKING'),
(5, 'EXPORT MANIFEST'),
(6, 'DELIVERY ORDER'),
(7, 'IMPORT BOOKING'),
(8, 'INVOICE'),
(9, 'SRR'),
(10, 'IMPORT MANIFEST'),
(11, 'SCHEDULE REPORT'),
(12, 'MRG');

ALTER TABLE `custom_number_format_master_types`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `custom_number_format_master_types`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  
CREATE TABLE `custom_number_format_list_master` (
  `id` int NOT NULL,
  `company_name` text,
  `location_name` text,
  `type` text,
  `no_format` text,
  `start_with` text,
  `starting_type` text,
  `separation1` text,
  `separation2` text,
  `separation3` text,
  `created_date` text,
  `created_by` text,
  `ip` text,
  `ua` text,
  `ekey` text,
  `temp_code` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `custom_number_format_list_master`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `custom_number_format_list_master`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

INSERT INTO `custom_number_format_list_master` (`id`, `company_name`, `location_name`, `type`, `no_format`, `start_with`, `starting_type`, `separation1`, `separation2`, `separation3`, `created_date`, `created_by`, `ip`, `ua`, `ekey`, `temp_code`) VALUES
(null, 'PRIME', 'DUBAI', 'QUOTE', 'QT/+pol+/+yy+/+mm+/+four_digit', '1', 'NA', 'Company Wise', 'Continuously', 'Jobwise', '2023-10-04 15:48:26', 'sandeep', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36', '1f969982e21f5272b5e319feba2d5741680d3bb6f215ba98c1b1a8e156e9', '24651d3bf12ebb2'),
(null, 'PRIME', 'DUBAI', 'EXPORT BOOKING', 'PRM+branch_code+yy+four_digit+-E', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2023-10-04 16:47:27', 'sandeep', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36', '1f969982e21f5272b5e319feba2d5741680d3bb6f215ba98c1b1a8e156e9', '24651d49c6819f2'),
(null, 'PRIME', 'DUBAI', 'EXPORT MANIFEST', 'PRM+branch_code+pol+pod+four_digit', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2023-10-06 17:10:25', 'sandeep', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36', '9b2a42610081d4db27659525a8e4cf40a03c3c3cf9336cde764a2a85404f20adc830099e471095a7', '24651ff2277a79d'),
(null, 'PRIME', 'DUBAI', 'DELIVERY ORDER', 'DO+branch_code+yy+four_digit', '1', 'NA', 'Location Wise', 'Continuously', 'Jobwise', '2023-10-13 12:31:48', 'admin_kgl', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36', '520782e7befaba85b1153122e3c53024cb5ac5ad10ed7812d103e926', '426528eb5a52087'),
(null, 'PRIME', 'DUBAI', 'IMPORT BOOKING', 'PRM+branch_code+yy+four_digit+-I', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2023-10-13 14:27:13', 'admin_kgl', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36', '47f116146463e796603dc009f9a76635dfd5ffcf5978121c785b802c', '426529066923ac9'),
(null, 'PRIME', 'DUBAI', 'BUSINESS PARTNER', 'P+five_digit', '1', 'NA', 'Global', 'Continuously', 'Jobwise', '2023-11-08 06:46:06', 'admin_bluelogis', '::1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36', 'e65657e3c4d5b4de287d99fb1328ac186ffd6f7a15aaf9c9848ec4b4492da8f1a32dd60d4ad4', '44654ae15620d4d'),
(null, 'PRIME', 'DUBAI', 'INVOICE', 'PRM/+job_type+/+yy+/+four_digit', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2023-12-08 07:18:56', 'admin_bluelogis', '::1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36', 'e5de1bc27b678f653d4c50091317595aba188ea0bfb435ca48d24e826db2de5120952534e08d', '44657310b837683'),
(null, 'PRIME', 'DUBAI', 'SRR', 'SRR/+yy+/+four_digit', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2024-05-10 02:44:11', 'admin_bluelogis', '::1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', 'b94293bd3c481286b98e7dd3e53b078cdb363d43a47d2e69da0c9a6ec42711ac251302c7', '44663dd75396054'),
(null, 'PRIME', 'DUBAI', 'IMPORT MANIFEST', 'PRM+branch_code+pol+pod+four_digit+-I', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2024-05-28 03:14:59', 'agent_mum', '103.28.246.12', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', '3bc694c44706edcea052870392da802bfb324563e78a505ae93084a206', '546655998bca75d'),
(null, 'PRIME', 'DUBAI', 'TRANSHIPMENT BOOKING', 'PRM+branch_code+yy+four_digit+-TS', '1', 'NA', 'Company Wise', 'Continuously', 'Jobwise', '2025-02-10 19:12:15', 'admin_bluelogis', '49.205.85.118', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36', 'c8e5761c687c71eaa39e08a4e2440cad9b04ba6beb52c17599a25270', '4467aa0237a8f20'),
(null, 'PRIME', 'DUBAI', 'SCHEDULE REPORT', 'SCR+yy+mm+four_digit', '1', 'NA', 'Location Wise', 'Continuously', 'Jobwise', '2025-09-22 18:16:49', 'admin_bluelogis', '49.204.137.111', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', '9b7ad8d03534786136d0db5fa4efdf86461c9cb6f92a4d0a36b0', '4468d145398de79'),
(null, 'PRIME', 'DUBAI', 'MRG', 'MRG/+four_digit', '1', 'NA', 'Company Wise', 'Continuously', 'NA', '2025-10-10 16:16:58', 'admin_bluelogis', '49.204.112.175', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36', '9b7ad8d03534786136d0db5fa4efdf86461c9cb6f92a4d0a36b0', '4468e8e4225031a');


CREATE TABLE `user_payment_reminder` (
  `id` int(11) NOT NULL,
  `customer` text,
  `invoice_no` text,
  `invoice_date` text,
  `due_date` text,
  `service` text,
  `amount_due` text,
  `pay_link` text,
  `status` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `user_payment_reminder` (`id`, `customer`, `invoice_no`, `invoice_date`, `due_date`, `service`, `amount_due`, `pay_link`, `status`) VALUES
(1, 'BHAVANI', '#BLCP-PRO-2023-020', '08-11-2023', '22-11-2023', 'BLUELOGIS SOFTWARE AMC\r\nFrom 01-12-23 to 30-11-2024', 'INR 1,41,600.00', 'https://rzp.io/i/stAVFiJi', 'PAID');

ALTER TABLE `user_payment_reminder`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `user_payment_reminder`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;


CREATE TABLE `user_notification` (
  `id` int NOT NULL,
  `company` text,
  `header` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `link_name` text,
  `link_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `status` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

INSERT INTO `user_notification` (`id`, `company`, `header`, `message`, `link_name`, `link_url`, `status`) VALUES
(1, NULL, 'Upgrade Alert: ', 'A major update to the BlueLogis ERP is available, featuring enhanced performance and new tools. \nPlease transition your operations to the new BlueLogis 3.0 version before 1st November 2025.', 'Learn More...', 'https://crm.bluelogis.app/crm/knowledge-base/article/bluelogis-nx-principal-software-process-flow', 'ACTIVE');

ALTER TABLE `user_notification`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `user_notification`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

ALTER TABLE `location_master` ADD `secondary_address` TEXT NULL AFTER `default_foreign_bank_code`;

ALTER TABLE `company_master` ADD `bl_pdf_marks_char_limit` TEXT NULL;
ALTER TABLE `company_master` ADD `bl_pdf_description_char_limit` TEXT NULL;
UPDATE `company_master` SET `bl_pdf_marks_char_limit` = '150' ;
UPDATE `company_master` SET `bl_pdf_description_char_limit` = '650' ;

ALTER TABLE `mt_voyage` CHANGE `export_end_calc_date` `export_end_calc_date` DATETIME NULL DEFAULT NULL;

ALTER TABLE `mt_event_updation` ADD `event_time` TEXT NULL AFTER `event_date`;
ALTER TABLE `mt_voyage` ADD `export_end_calc_time` TEXT NULL AFTER `export_end_calc_date`;
ALTER TABLE `terminal_reefer_plugin_tariff` ADD `portin_free_hours` TEXT NULL AFTER `rate_per_shift`;

ALTER TABLE `mt_event_updation` ADD `from_direct_event` VARCHAR(3) NULL AFTER `agent_id`;


CREATE TABLE `ap_job_list` (
  `id` int(11) NOT NULL,
  `order_id` text,
  `order_no` text,
  `order_teus` text,
  `per_teu_amount` text,
  `order_teus_amount` text,
  `ap_id` text,
  `local_amount` text,
  `aph_status` text,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `ap_job_list`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `ap_job_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `load_port_tariff` ADD `agent` TEXT NULL AFTER `mandatory`, ADD `agent_name` TEXT NULL AFTER `agent`;
