I want to implement a Sugar Logic Hook that fires when invoice status change to 'Validated'.
This my logic hook :
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['after_save'] = Array();
$hook_array['after_save'][] = Array(1, 'status invoices Changes', '/var/www/html/suitecrm/modules/AOS_Invoices/AOS_LogicHooks.php','AOS_LogicHooks', 'statusInvoicesChanges');
?>
This is my action class:
<?php class AOS_LogicHooks {
public function statusInvoicesChanges (SugarBean $bean, $event, $arguments){
if($bean->status == 'Validated' && $bean->fetched_row->status <> $bean->status){
$GLOBALS['log']->fatal("Status has been changed");
}}}
?>
What do I missing?