我正在尝试从为所选机会返回的行中获取总数。
选择机会时,他们购买的每个产品并列出了价格。我正在尝试使用每个购买产品的价格来获得利用该机会进行的所有销售的小计。
这是我的代码:
function total(&$focus, $event, $arguments)
{
$total = 0;
foreach ($this->bean->Product_Sales['sales_price_c'] as $entry) {
$total += unformat_number($entry['sales_price_c']);
}
$this->bean->ss->assign('total_sales_c', format_number($total));
}
如何返回行的示例:
[Product_Name_Field] [Product_Price_Field] [Sales_Person_Field] [Etc_Field]
每个退回的行仅售出 qty(1) 个产品。
我究竟做错了什么?
提前致谢。