Revamping invoice PDF rendering and standardisation work

This commit is contained in:
Deon George
2016-08-10 16:07:00 +10:00
parent a560c5f4fa
commit 24bb4a701b
27 changed files with 229 additions and 475 deletions

View File

@@ -34,17 +34,20 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
protected $_save_message = TRUE;
// Required abstract functions
/** REQUIRED ABSTRACT METHODS **/
public function attributes($variable=NULL) {
return array(
'Service Address'=>$this->service_address ? $this->display('service_address') : 'UNKNOWN',
'Contract Until'=>$this->contract_date_end(TRUE),
);
}
public function expire() {
// We'll leave it to the Service record to determine when this service expires
return NULL;
}
public function name($variable=NULL) {
return $this->service_number;
}
public function password() {
return $this->service_password;
}
@@ -53,7 +56,7 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
return $this->service_username;
}
// Local functions
/** LOCAL METHODS **/
/**
* If we override the plan that the customers gets (from what the supplier provides).
@@ -200,6 +203,14 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
return $this->ipaddress ? $this->ipaddress : _('Dynamic');
}
public function name($variable=NULL) {
return $this->service_number;
}
public function namesub($variable=NULL) {
return $this->display('service_address');
}
/**
* If we override the plan that the customers gets (from what the supplier provides).
* @todo This needs to get the plan that was invoiced, not the current plan..
@@ -453,25 +464,5 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
return parent::list_autocomplete($term,$index,$value,$label,$limit,$options);
}
/**
* Get specific service details for use in other modules
* For Example: Invoice
*
* @todo Make the rendered items configurable
* @todo Change this method name, now that it is public
*/
public function _details($type) {
switch ($type) {
case 'invoice_detail_items':
return array(
_('Service Address')=>$this->service_address ? $this->display('service_address') : '>NotSet<',
_('Contract Until')=>$this->contract_date_end(TRUE),
);
break;
default:
return parent::$_details($type);
}
}
}
?>

View File

@@ -1,12 +0,0 @@
<!-- //@todo To translate -->
<table class="box-full">
<tr>
<td style="width: 60%;">Contract Term</td>
<td class="head" colspan="2"><?php echo $record->display('contract_term'); ?></td>
</tr>
<tr>
<!-- @todo This should get tax settings from the session -->
<td>Minimum Cost</td>
<td class="head" colspan="2"><?php echo Currency::display(Tax::add($record->contract_term*$price_base+$price_setup)); ?> <span style="font-size: 80%; font-weight:normal;"><?php printf('(%s * %s + %s)',$record->contract_term,Tax::add($price_base),Tax::add($price_setup)); ?></span></td>
</tr>
</table>