@extends('master') @section('content') @include('modals.media', [ 'id' => 'orderDocumentsContainer', 'title' => __('label.media.order-documents'), 'refs' => [ // RELATED OBJECTS 'combo' => 'orderDocumentsCombo' // CONTAINED FORM SEE ID ABOVE ], 'layout' => [ 'target' => 'media.order-documents', 'data' => [ 'config' => true, // RUN SETUPS 'refs' => [ // RELATED OBJECTS 'modal' => 'orderDocumentsContainerModal', // CONTAINER MODAL ], ], ] ]) @include('modals.order-products', [ 'id' => 'orderProductsContainer', 'title' => __('label.order.products'), 'refs' => [ // RELATED OBJECTS 'table' => 'orderProductsRecordsTable', // CONTAINED TABLE 'base-table' => 'ordersRecordsTable', // BASE RECORDS TABLE ], 'layout' => [ 'target' => 'tables.order-products', 'data' => [ 'id' => 'orderProductsRecords', // TABLE ID 'src' => 'order.products.data', // DATA ROUTE NAME 'resource' => 'products', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'data' => [], 'through' => true, // INDIRECT REDERENCE 'routes' => [ config('const.crud.delete') => Utils::indexRoute('order.products.delete'), ], 'refs' => [ // RELATED OBJECTS 'table' => 'ordersRecordsTable', // BASE RECORDS TABLE (FOR CONTEXT) 'modal' => 'orderProductsContainerModal', // COMPONENT FORM 'new-product' => 'productsAddContainerModal', // NEW PAYMENT MODAL ], ], ] ]) @include('modals.products', [ 'id' => 'productsAddContainer', 'title' => __('label.add.product'), 'refs' => [ // RELATED OBJECTS 'form' => 'productsAddForm', // CONTAINED FORM SEE ID ABOVE ], 'layout' => [ 'target' => 'forms.order-products', 'data' => [ 'id' => 'productsAdd', // INPUT ID BIND //'method' => config('const.crud.create'), // REQUIRED FORM METHOD 'table' => 'productsRecords', // RELATED TABLE ID 'resource' => 'products', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'routes' => [ config('const.crud.create') => Utils::indexRoute('order.products.store'), ], 'refs' => [ // RELATED OBJECTS 'modal' => 'productsAddContainerModal', // CONTAINER MODAL 'table' => 'orderProductsRecordsTable', // RECORDS TABLE TO UPDATE ], ], ] ]) @include('modals.order-payments', [ 'id' => 'orderPaymentsContainer', 'title' => __('label.order.payments'), 'refs' => [ // RELATED OBJECTS 'table' => 'orderPaymentsRecordsTable', // CONTAINED TABLE 'base-table' => 'ordersRecordsTable', // BASE RECORDS TABLE ], 'layout' => [ 'target' => 'tables.order-payments', 'data' => [ 'id' => 'orderPaymentsRecords', // TABLE ID 'src' => 'order.payments.data', // DATA ROUTE NAME 'resource' => 'payments', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'data' => [], 'through' => true, // INDIRECT REDERENCE 'refs' => [ // RELATED OBJECTS 'table' => 'ordersRecordsTable', // BASE RECORDS TABLE (FOR CONTEXT) 'modal' => 'orderPaymentsContainerModal', // COMPONENT FORM 'new-payment' => 'paymentsAddContainerModal', // NEW PAYMENT MODAL ], ], ] ]) @include('modals.payments', [ 'id' => 'paymentsAddContainer', 'title' => __('label.new.payment'), 'refs' => [ // RELATED OBJECTS 'form' => 'paymentsAddForm', // CONTAINED FORM SEE ID ABOVE ], 'layout' => [ 'target' => 'forms.payments', 'data' => [ 'id' => 'paymentsAdd', // INPUT ID BIND //'method' => config('const.crud.create'), // REQUIRED FORM METHOD 'table' => 'paymentsRecords', // RELATED TABLE ID 'resource' => 'payments', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'refs' => [ // RELATED OBJECTS 'modal' => 'paymentsAddContainerModal', // CONTAINER MODAL 'table' => 'orderPaymentsRecordsTable', // RECORDS TABLE TO UPDATE ], ], ] ]) @include('modals.map', [ 'id' => 'locationViewerContainer', 'title' => __('Map'), 'refs' => [ // RELATED OBJECTS 'form' => 'locationViewerForm' // CONTAINED FORM SEE ID ABOVE ], 'buttons' => [ [ 'icon' => 'fa-plus', 'class' => 'btn-default plus', ], [ 'icon' => 'fa-minus', 'class' => 'btn-default minus', ], ], 'layout' => [ 'edit' => true, 'target' => 'maps.viewer', 'data' => [ 'id' => 'locationViewer', // INPUT ID BIND 'refs' => [ // RELATED OBJECTS 'modal' => 'locationViewerContainerModal', // CONTAINER MODAL ], ], ] ]) @include('modals.address', [ 'id' => 'locationFinderContainer', 'title' => __('label.new.address'), 'refs' => [ // RELATED OBJECTS 'form' => 'locationFinderForm' // CONTAINED FORM SEE ID ABOVE ], 'layout' => [ 'edit' => true, 'target' => 'maps.finder', 'data' => [ 'id' => 'locationFinder', // INPUT ID BIND 'refs' => [ // RELATED OBJECTS 'modal' => 'locationFinderContainerModal', // CONTAINER MODAL ], ], ] ]) @include('modals.orders', [ 'id' => 'ordersEditContainer', 'title' => __('label.edit.order'), 'refs' => [ // RELATED OBJECTS 'form' => 'ordersEditForm' // CONTAINED FORM SEE ID ABOVE ], 'layout' => [ 'edit' => true, 'target' => 'forms.orders', 'data' => [ 'id' => 'ordersEdit', // INPUT ID BIND 'method' => config('const.crud.update'), // REQUIRED FORM METHOD 'resource' => 'orders', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'refs' => [ // RELATED OBJECTS 'modal' => 'ordersEditContainerModal', // CONTAINER MODAL 'table' => 'ordersRecordsTable', // RECORDS TABLE 'stores' => 'storesComboContainerModal', // STORES HANDLER 'details' => 'detailsComboContainerModal' // DETAILS HANDLER ], ], ] ]) @include('modals.details', [ 'id' => 'detailsComboContainer', 'type' => 'combo', 'title' => [ 'ins' => __('label.new.details'), 'edit' => __('label.edit.details'), ], 'refs' => [ // RELATED OBJECTS 'form' => 'detailsAddForm', // CONTAINED FORM SEE ID ABOVE 'table' => 'ordersRecordsTable', // RECORDS TABLE ], 'layout' => [ 'target' => 'forms.details', 'data' => [ 'id' => 'detailsAdd', // INPUT ID BIND 'resource' => 'details', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'method' => config('const.crud.combo'), // REQUIRED FORM METHOD // DEFINE EXPLICIT COMBO ACTIONS 'refs' => [ // RELATED OBJECTS 'modal' => 'detailsComboContainerModal', // CONTAINER MODAL 'stores' => 'storesComboContainerModal', // STORES HANDLER 'smap' => 'locationViewerSmap', // STATIC MAP 'map' => 'locationFinderMap', // ADDRESS MAP ], ], ] ]) @include('modals.stores', [ 'id' => 'storesComboContainer', 'type' => 'combo', 'title' => [ 'ins' => __('label.new.store'), 'edit' => __('label.edit.store'), ], 'refs' => [ // RELATED OBJECTS 'form' => 'storesAddForm', // CONTAINED FORM SEE ID ABOVE 'table' => 'ordersRecordsTable', // RECORDS TABLE ], 'layout' => [ 'target' => 'forms.stores', 'data' => [ 'id' => 'storesAdd', // INPUT ID BIND 'resource' => 'stores', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'method' => config('const.crud.combo'), // REQUIRED FORM METHOD // DEFINE EXPLICIT COMBO ACTIONS 'refs' => [ // RELATED OBJECTS 'modal' => 'storesComboContainerModal', // CONTAINER MODAL 'smap' => 'locationViewerSmap', // STATIC MAP ], ], ] ]) @include('modals.deliveries', [ 'id' => 'deliveriesComboContainer', 'type' => 'combo', 'title' => [ 'ins' => __('label.new.delivery'), 'edit' => __('label.edit.delivery'), ], 'refs' => [ // RELATED OBJECTS 'form' => 'deliveriesAddForm', // CONTAINED FORM SEE ID ABOVE 'table' => 'ordersRecordsTable', // RECORDS TABLE ], 'layout' => [ 'target' => 'forms.deliveries', 'data' => [ 'id' => 'deliveriesAdd', // INPUT ID BIND 'resource' => 'deliveries', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'method' => config('const.crud.combo'), // REQUIRED FORM METHOD // DEFINE EXPLICIT COMBO ACTIONS 'refs' => [ // RELATED OBJECTS 'modal' => 'deliveriesComboContainerModal', // CONTAINER MODAL 'smap' => 'locationViewerSmap', // STATIC MAP ], ], ] ]) @include('components.tabs', [ 'active' => 0, 'tabs' => [ [ 'title' => trans_choice('label.order', 2), 'portlet' => [ 'icon' => 'fa fa-bars', 'title' => __('label.records.order'), 'reload' => true ], 'layout' => [ 'target' => 'tables.orders', 'data' => [ 'id' => 'ordersRecords', // TABLE ID 'edit' => 'ordersEditContainer', // (ID) MODAL EDIT REF 'resource' => 'orders', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'method' => config('const.crud.delete'), // RESOURCE METHOD AVAILABLE 'data' => $orders, 'calls' => [ 'archive' => [ 'type' => config('const.crud.update'), 'url' => Utils::indexRoute('order.archive'), ], 'archive-completed' => [ 'type' => config('const.crud.update'), 'url' => route('archive.orders.completed'), ], ], 'refs' => [ // RELATED OBJECTS 'stores' => 'storesComboContainerModal', // STORES HANDLER 'details' => 'detailsComboContainerModal', // DETAILS HANDLER 'products' => 'orderProductsContainerModal', // ORDER PRODUCTS HANDLER 'payments' => 'orderPaymentsContainerModal', // ORDER PAYMENTS HANDLER 'delivery' => 'deliveriesComboContainerModal', // ORDER DELIVERY 'documents' => 'orderDocumentsMedia', // SEE MEDIA PRODUCT ] ], ] ], [ 'title' => __('label.new.order'), 'portlet' => [ 'icon' => 'fa fa-bars', 'title' => __('label.content.order'), ], 'layout' => [ 'target' => 'forms.orders', 'data' => [ 'id' => 'ordersInput', // FORM ID 'static' => '0', // NOT DINAMIC JUST ALWAYS INS 'resource' => 'orders', // ! DB TABLE RESOURCE NAME (RESOURCE ID) ! 'refs' => [ // RELATED OBJECTS 'table' => 'ordersRecordsTable', // RECORDS TABLE 'stores' => 'storesComboContainerModal', // STORES HANDLER 'details' => 'detailsComboContainerModal' // DETAILS HANDLER ], ], ] ] ], ]) @stop