'scanning', 'cols' => 2, 'min' => 35)); $aieo_bs_form_id = 'aieo-card-branch-scanner-add-a-branch-form'; list($aieo_bs_open, $aieo_bs_close) = AIEO_DMM_UI::card(array( 'anchor' => 'branch-scanner-add-a-branch', 'icon' => 'plus', 'title' => __('Add a branch', 'ai-eshop-optimizer'), 'description' => __('Register a branch so staff can scan its shelves and keep its stock in step with the eshop.', 'ai-eshop-optimizer'), 'span' => 'all', 'footer' => class_exists('\Rooster\Admin\States') ? \Rooster\Admin\States::save_button($aieo_bs_form_id, array('label' => __('Save branch', 'ai-eshop-optimizer'))) : '', )); echo $aieo_bs_open; ob_start(); ?> ' . AIEO_Kit::row(__('Slug', 'ai-eshop-optimizer'), AIEO_Kit::input('slug', '', array('id' => 'aieo-bs-slug', 'pattern' => '[a-z0-9_\-]+', 'required' => true, 'short' => true, 'code' => true)), '', array('id' => 'aieo-bs-slug', 'required' => true)) . AIEO_Kit::row(__('Label', 'ai-eshop-optimizer'), AIEO_Kit::input('label', '', array('id' => 'aieo-bs-label', 'required' => true)), '', array('id' => 'aieo-bs-label', 'required' => true)) . AIEO_Kit::row(__('Stock table', 'ai-eshop-optimizer'), AIEO_Kit::input('stock_table', '', array('id' => 'aieo-bs-stock-table', 'code' => true, 'help' => true, 'placeholder' => $GLOBALS['wpdb']->prefix . 'store_board_mybranch')), __('Leave empty and the whole pattern is provisioned for you: the board table, its audit and pre-order triggers, a seed of your catalogue, and a staff scanner page locked to this branch. Name a table only to point at one that already exists.', 'ai-eshop-optimizer'), array('id' => 'aieo-bs-stock-table')) . AIEO_Kit::row(__('Match column', 'ai-eshop-optimizer'), AIEO_Kit::select('match_col', array('gtin' => 'gtin', 'sku' => 'sku', 'product_id' => 'product_id', 'barcode' => 'barcode'), 'gtin', array('id' => 'aieo-bs-match-col')), '', array('id' => 'aieo-bs-match-col')) . AIEO_Kit::row(__('Sort order', 'ai-eshop-optimizer'), '', '', array('id' => 'aieo-bs-sort-order')) . AIEO_Kit::row(__('ERP branch ID', 'ai-eshop-optimizer'), AIEO_Kit::input('erp_id', '', array('id' => 'aieo-bs-erp-id', 'short' => true, 'help' => true, 'placeholder' => '100')), __('This branch\'s id in your ERP — maps the branch value carried by ERP-synced orders to this branch. Leave empty if not synced from an ERP.', 'ai-eshop-optimizer'), array('id' => 'aieo-bs-erp-id')) . AIEO_Kit::row(__('ERP match text', 'ai-eshop-optimizer'), AIEO_Kit::input('match_patterns', '', array('id' => 'aieo-bs-match-patterns', 'help' => true)), __('How this branch is spelled in the ERP sales feed\'s branch column. Separate alternatives with | (e.g. a renamed or merged store). Empty = match on the label.', 'ai-eshop-optimizer'), array('id' => 'aieo-bs-match-patterns')) . AIEO_Kit::row(__('Status', 'ai-eshop-optimizer'), AIEO_Kit::check('enabled', __('Enabled', 'ai-eshop-optimizer'), true, array('id' => 'aieo-bs-enabled')), '', array('group' => true)) . ''; ?> 'branch-scanner-branches', 'flush' => true, 'title' => __('Branches', 'ai-eshop-optimizer'), 'description' => __('Define the branches available to the staff scanner. Each branch points at a stock-board table in the database.', 'ai-eshop-optimizer'), 'span' => 'all', )); echo $aieo_bs_open; ?> (int) $b['id'], 'slug' => (string) $b['slug'], 'label' => (string) $b['label'], 'stock_table' => (string) $b['stock_table'], 'match_col' => (string) $b['match_col'], 'erp_id' => (string) ($b['erp_id'] ?? ''), 'patterns' => (string) ($b['match_patterns'] ?? ''), 'page' => ($aieo_bs_page > 0 && 'publish' === get_post_status($aieo_bs_page)) ? __('Open', 'ai-eshop-optimizer') : '', 'page_url' => $aieo_bs_page > 0 ? (string) get_permalink($aieo_bs_page) : '', 'enabled' => ! empty($b['enabled']), ); } AIEO_Table::render(array( 'page_id' => 'branch_scanner', 'row_key' => 'id', 'rows' => $aieo_bs_rows, 'empty' => __('No branches yet. Add one above.', 'ai-eshop-optimizer'), 'columns' => array( array('key' => 'slug', 'label' => __('Slug', 'ai-eshop-optimizer'), 'type' => 'code'), array('key' => 'label', 'label' => __('Label', 'ai-eshop-optimizer')), array('key' => 'stock_table', 'label' => __('Stock table', 'ai-eshop-optimizer'), 'type' => 'code'), array('key' => 'match_col', 'label' => __('Match', 'ai-eshop-optimizer')), array('key' => 'erp_id', 'label' => __('ERP ID', 'ai-eshop-optimizer'), 'type' => 'code'), array('key' => 'patterns', 'label' => __('ERP match text', 'ai-eshop-optimizer'), 'type' => 'code', 'empty' => '—'), array('key' => 'page', 'label' => __('Scanner page', 'ai-eshop-optimizer'), 'type' => 'link', 'format' => array('href' => 'page_url', 'external' => true)), array('key' => 'enabled', 'label' => __('Enabled', 'ai-eshop-optimizer'), 'type' => 'boolean'), ), 'actions' => array( array( 'id' => 'aieo_dmm_branch_delete', 'label' => __('Delete', 'ai-eshop-optimizer'), 'class' => 'button button-small aieo-dmm-delete-row', ), ), )); ?> 'branch-scanner-erp-feed', 'icon' => 'plug', 'title' => __('ERP feed settings', 'ai-eshop-optimizer'), 'description' => __('Some ERPs book eshop orders through a physical branch\'s code and mark them with a dedicated invoice type. Rows carrying that invoice type count as the eshop channel and are excluded from every physical branch\'s statistics. Leave empty if your feed has no such marker.', 'ai-eshop-optimizer'), 'col' => 1, 'footer' => class_exists('\Rooster\Admin\States') ? \Rooster\Admin\States::save_button($aieo_bs_form_id) : '', )); echo $aieo_bs_open; ob_start(); ?>
'branch-scanner-shortcodes', 'icon' => 'braces', 'title' => __('Shortcodes', 'ai-eshop-optimizer'), 'description' => __('The shortcodes that put the staff scanner on a page of your site, for all branches or one.', 'ai-eshop-optimizer'), 'col' => 2, )); echo $aieo_bs_open; ?>
[aieo_dmm_branch_scanner] — [aieo_dmm_branch_scanner branch=""] — [aieo_dmm_customer_scanner] — ' . esc_html($aieo_bs_why) . '
'; } echo $aieo_bs_close; ?> 'branch-scanner-pre-orders-moved', 'icon' => 'arrow-right-left', 'title' => __('Pre-orders moved', 'ai-eshop-optimizer'), 'description' => __('Where the pre-order tables that used to be on this page can be found now.', 'ai-eshop-optimizer'), 'col' => 1, )); echo $aieo_bs_open; ?> AIEO_DMM::MENU_SLUG, 'dmm_tab' => 'supplier_orders'), admin_url('admin.php'))) . '">' . esc_html__('Supplier Orders', 'ai-eshop-optimizer') . ''; $aieo_bs_html = sprintf(esc_html($aieo_bs_moved), $aieo_bs_link); $aieo_bs_html = class_exists('\Rooster\Admin\Guidance') ? \Rooster\Admin\Guidance::text(wp_strip_all_tags($aieo_bs_html), 'guidance', array('html' => $aieo_bs_html)) : '' . $aieo_bs_html . '
'; echo $aieo_bs_html; echo $aieo_bs_close; ?> 'branch-scanner-recent-scans', 'icon' => 'clock', 'title' => __('Recent scans', 'ai-eshop-optimizer'), 'description' => __('The latest stock updates staff made with the scanner at each branch.', 'ai-eshop-optimizer'), 'col' => 2, )); echo $aieo_bs_open; ?> __('No scans logged yet.', 'ai-eshop-optimizer'))); echo $aieo_bs_empty; ?> 'library', 'id' => 'aieo-bs-recent', 'caption' => __('Recent scans', 'ai-eshop-optimizer'), 'caps' => array('search' => true), 'page_id' => 'branch_scanner_recent', 'row_key' => 'id', 'rows' => $recent_log, 'columns' => array( array('key' => 'created_at', 'label' => __('When', 'ai-eshop-optimizer'), 'type' => 'datetime'), array('key' => 'barcode', 'label' => __('Barcode', 'ai-eshop-optimizer'), 'type' => 'code'), array('key' => 'status', 'label' => __('Status', 'ai-eshop-optimizer'), 'filter' => 'select'), array('key' => 'image_url', 'label' => __('Snapshot', 'ai-eshop-optimizer'), 'type' => 'image', 'sortable' => false, 'empty' => '—'), array('key' => 'branch_id', 'label' => __('Branch', 'ai-eshop-optimizer'), 'filter' => 'select'), array('key' => 'user_login', 'label' => __('User', 'ai-eshop-optimizer')), ), )); ?>