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

Mage_Report: Migrate hardcoded cron expressions to configurable field… #2595

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/code/core/Mage/Reports/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@
</mtd_start>
</fields>
</dashboard>
<crontab translate="label">
<label>Cron settings</label>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<viewed_expr translate="label comment">
<label>Most Viewed</label>
<sort_order>800</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Most Viewed Products Report</comment>
</viewed_expr>
</fields>
</crontab>
</groups>
</reports>
</sections>
Expand Down
19 changes: 14 additions & 5 deletions app/code/core/Mage/Sales/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,15 @@
<dashboard>
<use_aggregated_data>0</use_aggregated_data>
</dashboard>
<reports>
<crontab>
<sales_expr>0 0 * * *</sales_expr>
<shipping_expr>0 0 * * *</shipping_expr>
<invoiced_expr>0 0 * * *</invoiced_expr>
<refunded_expr>0 0 * * *</refunded_expr>
<bestsellers_expr>0 0 * * *</bestsellers_expr>
</crontab>
</reports>
</default>
<crontab>
<jobs>
Expand All @@ -1729,39 +1738,39 @@
</sales_clean_quotes>
<aggregate_sales_report_order_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/sales_expr</config_path>
</schedule>
<run>
<model>sales/observer::aggregateSalesReportOrderData</model>
</run>
</aggregate_sales_report_order_data>
<aggregate_sales_report_shipment_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/shipping_expr</config_path>
</schedule>
<run>
<model>sales/observer::aggregateSalesReportShipmentData</model>
</run>
</aggregate_sales_report_shipment_data>
<aggregate_sales_report_invoiced_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/invoiced_expr</config_path>
</schedule>
<run>
<model>sales/observer::aggregateSalesReportInvoicedData</model>
</run>
</aggregate_sales_report_invoiced_data>
<aggregate_sales_report_refunded_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/refunded_expr</config_path>
</schedule>
<run>
<model>sales/observer::aggregateSalesReportRefundedData</model>
</run>
</aggregate_sales_report_refunded_data>
<aggregate_sales_report_bestsellers_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/bestsellers_expr</config_path>
</schedule>
<run>
<model>sales/observer::aggregateSalesReportBestsellersData</model>
Expand Down
53 changes: 53 additions & 0 deletions app/code/core/Mage/Sales/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -825,5 +825,58 @@
</creditmemo>
</groups>
</sales_pdf>
<reports>
<groups>
<crontab>
<fields>
<sales_expr translate="label comment">
<label>Orders</label>
<frontend_type>text</frontend_type>
<sort_order>100</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Total Ordered Report</comment>
</sales_expr>
<shipping_expr translate="label comment">
<label>Shipping</label>
<frontend_type>text</frontend_type>
<sort_order>300</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Total Shipped Report</comment>
</shipping_expr>
<invoiced_expr translate="label comment">
<label>Total Invoiced</label>
<frontend_type>text</frontend_type>
<sort_order>400</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Total Invoiced VS Paid Report</comment>
</invoiced_expr>
<refunded_expr translate="label comment">
<label>Total Refunded</label>
<frontend_type>text</frontend_type>
<sort_order>500</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Total Refunded Report</comment>
</refunded_expr>
<bestsellers_expr translate="label comment">
<label>Bestsellers</label>
<frontend_type>text</frontend_type>
<sort_order>700</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Products Bestsellers Report</comment>
</bestsellers_expr>
</fields>
</crontab>
</groups>
</reports>
</sections>
</config>
7 changes: 6 additions & 1 deletion app/code/core/Mage/SalesRule/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<jobs>
<aggregate_sales_report_coupons_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/coupons_expr</config_path>
</schedule>
<run>
<model>salesrule/observer::aggregateSalesReportCouponsData</model>
Expand All @@ -224,5 +224,10 @@
<format>1</format>
</auto_generated_coupon_codes>
</promo>
<reports>
<crontab>
<coupons_expr>0 0 * * *</coupons_expr>
</crontab>
</reports>
</default>
</config>
17 changes: 17 additions & 0 deletions app/code/core/Mage/SalesRule/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,22 @@
</auto_generated_coupon_codes>
</groups>
</promo>
<reports>
<groups>
<crontab>
<fields>
<coupons_expr translate="label comment">
<label>Coupons</label>
<frontend_type>text</frontend_type>
<sort_order>600</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Promotion Coupons Usage Report</comment>
</coupons_expr>
</fields>
</crontab>
</groups>
</reports>
</sections>
</config>
7 changes: 6 additions & 1 deletion app/code/core/Mage/Tax/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,17 @@
<url>https://web.archive.org/web/20150315064836/https://www.magentocommerce.com/knowledge-base/entry/magento-ce-18-ee-113-tax-calc</url>
</notification>
</tax>
<reports>
<crontab>
<tax_expr>0 0 * * *</tax_expr>
</crontab>
</reports>
</default>
<crontab>
<jobs>
<aggregate_sales_report_tax_data>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
<config_path>reports/crontab/tax_expr</config_path>
</schedule>
<run>
<model>tax/observer::aggregateSalesReportTaxData</model>
Expand Down
21 changes: 19 additions & 2 deletions app/code/core/Mage/Tax/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</full_summary>
<zero_tax translate="label">
<zero_tax translate="label">
<label>Display Zero Tax Subtotal</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
Expand Down Expand Up @@ -342,7 +342,7 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</full_summary>
<zero_tax translate="label">
<zero_tax translate="label">
<label>Display Zero Tax Subtotal</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
Expand All @@ -355,5 +355,22 @@
</sales_display>
</groups>
</tax>
<reports>
<groups>
<crontab>
<fields>
<tax_expr translate="label comment">
<label>Tax</label>
<frontend_type>text</frontend_type>
<sort_order>200</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Order Taxes Report Grouped by Tax Rates</comment>
</tax_expr>
</fields>
</crontab>
</groups>
</reports>
</sections>
</config>