Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't add date filter #83

Open
gt06 opened this issue Jun 29, 2017 · 9 comments
Open

I can't add date filter #83

gt06 opened this issue Jun 29, 2017 · 9 comments

Comments

@gt06
Copy link

gt06 commented Jun 29, 2017

I want to add date filter(to_date and from_date) in all reports. I have tried this using grid configuration section. but this solution not working.
anybody has solution on this?
Thank you

@peterjaap
Copy link
Collaborator

What exactly have you tried? Could you paste your grid config here?

@gt06
Copy link
Author

gt06 commented Jul 3, 2017

I have used this grid configuration but don't get any filter on pie chart.
{
"filterable": {"created_at_date": "adminhtml/widget_grid_column_filter_date"}
}

I want to add to date and from date filter. So i can get chart report between specific dates.
Thank you

@peterjaap
Copy link
Collaborator

peterjaap commented Jul 3, 2017 via email

@gt06
Copy link
Author

gt06 commented Jul 3, 2017

Sorry. the field name is created_at. But I have also tried created_at field name. but nothing has happened. I want to add a filter in sample orders status reports. Thanking you.

@sameer-satav
Copy link

@peterjaap I want to add date filter on google chart page, where Google chart is displayed. So I can easily filter data and see the result. I have used following grid configuration:-
{
"filterable": {"created_at": "adminhtml/widget_grid_column_filter_date"}
}

It is work for me. But it is allow me to filter data in table page where we can export csv. Not on google chart page. I want to add date filter on the right side of the chart.
Please help me.
Thank you.

@edward-simpson
Copy link

I am also having this issue, I am joining multiple tables, the sales_flat_order table is being aliased as SFO, and SFO.created_at is being aliased as purchased_on, but the date (or datetime for that matter) filter will not show with any of the following grid configurations (please note, I have included the in the same filter for space saving's sake, obviously I normally include these individually).

{
  "filterable": {
    "purchased_on": "adminhtml/widget_grid_column_filter_date",
    "created_at": "adminhtml/widget_grid_column_filter_date",
    "SFO.created_at": "adminhtml/widget_grid_column_filter_date",
    "sales_flat_order.created_at": "adminhtml/widget_grid_column_filter_date",
  }
}

@peterjaap
Copy link
Collaborator

Sorry we have moved on to Magento 2 so this module isn't maintained anymore. We still welcome PR's though.

@peterjaap peterjaap reopened this Jun 6, 2019
@sreichel
Copy link
Contributor

sreichel commented Jun 6, 2019

@edward-simpson can you please post you complete config including query? I'd take a look at this these days ...

@edward-simpson
Copy link

Hi @sreichel,

Thanks! Query below:

SELECT SFO.increment_id,
       SFO.facebook_order_id,
       CS.name as purchased_from,
       SFO.created_at             as purchased_on,
       SFO.customer_email,
       REPLACE(CONCAT_WS(' ', billing.prefix, billing.firstname, billing.middlename, billing.lastname), '  ',
               ' ')               as bill_to_name,
       REPLACE(CONCAT_WS(' ', shipping.prefix, shipping.firstname, shipping.middlename, shipping.lastname), '  ',
               ' ')               as ship_to_name,
       shipping.company           as shipping_company,
       shipping.street            as shipping_street,
       shipping.postcode          as shipping_postcode,
       shipping.city              as shipping_city,
       shipping.region            as shipping_region,
       shipping.country_id        as shipping_country,
       shipping.telephone         as shipping_telephone,
       shipping_description,
       base_grand_total,
       grand_total,
       status,
       state,
       SFOI.sku,
       SFOI.name,
       SFOI.price,
       eav_style_number.value     as style_number,
       eav_color_code_value.value as color_code,
       eav_size_code_value.value  as size,
       SFOI.qty_ordered           as qty,
       GM.message                 as gift_message,
       GM.sender                  as gift_message_from,
       GM.recipient               as gift_message_to
FROM sales_flat_order_item as SFOI
       INNER JOIN sales_flat_order as SFO ON SFOI.order_id = SFO.entity_id
       INNER JOIN core_store as CS ON CS.store_id = SFO.store_id
       LEFT JOIN catalog_product_flat_1 as CPF ON SFOI.product_id = CPF.entity_id
       LEFT JOIN catalog_product_entity_int as eav_color_code
                 ON SFOI.product_id = eav_color_code.entity_id and eav_color_code.attribute_id = 211
       LEFT JOIN eav_attribute_option_value as eav_color_code_value
                 ON eav_color_code.value = eav_color_code_value.option_id
       LEFT JOIN catalog_product_entity_int as eav_size_code
                 ON SFOI.product_id = eav_size_code.entity_id and eav_size_code.attribute_id = 178
       LEFT JOIN catalog_product_entity_varchar as eav_style_number
                 ON SFOI.product_id = eav_style_number.entity_id and eav_style_number.attribute_id = 181
       LEFT JOIN eav_attribute_option_value as eav_size_code_value
                 ON eav_size_code.value = eav_size_code_value.option_id
       LEFT JOIN sales_flat_order_address as billing ON SFO.billing_address_id = billing.entity_id
       LEFT JOIN sales_flat_order_address as shipping ON SFO.shipping_address_id = shipping.entity_id
       LEFT JOIN gift_message AS GM ON SFO.gift_message_id = GM.gift_message_id

Output type Plain Table

Grid Configuration:

{
  "filterable": {
    "purchased_on": "adminhtml/widget_grid_column_filter_date",
  }
}

However as previously mentioned I've tried a number of different configurations for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants