TABLES:
- amc_contracts
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - customer_id (int(11)) Null=YES Key=MUL Default= Extra=
  - start_date (date) Null=NO Key= Default= Extra=
  - end_date (date) Null=NO Key= Default= Extra=
  - amount (decimal(10,2)) Null=YES Key= Default= Extra=
  - status (enum('Active','Expired')) Null=YES Key= Default=Active Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - customer_id: Column=customer_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- companies
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_name (varchar(255)) Null=NO Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
- company_profile
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - company_name (varchar(255)) Null=NO Key= Default= Extra=
  - address (text) Null=YES Key= Default= Extra=
  - contact_number (varchar(50)) Null=YES Key= Default= Extra=
  - email (varchar(100)) Null=YES Key= Default= Extra=
  - gst_number (varchar(50)) Null=YES Key= Default= Extra=
  - bank_details (text) Null=YES Key= Default= Extra=
  - logo (varchar(255)) Null=YES Key= Default= Extra=
  - signature (varchar(255)) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  - updated_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=on update current_timestamp()
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - company_id: Column=company_id Non_unique=1
- complaints
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - customer_id (int(11)) Null=YES Key=MUL Default= Extra=
  - assigned_tech_id (int(11)) Null=YES Key=MUL Default= Extra=
  - issue_description (text) Null=NO Key= Default= Extra=
  - priority (enum('Low','Medium','High')) Null=YES Key= Default=Medium Extra=
  - status (enum('Open','Assigned','In-Progress','Completed','Closed')) Null=YES Key= Default=Open Extra=
  - tech_remarks (text) Null=YES Key= Default= Extra=
  - parts_consumed (longtext) Null=YES Key= Default= Extra=
  - photo_before (varchar(255)) Null=YES Key= Default= Extra=
  - photo_after (varchar(255)) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  - assigned_at (datetime) Null=YES Key= Default= Extra=
  - started_at (datetime) Null=YES Key= Default= Extra=
  - completed_at (datetime) Null=YES Key= Default= Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - customer_id: Column=customer_id Non_unique=1
    - assigned_tech_id: Column=assigned_tech_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- customers
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - customer_name (varchar(150)) Null=NO Key= Default= Extra=
  - phone (varchar(15)) Null=NO Key= Default= Extra=
  - address (text) Null=NO Key= Default= Extra=
  - due_amount (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - gst_number (varchar(20)) Null=YES Key= Default= Extra=
  - has_active_amc (tinyint(1)) Null=YES Key= Default=0 Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - company_id: Column=company_id Non_unique=1
- income
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - income_date (datetime) Null=YES Key= Default= Extra=
  - category (varchar(100)) Null=NO Key= Default= Extra=
  - source (varchar(150)) Null=NO Key= Default= Extra=
  - amount (decimal(10,2)) Null=NO Key= Default= Extra=
  - payment_method (varchar(50)) Null=NO Key= Default= Extra=
  - reference_no (varchar(100)) Null=YES Key= Default= Extra=
  - description (text) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - company_id: Column=company_id Non_unique=1
- invoice_items
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - invoice_id (int(11)) Null=YES Key=MUL Default= Extra=
  - product_id (int(11)) Null=YES Key=MUL Default= Extra=
  - quantity (int(11)) Null=NO Key= Default= Extra=
  - unit_price (decimal(10,2)) Null=YES Key= Default= Extra=
  - taxable_value (decimal(10,2)) Null=YES Key= Default= Extra=
  - gst_rate (decimal(5,2)) Null=YES Key= Default= Extra=
  - gst_amount (decimal(10,2)) Null=YES Key= Default= Extra=
  - gst_mode (enum('Exclusive','Inclusive')) Null=YES Key= Default=Exclusive Extra=
  - discount_type (enum('Fixed','Percentage')) Null=YES Key= Default=Fixed Extra=
  - discount_value (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - discount_amount (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - total_price (decimal(10,2)) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - invoice_id: Column=invoice_id Non_unique=1
    - product_id: Column=product_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- invoices
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - complaint_id (int(11)) Null=YES Key=MUL Default= Extra=
  - customer_id (int(11)) Null=YES Key= Default= Extra=
  - sales_person_id (int(11)) Null=YES Key= Default= Extra=
  - invoice_no (varchar(50)) Null=NO Key= Default= Extra=
  - subtotal (decimal(10,2)) Null=YES Key= Default= Extra=
  - gst_amount (decimal(10,2)) Null=YES Key= Default= Extra=
  - grand_total (decimal(10,2)) Null=YES Key= Default= Extra=
  - shipping_charges (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - shipping_address (text) Null=YES Key= Default= Extra=
  - payment_status (enum('Paid','Unpaid','Partial')) Null=YES Key= Default=Unpaid Extra=
  - payment_method (enum('Cash','UPI','Bank','Pay Later')) Null=YES Key= Default=Cash Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  - gst_mode (enum('Inclusive','Exclusive')) Null=YES Key= Default=Exclusive Extra=
  - due_date (date) Null=YES Key= Default= Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - uq_invoices_no_company: Column=company_id Non_unique=0
    - uq_invoices_no_company: Column=invoice_no Non_unique=0
    - complaint_id: Column=complaint_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- payments
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - customer_id (int(11)) Null=YES Key=MUL Default= Extra=
  - invoice_id (int(11)) Null=YES Key=MUL Default= Extra=
  - payment_date (datetime) Null=YES Key= Default= Extra=
  - amount (decimal(10,2)) Null=NO Key= Default= Extra=
  - payment_method (enum('Cash','UPI','Bank','Pay Later')) Null=YES Key= Default=Cash Extra=
  - reference_no (varchar(100)) Null=YES Key= Default= Extra=
  - notes (text) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - customer_id: Column=customer_id Non_unique=1
    - invoice_id: Column=invoice_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- product_serials
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - product_id (int(11)) Null=YES Key=MUL Default= Extra=
  - purchase_id (int(11)) Null=YES Key=MUL Default= Extra=
  - serial_number (varchar(100)) Null=NO Key= Default= Extra=
  - purchase_price (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - gst_rate (decimal(5,2)) Null=YES Key= Default=0.00 Extra=
  - sale_price (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - invoice_id (int(11)) Null=YES Key=MUL Default= Extra=
  - technician_id (int(11)) Null=YES Key= Default= Extra=
  - allocated_at (timestamp) Null=YES Key= Default= Extra=
  - status (enum('In Stock','Sold','Defective','Returned')) Null=YES Key= Default=In Stock Extra=
  - sold_at (datetime) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - uq_serials_code_company: Column=company_id Non_unique=0
    - uq_serials_code_company: Column=serial_number Non_unique=0
    - product_id: Column=product_id Non_unique=1
    - fk_purchase: Column=purchase_id Non_unique=1
    - fk_invoice: Column=invoice_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- products
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - category_id (int(11)) Null=YES Key=MUL Default= Extra=
  - product_name (varchar(255)) Null=NO Key= Default= Extra=
  - product_code (varchar(100)) Null=YES Key= Default= Extra=
  - unit (varchar(50)) Null=YES Key= Default=Pcs Extra=
  - category (varchar(50)) Null=YES Key= Default= Extra=
  - serial_number (varchar(100)) Null=YES Key= Default= Extra=
  - unit_price (decimal(10,2)) Null=NO Key= Default= Extra=
  - gst_rate (decimal(5,2)) Null=YES Key= Default=0.00 Extra=
  - current_stock (int(11)) Null=YES Key= Default=0 Extra=
  - opening_stock (int(11)) Null=YES Key= Default=0 Extra=
  - description (text) Null=YES Key= Default= Extra=
  - warranty_months (int(11)) Null=YES Key= Default=12 Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - uq_products_code_company: Column=company_id Non_unique=0
    - uq_products_code_company: Column=product_code Non_unique=0
    - fk_category: Column=category_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- purchase_items
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - purchase_id (int(11)) Null=YES Key=MUL Default= Extra=
  - product_id (int(11)) Null=YES Key=MUL Default= Extra=
  - quantity (int(11)) Null=NO Key= Default= Extra=
  - unit_price (decimal(10,2)) Null=YES Key= Default= Extra=
  - total_price (decimal(10,2)) Null=YES Key= Default= Extra=
  - gst_rate (decimal(5,2)) Null=YES Key= Default=0.00 Extra=
  - gst_amount (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - taxable_value (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - discount_type (enum('Fixed','Percentage')) Null=YES Key= Default=Fixed Extra=
  - discount_value (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - discount_amount (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - gst_mode (enum('Exclusive','Inclusive')) Null=YES Key= Default=Exclusive Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - purchase_id: Column=purchase_id Non_unique=1
    - product_id: Column=product_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- purchase_return_items
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - return_id (int(11)) Null=NO Key=MUL Default= Extra=
  - product_id (int(11)) Null=NO Key= Default= Extra=
  - serial_number (varchar(100)) Null=YES Key= Default= Extra=
  - quantity (int(11)) Null=NO Key= Default= Extra=
  - price (decimal(10,2)) Null=NO Key= Default= Extra=
  - total (decimal(10,2)) Null=NO Key= Default= Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - return_id: Column=return_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- purchase_returns
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - purchase_id (int(11)) Null=NO Key=MUL Default= Extra=
  - supplier_id (int(11)) Null=NO Key= Default= Extra=
  - return_date (datetime) Null=NO Key= Default= Extra=
  - total_amount (decimal(10,2)) Null=NO Key= Default= Extra=
  - notes (text) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - purchase_id: Column=purchase_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- purchases
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - supplier_id (int(11)) Null=YES Key=MUL Default= Extra=
  - payee_name (varchar(150)) Null=YES Key= Default= Extra=
  - category (varchar(100)) Null=YES Key= Default=Inventory Purchase Extra=
  - purchase_date (datetime) Null=YES Key= Default= Extra=
  - bill_no (varchar(100)) Null=YES Key= Default= Extra=
  - subtotal (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - gst_amount (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - total_amount (decimal(10,2)) Null=YES Key= Default= Extra=
  - payment_method (varchar(50)) Null=YES Key= Default=Cash Extra=
  - reference_no (varchar(100)) Null=YES Key= Default= Extra=
  - notes (text) Null=YES Key= Default= Extra=
  - is_inventory (tinyint(1)) Null=YES Key= Default=1 Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  - bank_name (varchar(150)) Null=YES Key= Default= Extra=
  - cheque_no (varchar(50)) Null=YES Key= Default= Extra=
  - cheque_date (date) Null=YES Key= Default= Extra=
  - due_date (date) Null=YES Key= Default= Extra=
  - gst_mode (enum('Exclusive','Inclusive')) Null=YES Key= Default=Exclusive Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - supplier_id: Column=supplier_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- sales_persons
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - name (varchar(191)) Null=NO Key= Default= Extra=
  - phone (varchar(50)) Null=YES Key= Default= Extra=
  - email (varchar(191)) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - company_id: Column=company_id Non_unique=1
- sales_return_items
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - return_id (int(11)) Null=NO Key=MUL Default= Extra=
  - product_id (int(11)) Null=NO Key= Default= Extra=
  - serial_number (varchar(100)) Null=YES Key= Default= Extra=
  - quantity (int(11)) Null=NO Key= Default= Extra=
  - price (decimal(10,2)) Null=NO Key= Default= Extra=
  - total (decimal(10,2)) Null=NO Key= Default= Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - return_id: Column=return_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- sales_returns
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - invoice_id (int(11)) Null=NO Key=MUL Default= Extra=
  - customer_id (int(11)) Null=NO Key= Default= Extra=
  - return_date (datetime) Null=NO Key= Default= Extra=
  - total_amount (decimal(10,2)) Null=NO Key= Default= Extra=
  - notes (text) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - invoice_id: Column=invoice_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- stock_categories
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - category_name (varchar(100)) Null=NO Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - uq_categories_name_company: Column=company_id Non_unique=0
    - uq_categories_name_company: Column=category_name Non_unique=0
    - company_id: Column=company_id Non_unique=1
- stock_movements
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - product_id (int(11)) Null=YES Key=MUL Default= Extra=
  - type (enum('Stock In','Stock Out','Adjustment')) Null=NO Key= Default= Extra=
  - quantity (int(11)) Null=NO Key= Default= Extra=
  - reference_id (int(11)) Null=YES Key= Default= Extra=
  - notes (text) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - product_id: Column=product_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- suppliers
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - supplier_name (varchar(150)) Null=NO Key= Default= Extra=
  - phone (varchar(15)) Null=YES Key= Default= Extra=
  - email (varchar(100)) Null=YES Key= Default= Extra=
  - address (text) Null=YES Key= Default= Extra=
  - gst_number (varchar(20)) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - company_id: Column=company_id Non_unique=1
- technician_stock
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - technician_id (int(11)) Null=NO Key=MUL Default= Extra=
  - product_id (int(11)) Null=NO Key=MUL Default= Extra=
  - quantity (decimal(10,2)) Null=YES Key= Default=0.00 Extra=
  - allocated_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - technician_id: Column=technician_id Non_unique=1
    - product_id: Column=product_id Non_unique=1
    - company_id: Column=company_id Non_unique=1
- users
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - fullname (varchar(100)) Null=NO Key= Default= Extra=
  - email (varchar(100)) Null=NO Key=UNI Default= Extra=
  - address (text) Null=YES Key= Default= Extra=
  - password (varchar(255)) Null=NO Key= Default= Extra=
  - phone (varchar(15)) Null=YES Key= Default= Extra=
  - role (enum('admin','technician')) Null=YES Key= Default=technician Extra=
  - status (tinyint(1)) Null=YES Key= Default=1 Extra=
  - rating (decimal(3,2)) Null=YES Key= Default=5.00 Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - email: Column=email Non_unique=0
    - company_id: Column=company_id Non_unique=1
- vouchers
  - id (int(11)) Null=NO Key=PRI Default= Extra=auto_increment
  - company_id (int(11)) Null=YES Key=MUL Default=1 Extra=
  - voucher_no (varchar(50)) Null=NO Key= Default= Extra=
  - voucher_type (enum('Payment','Receipt')) Null=NO Key= Default= Extra=
  - voucher_date (datetime) Null=YES Key= Default= Extra=
  - account_head (varchar(100)) Null=NO Key= Default= Extra=
  - payee_payer (varchar(150)) Null=NO Key= Default= Extra=
  - amount (decimal(10,2)) Null=NO Key= Default= Extra=
  - payment_method (varchar(50)) Null=NO Key= Default= Extra=
  - reference_no (varchar(100)) Null=YES Key= Default= Extra=
  - narration (text) Null=YES Key= Default= Extra=
  - created_at (timestamp) Null=NO Key= Default=current_timestamp() Extra=
  - bank_name (varchar(150)) Null=YES Key= Default= Extra=
  - cheque_no (varchar(50)) Null=YES Key= Default= Extra=
  - cheque_date (date) Null=YES Key= Default= Extra=
  Indexes:
    - PRIMARY: Column=id Non_unique=0
    - uq_vouchers_no_company: Column=company_id Non_unique=0
    - uq_vouchers_no_company: Column=voucher_no Non_unique=0
    - company_id: Column=company_id Non_unique=1
