您好我正在尝试在我的Magento PDF发票上添加总付费和总预付款。我在sales / etc / config.xml中的配置文件中添加了这些行。
onNext
这为我提供了PDF发票中我需要的行,但值为0.这些值在数据库表sales_flat_order中,但它在sales_flat_invoice中查找它们。我还在sales_flat_invoice中创建了一个mysql列,并手动输入一个数字,它显示在发票上,所以我知道这样可行。我的问题是如何从配置文件中的另一个表调用列,或者如何将总付费和总到期值输入到我的数据库中的两个新列中?
这是订单页面中块的代码,显示总到期和总付款。
<pdf>
<invoice>
<default>sales/order_pdf_items_invoice_default</default>
<grouped>sales/order_pdf_items_invoice_grouped</grouped>
</invoice>
<shipment>
<default>sales/order_pdf_items_shipment_default</default>
</shipment>
<creditmemo>
<default>sales/order_pdf_items_creditmemo_default</default>
<grouped>sales/order_pdf_items_creditmemo_grouped</grouped>
</creditmemo>
<totals>
<subtotal translate="title">
<title>Subtotal</title>
<source_field>subtotal</source_field>
<font_size>7</font_size>
<display_zero>1</display_zero>
<sort_order>100</sort_order>
</subtotal>
<discount translate="title">
<title>Discount</title>
<source_field>discount_amount</source_field>
<amount_prefix></amount_prefix>
<title_source_field>discount_description</title_source_field>
<font_size>7</font_size>
<display_zero>0</display_zero>
<sort_order>200</sort_order>
</discount>
<shipping translate="title">
<title>Shipping</title>
<source_field>shipping_amount</source_field>
<font_size>7</font_size>
<display_zero>0</display_zero>
<sort_order>400</sort_order>
</shipping>
<adjustment_positive translate="title">
<title>Adjustment Refund</title>
<source_field>adjustment_positive</source_field>
<font_size>7</font_size>
<display_zero>0</display_zero>
<sort_order>500</sort_order>
</adjustment_positive>
<adjustment_negative translate="title">
<title>Adjustment Fee</title>
<source_field>adjustment_negative</source_field>
<font_size>7</font_size>
<display_zero>0</display_zero>
<sort_order>600</sort_order>
</adjustment_negative>
<grand_total translate="title">
<title>Grand Total</title>
<source_field>grand_total</source_field>
<font_size>8</font_size>
<display_zero>0</display_zero>
<sort_order>700</sort_order>
</grand_total>
<base_total_due translate="title">
<title>Total Due</title>
<source_field>base_total_due</source_field>
<font_size>8</font_size>
<display_zero>1</display_zero>
<sort_order>800</sort_order>
</base_total_due>
<total_paid translate="title">
<title>Total Paid</title>
<source_field>total_paid</source_field>
<font_size>8</font_size>
<display_zero>1</display_zero>
<sort_order>900</sort_order>
</total_paid>
</totals>
</pdf>
非常感谢任何帮助!