<?php
namespace App\Dashboard\Templates\Order;

class Main extends \App\Dashboard\Templates\BaseAbstract
{
	public function configureDashboard()
	{
		// order details widget
		$orderDetailsWidget = new \App\Dashboard\Widget\OrderDetails();

		// order profit widget
		$orderProfitWidget = new \App\Dashboard\Widget\OrderProfitDetails();

		// order income widget
		$orderIncomeWidget = new \App\Dashboard\Widget\OrderIncomeDetails();

		// order acquisition
		$orderAcquitisition = new \App\Dashboard\Widget\OrderAcquisitionDetails();

		// order services list
		$orderServicesListWidget = new \App\Dashboard\Widget\OrderServices();

		// order invoices list
		$orderInvoicesListWidget = new \App\Dashboard\Widget\OrderInvoicesList();

		// order cashings list
		$orderCashingsListWidget = new \App\Dashboard\Widget\OrderCashingsList();

		// order supplier invoices list
		$orderSupplierInvoicesListWidget = new \App\Dashboard\Widget\OrderSupplierInvoicesList();

		// order payments list
		$orderPaymentsListWidget = new \App\Dashboard\Widget\OrderSupplierPaymentsList();

		// order balances list
		$orderBalancesListWidget = new \App\Dashboard\Widget\OrderBalancesList();

		$twoColumnsContainer = new \Engine\Dashboard\Containers\Table2Col();
		$twoColumnsContainer->insertElement($orderDetailsWidget, 0, 0);
		$twoColumnsContainer->insertElement($orderProfitWidget, 0, 1);
		$twoColumnsContainer->insertElement($orderIncomeWidget, 1, 0);
		$twoColumnsContainer->insertElement($orderAcquitisition, 1, 1);
		$this->dashboard->addContainer($twoColumnsContainer);


		// add widgets to dashboard
		$this->dashboard->insertElement($orderServicesListWidget, 1);
		$this->dashboard->insertElement($orderInvoicesListWidget, 2);
		$this->dashboard->insertElement($orderCashingsListWidget, 3);
		$this->dashboard->insertElement($orderSupplierInvoicesListWidget, 4);
		$this->dashboard->insertElement($orderPaymentsListWidget, 5);
		$this->dashboard->insertElement($orderBalancesListWidget, 6);
	}
}