<?php

class posModel extends mainModel {

    public function __construct() {
        $registry = Registry::getInstance();
        $registry->Organization = new Organization;
        $registry->Invoice = new InvoiceposSMCCustom();
        $registry->MainInvoice = new Invoice();
        $registry->jv = new JV();
        $registry->product = new Product();
        $registry->material = new Material();
        $registry->role = new Role();
        $registry->currency = new Currency();
        $registry->expenses = new Expense();
        $registry->return = new ReturnInvoice();
        $registry->customer = new Customer();
        $registry->vendor = new Supplier();
        $registry->bank = new BankAccount();
        $registry->payment = new Payment();
        $registry->purchase = new Purchase();
        $registry->user = new User();
        $registry->restaurantpos = new restaurant_pos();
        $registry->depot = new WarehouseDepot();
    }

    public static function getcategoriesPOS() {
        $product = new Product();
        $categories = $product->getProductsCat(0);
        for ($x = 0; $x < count($categories); $x++) {
            $Cat = $categories[$x];
            if (count($Cat) == 2) {
                $SubC = (count($product->getProductsCat($Cat[0])) > 0) || (count($product->getProduct(($Cat[0]))) > 0);
                $categories[$x] = array($Cat[0], $Cat[1], $SubC);
            }
        }
        return $categories;
    }

}
