xml 订单报告包含动态标题(产品代码)。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml 订单报告包含动态标题(产品代码)。相关的知识,希望对你有一定的参考价值。

<mvt:assign name="l.comma" value="asciichar('44')" />
<mvt:assign name="l.linebreak" value="asciichar('10')" />

<mvt:foreach iterator="order" array="admin_order:orders">
	<mvt:foreach iterator="group" array="order:groups">
		<mvt:comment> <!-- Build Dynamic Array --> </mvt:comment>
			<mvt:if expr="miva_array_search( l.settings:products, 0, l.item, 'l.item:code EQ l.settings:group:code' )">
				<mvt:assign name="l.item:quantity" value="l.item:quantity + l.settings:group:quantity" />
				<mvt:assign name="l.item:subtotal" value="l.item:subtotal + l.settings:group:subtotal" />
			<mvt:else>
				<mvt:assign name="l.temp" value="NULL" />
				<mvt:assign name="l.temp:code" value="l.settings:group:code" />
				<mvt:assign name="l.temp:name" value="l.settings:group:name" />
				<mvt:assign name="l.temp:subtotal" value="l.settings:group:subtotal" />
				<mvt:assign name="l.temp:quantity" value="l.settings:group:quantity" />
				<mvt:assign name="l.success" value="miva_array_insert( l.settings:products, l.temp, -1 )" />
			</mvt:if>
		 <mvt:comment> <!-- Build Dynamic Array --> </mvt:comment>
	</mvt:foreach>
</mvt:foreach>

<mvt:foreach iterator="order" array="admin_order:orders">
	<mvt:assign name="l.row" value="l.row $ '<tr>' $ '<td>' $ l.settings:order:date $ '</td>' $ '<td>' $ l.settings:order:id $ '</td>'" />
	<mvt:comment><mvt:assign name="l.row" value="l.row $ l.settings:order:date $ l.comma $ l.settings:order:id" /></mvt:comment>
	<mvt:foreach iterator="product" array="products">
		<mvt:if expr="miva_array_search( l.settings:order:groups, 0, l.group, 'l.group:code EQ l.settings:product:code' )">
<mvt:comment>			<mvt:do file="g.Module_Store_Module_Currency" name="l.settings:product:formatted_subtotal" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:product:subtotal )" /></mvt:comment>
			<mvt:comment><mvt:assign name="l.row" value="l.row $ l.comma $ l.settings:group:subtotal" /></mvt:comment>
			<mvt:assign name="l.row" value="l.row $ '<td align=\"right\">' $ l.group:subtotal $ '</td>'" />
		<mvt:else>
			<mvt:comment><mvt:assign name="l.row" value="l.row $ l.comma $ '\' '" /></mvt:comment>
			<mvt:assign name="l.row" value="l.row $ '<td align=\"right\">$0.00</td>'" />
		</mvt:if>
	</mvt:foreach>
	<mvt:comment><mvt:assign name="l.row" value="l.row $ l.linebreak" /></mvt:comment>
	<mvt:assign name="l.row" value="l.row $ '</tr>'" />
</mvt:foreach>

<mvt:assign name="l.header" value="'<tr><td>Order Date</td><td>Order</td>'" />
<mvt:foreach iterator="item" array="products">
	<mvt:comment><mvt:assign name="l.header" value="l.header $ l.comma $ l.item:name" /></mvt:comment>
	<mvt:assign name="l.header" value="l.header $ '<td>' $ l.settings:item:code $ '</td>'" />
	<mvt:assign name="l.total_units" value="l.total_units $ '<td align=\"right\">' $ l.settings:item:quantity $ '</td>'" />
	<mvt:assign name="l.total_dollars" value="l.total_dollars $ '<td align=\"right\">' $ l.settings:item:subtotal $ '</td>'" />
</mvt:foreach>
<table cellpadding="5" cellspacing="2" border="1">
	<mvt:eval expr="l.header $ '</tr>' $ l.row" />
	<tr>
		<td colspan="2">Total Units</td>
		<mvt:eval expr="l.total_units" />
	</tr>
	<tr>
		<td colspan="2">Total Dollar Amounts</td>
		<mvt:eval expr="l.total_dollars" />
	</tr>
</table>

以上是关于xml 订单报告包含动态标题(产品代码)。的主要内容,如果未能解决你的问题,请参考以下文章

xml 订单报告包含动态标题(产品代码)。

为 Apex 中的表单变量赋予动态值

拆分数据库的技巧

如何在 Laravel 中打印出包含多个产品的所有订单?

报告!钉钉宜搭的8月总结,请查收~

xml Miva - 货件领料报告|总产品收入报告|汇总产品信息