Venmo Order Batch Report#
Description#
Batch report for Venmo order reporting. In order for this batch report to work you will need to assign the http_headers
item to the template then add the following headers and values.
Header = Content-Type
Value = text/csv
Header = Content-Disposition
Value = attachment; filename=Venmo.csv
Snippet#
venmo_count,venmo_total_sales <mvt:eval expr="asciichar(13) $ asciichar(10)" />
<mvt:foreach iterator="order" array="admin_order:orders">
<mvt:foreach iterator="payment" array="order:payments">
<mvt:comment>Ignore payment record types that are not Auth or Captures</mvt:comment>
<mvt:if expr="( l.settings:payment:type EQ 2 ) OR
( l.settings:payment:type EQ 4 ) OR
( l.settings:payment:type EQ 7 )">
<mvt:foreachcontinue />
</mvt:if>
<mvt:if expr="l.settings:payment:type NE 6 AND ('Venmo' CIN l.settings:payment:descrip)">
<mvt:assign name="l.response" value="miva_array_insert( l.settings:venmo_transactions , l.settings:order:total, '-1' )" />
</mvt:if>
</mvt:foreach>
</mvt:foreach>
<mvt:assign name="g.total_sales" value="0" />
<mvt:foreach iterator="transaction" array="venmo_transactions">
<mvt:assign name="g.total_sales" value="g.total_sales + l.settings:transaction" />
</mvt:foreach>
<mvt:eval expr="miva_array_elements( l.settings:venmo_transactions )" />,&mvte:global:total_sales;
XML Pre-Provide#
<Module code="templatebatchreports" feature="util">
<BatchReport_Add>
<Type>order</Type>
<Code>venmo_report</Code>
<Name>Venmo Report</Name>
<Template>
<![CDATA[venmo_count,venmo_total_sales <mvt:eval expr="asciichar(13) $ asciichar(10)" />
<mvt:foreach iterator="order" array="admin_order:orders">
<mvt:foreach iterator="payment" array="order:payments">
<mvt:comment>Ignore payment record types that are not Auth or Captures</mvt:comment>
<mvt:if expr="( l.settings:payment:type EQ 2 ) OR
( l.settings:payment:type EQ 4 ) OR
( l.settings:payment:type EQ 7 )">
<mvt:foreachcontinue />
</mvt:if>
<mvt:if expr="l.settings:payment:type NE 6 AND ('Venmo' CIN l.settings:payment:descrip)">
<mvt:assign name="l.response" value="miva_array_insert( l.settings:venmo_transactions , l.settings:order:total, '-1' )" />
</mvt:if>
</mvt:foreach>
</mvt:foreach>
<mvt:assign name="g.total_sales" value="0" />
<mvt:foreach iterator="transaction" array="venmo_transactions">
<mvt:assign name="g.total_sales" value="g.total_sales + l.settings:transaction" />
</mvt:foreach>
<mvt:eval expr="miva_array_elements( l.settings:venmo_transactions )" />,&mvte:global:total_sales;]]>
</Template>
</BatchReport_Add>
</Module>
<PageItem_Assign pagecode="ORDER_venmo_report" itemcode="http_headers" />
<Page_Update code="ORDER_venmo_report">
<Item code="http_headers">
<DeleteAllHeaders/>
<HeaderAddList>
<Header name="Content-Type" value="text/csv"/>
<Header name="Content-Disposition" value="attachment; filename=Venmo.csv"/>
</HeaderAddList>
</Item>
</Page_Update>