Updated Login to use lnapp, and minor update to Invoice
This commit is contained in:
@@ -170,6 +170,9 @@ class Model_Invoice_Item extends ORM {
|
||||
if (! $this->isValid())
|
||||
return sprintf('Record Error [%s-%s]',$this->item_type,$this->id);
|
||||
|
||||
if (is_null($variable) OR ! $variable instanceof Model_Language)
|
||||
$variable = Site::language();
|
||||
|
||||
switch ($this->item_type) {
|
||||
case 0:
|
||||
case 2:
|
||||
@@ -278,6 +281,25 @@ class Model_Invoice_Item extends ORM {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function title(Model_Language $lo) {
|
||||
if (! $this->isValid())
|
||||
return 'Record Error';
|
||||
|
||||
switch ($this->item_type) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
return $this->product->name($lo);
|
||||
case 5:
|
||||
return $this->_module()->name($lo);
|
||||
case 124:
|
||||
return StaticList_ItemType::get($this->item_type);
|
||||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
public function total($format=FALSE) {
|
||||
$result = $this->void ? 0 : $this->subtotal()+$this->tax()-$this->discount();
|
||||
|
||||
|
Reference in New Issue
Block a user