我已在自定義模塊上創建計算字段。所以基本上,這個模塊總計了每個銷售所做的所有發票總計。計算字段是分配給用戶的所有發票的總和。我已經對細節視圖及其工作進行了計算。現在,我想在計算器上顯示計算的字段。這裏是我的截圖:在SuiteCRM Dashlet上顯示計算字段
正如你可以看到,目前的銷售欄爲空白。它應該填寫顯示銷售名稱的發票總額的整數值。我已經使用suitecrm studio &模塊構建器創建了模塊,字段和佈局。我如何在計算器上顯示計算的字段?
這裏是顯示詳細信息頁面上計算字段的功能和它已經工作,但是它不上dashlet或ListView工作:
public function preDisplay(){
//$this->bean contains all the information on the Case
//use that information to grab the related account bean, something like:
//date format still error here
$a = new AOS_Invoices();
$validFromFormatted = date_create_from_format('m/d/Y', $this->bean->valid_from);
$validToFormatted = date_create_from_format('m/d/Y', $this->bean->valid_through);
$arr = $a->get_full_list(null,'(aos_invoices.assigned_user_id = \''.$this->bean->user_id_c.'\' and invoice_date between \''.date_format($validFromFormatted,'Y-m-d').'\' and \''.date_format($validToFormatted,'Y-m-d').'\')');
$sum = 0;
foreach($arr as $key=>$value){
if(isset($value->total_amount))
$sum += $value->total_amount;
}
$this->bean->current_sales = $sum;
parent::preDisplay();
}