Changes in invoice view screen and pdf
This commit is contained in:
parent
faffc82cf7
commit
32c90deb60
@ -169,6 +169,8 @@ class Invoices extends Admin_Controller
|
|||||||
echo $ClientID; */
|
echo $ClientID; */
|
||||||
$PaymentDays = $this->mdl_invoices->GetPaymentDays($invoice_id,$ClientID,'51');
|
$PaymentDays = $this->mdl_invoices->GetPaymentDays($invoice_id,$ClientID,'51');
|
||||||
$GetSecondaryAddress = $this->mdl_invoices->GetSecondaryAddress($ClientID);
|
$GetSecondaryAddress = $this->mdl_invoices->GetSecondaryAddress($ClientID);
|
||||||
|
|
||||||
|
$getSecondayAddressSelected = $this->mdl_invoices->getSecondayAddressSelected($invoice_id,'44');
|
||||||
// print_r($GetSecondaryAddress);
|
// print_r($GetSecondaryAddress);
|
||||||
|
|
||||||
$custom_fields = $this->mdl_custom_fields->by_table('ip_invoice_custom')->get()->result();
|
$custom_fields = $this->mdl_custom_fields->by_table('ip_invoice_custom')->get()->result();
|
||||||
@ -184,10 +186,22 @@ class Invoices extends Admin_Controller
|
|||||||
foreach ($fields as $fvalue) {
|
foreach ($fields as $fvalue) {
|
||||||
if ($fvalue->invoice_custom_fieldid == $cfield->custom_field_id) {
|
if ($fvalue->invoice_custom_fieldid == $cfield->custom_field_id) {
|
||||||
// TODO: Hackish, may need a better optimization
|
// TODO: Hackish, may need a better optimization
|
||||||
|
//echo $fvalue->invoice_custom_fieldid ;
|
||||||
|
if ($fvalue->invoice_custom_fieldid == "7" && $fvalue->invoice_custom_fieldvalue == '')
|
||||||
|
{
|
||||||
|
echo 'Mode'. $fvalue->invoice_custom_fieldvalue;
|
||||||
|
$this->mdl_invoices->set_form_value(
|
||||||
|
'custom[' . $cfield->custom_field_id . ']',
|
||||||
|
'By Road'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$this->mdl_invoices->set_form_value(
|
$this->mdl_invoices->set_form_value(
|
||||||
'custom[' . $cfield->custom_field_id . ']',
|
'custom[' . $cfield->custom_field_id . ']',
|
||||||
$fvalue->invoice_custom_fieldvalue
|
$fvalue->invoice_custom_fieldvalue
|
||||||
);
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,6 +212,7 @@ class Invoices extends Admin_Controller
|
|||||||
'invoice' => $invoice,
|
'invoice' => $invoice,
|
||||||
'Duedate' =>$PaymentDays,
|
'Duedate' =>$PaymentDays,
|
||||||
'GetSecondary' =>$GetSecondaryAddress,
|
'GetSecondary' =>$GetSecondaryAddress,
|
||||||
|
'getSecondaySelected' => $getSecondayAddressSelected,
|
||||||
'items' => $this->mdl_items->where('invoice_id', $invoice_id)->get()->result(),
|
'items' => $this->mdl_items->where('invoice_id', $invoice_id)->get()->result(),
|
||||||
'invoice_id' => $invoice_id,
|
'invoice_id' => $invoice_id,
|
||||||
'tax_rates' => $this->mdl_tax_rates->get()->result(),
|
'tax_rates' => $this->mdl_tax_rates->get()->result(),
|
||||||
@ -368,4 +383,4 @@ class Invoices extends Admin_Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -62,13 +62,23 @@ class Mdl_Invoices extends Response_Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
$subQuery = "select group_concat(client_custom_fieldvalue separator '<br>') as Secondary from ip_client_custom where
|
$subQuery = "select group_concat(client_custom_fieldvalue separator '<br>') as Secondary from ip_client_custom where
|
||||||
client_id =? and client_custom_fieldid in (12,45,46,47)";
|
client_id =? and client_custom_fieldid in (12,45,46,47,48,50,49)";
|
||||||
|
|
||||||
$query = $this->db->query($subQuery,array($ClientID));
|
$query = $this->db->query($subQuery,array($ClientID));
|
||||||
|
|
||||||
return $query->result();
|
return $query->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSecondayAddressSelected($InvID,$client_custom_fieldid)
|
||||||
|
{
|
||||||
|
$subQuery = "select invoice_custom_fieldvalue as secondary from ip_invoice_custom where invoice_id=? and
|
||||||
|
invoice_custom_fieldid=?";
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery,array($InvID,$client_custom_fieldid));
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
public function default_select()
|
public function default_select()
|
||||||
{
|
{
|
||||||
@ -561,4 +571,4 @@ class Mdl_Invoices extends Response_Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user