function __construct($tablename = 'pltransactions') { // Register non-persistent attributes // Contruct the object parent::__construct($tablename); // Set specific characteristics // Define relationships $this->belongsTo('PLSupplier', 'plmaster_id', 'supplier'); // Define field formats // Define system defaults // Define enumerated types $this->setEnum('transaction_type', array('I' => 'Invoice', 'C' => 'Credit Note', 'J' => 'Journal', 'P' => 'Payment', 'RP' => 'Refund Payment', 'SD' => 'Settlement Discount')); }
function __construct($tablename = 'sltransactions') { // Register non-persistent attributes // Contruct the object parent::__construct($tablename); // Set specific characteristics // Define relationships $this->belongsTo('SLCustomer', 'slmaster_id', 'customer'); $this->belongsTo('Person', 'person_id', 'person', null, "surname || ', ' || firstname"); // Define field formats // set formatters, more set in load() function // Define enumerated types $this->setEnum('transaction_type', array('I' => 'Invoice', 'C' => 'Credit Note', 'J' => 'Journal', 'R' => 'Reciept', 'RR' => 'Refund Reciept', 'SD' => 'Settlement Discount')); // Do not allow links to the following }
function __construct($tablename = 'eltransactions') { // Register non-persistent attributes // Contruct the object parent::__construct($tablename); // Set specific characteristics $this->idField = 'id'; $this->orderby = 'transaction_date'; $this->orderdir = 'DESC'; // Define relationships $this->belongsTo('Employee', 'employee_id', 'supplier'); $this->belongsTo('Currency', 'currency_id', 'currency'); $this->belongsTo('Currency', 'twin_currency_id', 'twin'); // Define field formats // set formatters, more set in load() function // Define enumerated types $this->setEnum('transaction_type', array('E' => 'Expense', 'C' => 'Expense Credit', 'J' => 'Journal', 'P' => 'Payment')); $this->setEnum('status', array('N' => 'New', 'O' => 'Open', 'Q' => 'Query', 'P' => 'Paid')); // Define default values // Define field formatting // Define link rules for related items }