4. Create a report

Warning

You need to known SQL and XML language to create a new report.

Create a new report

Report XML

Copy and entry from the other one and add an entry in

/lib/mdn/smartreports/erp.xml

there is the field

<group>purchase</group>

The group will link this report to the group you define in the menu

ERP -> Reports -> Purchase

Group

do a report like describe upper

add/modify the group reference like this

<group>orderpreparation</group>

Controller

Edit the file

app/code/community/MDN/SmartReport/controllers/Adminhtml/SmartReport/ReportsController.php

add a function like

public function OrderPreparationAction()
{
   $this->loadLayout();
   $this->renderLayout();
}

Layout

Edit the file

app/design/adminhtml/default/default/layout/SmartReport.xml

add an entry like

<adminhtml_smartreport_reports_orderpreparation>
  <reference name="content">
   <block type="SmartReport/Report_Type" template="SmartReport/Report/Type.phtml"></block>
  </reference>
  <update handle="smartreport_common" />
</adminhtml_smartreport_reports_orderpreparation>

Adminhtml.xml

Edit the file

app/code/community/MDN/SmartReport/etc/adminhtml.xml

Between the children of the XML entry smartreport

add an entry like

<order_preparation translate="title" module="SmartReport">
 <title>Order preparation</title>
 <action>adminhtml/SmartReport_Reports/OrderPreparation</action>
 <sort_order>60</sort_order>
 <depends>
   <config>advancedstock/erp/is_installed</config>
 </depends>
</order_preparation>

The action refer to the controller you have created

the fact to add

<config>advancedstock/erp/is_installed</config>

check if there is ERP, else the report does not appear