Updated Login to use lnapp, and minor update to Invoice

This commit is contained in:
Deon George
2016-08-17 22:30:12 +10:00
parent 07de13f678
commit c1cc6b6f69
10 changed files with 107 additions and 148 deletions

View File

@@ -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();