sylius_grid:
    grids:
        sylius_admin_order:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.order.class%"
                    repository:
                        method: createCriteriaAwareSearchListQueryBuilder
                        arguments:
                            criteria: $criteria
            sorting:
                number: desc
            fields:
                date:
                    type: datetime
                    label: sylius.ui.date
                    path: checkoutCompletedAt
                    sortable: checkoutCompletedAt
                    options:
                        format: d-m-Y H:i:s
                number:
                    type: twig
                    label: sylius.ui.number
                    path: .
                    sortable: ~
                    options:
                        template: "@SyliusAdmin/Order/Grid/Field/number.html.twig"
                channel:
                    type: twig
                    label: sylius.ui.channel
                    sortable: channel.code
                    options:
                        template: "@SyliusAdmin/Order/Grid/Field/channel.html.twig"
                customer:
                    type: twig
                    label: sylius.ui.customer
                    sortable: customer.lastName
                    options:
                        template: "@SyliusAdmin/Order/Grid/Field/customer.html.twig"
                state:
                    type: twig
                    label: sylius.ui.state
                    sortable: ~
                    options:
                        template: "@SyliusUi/Grid/Field/state.html.twig"
                        vars:
                            labels: "@SyliusAdmin/Order/Label/State"
                paymentState:
                    type: twig
                    label: sylius.ui.payment_state
                    sortable: ~
                    options:
                        template: "@SyliusUi/Grid/Field/state.html.twig"
                        vars:
                            labels: "@SyliusAdmin/Order/Label/PaymentState"
                shippingState:
                    type: twig
                    label: sylius.ui.shipping_state
                    sortable: ~
                    options:
                        template: "@SyliusUi/Grid/Field/state.html.twig"
                        vars:
                            labels: "@SyliusAdmin/Order/Label/ShippingState"
                total:
                    type: twig
                    label: sylius.ui.total
                    path: .
                    sortable: total
                    options:
                        template: "@SyliusAdmin/Order/Grid/Field/total.html.twig"
                currencyCode:
                    type: string
                    label: sylius.ui.currency
                    sortable: ~
            filters:
                product:
                    type: resource_autocomplete
                    label: sylius.ui.product
                    form_options:
                        resource: sylius.product
                        choice_name: descriptor
                        choice_value: code
                        multiple: true
                        remote_path: sylius_admin_ajax_products_by_phrase
                        load_edit_path: sylius_admin_ajax_product_by_code
                    options:
                        fields: [product.code]
                variant:
                    type: resource_autocomplete
                    label: sylius.ui.variant
                    form_options:
                        resource: sylius.product_variant
                        choice_name: descriptor
                        choice_value: code
                        multiple: true
                        remote_path: sylius_admin_ajax_all_product_variants_by_phrase
                        load_edit_path: sylius_admin_ajax_all_product_variants_by_codes
                    options:
                        fields: [variant.code]
                number:
                    type: string
                    label: sylius.ui.number
                customer:
                    type: string
                    label: sylius.ui.customer
                    options:
                        fields: [customer.email, customer.firstName, customer.lastName]
                date:
                    type: date
                    label: sylius.ui.date
                    options:
                        field: checkoutCompletedAt
                        inclusive_to: true
                channel:
                    type: entity
                    label: sylius.ui.channel
                    form_options:
                        class: "%sylius.model.channel.class%"
                total:
                    type: money
                    label: sylius.ui.total
                    options:
                        currency_field: currencyCode
                shipping_method:
                    type: entity
                    label: sylius.ui.shipping_method
                    options:
                        fields: [shipments.method]
                    form_options:
                        class: "%sylius.model.shipping_method.class%"
            actions:
                item:
                    show:
                        type: show
