|
@@ 828-831 (lines=4) @@
|
| 825 |
|
$currency =$currency[0]; |
| 826 |
|
$date = date('Y-m-d H:i:s'); |
| 827 |
|
$invoice_total_query = $this->db_model->getSelect("*", "invoices", array("id"=> $invoice_id)); |
| 828 |
|
if ( $invoice_total_query ->num_rows() > 0) { |
| 829 |
|
$invoice_total_query= $invoice_total_query->result_array(); |
| 830 |
|
$debit=$invoice_total_query[0]['amount']; |
| 831 |
|
} |
| 832 |
|
$query="select sum(credit) as credit from invoice_details where invoiceid = ".$invoice_id." AND item_type !='PAYMENT' Group By invoiceid"; |
| 833 |
|
//echo $query; exit; |
| 834 |
|
$invoice_total_query=$this->db->query($query); |
|
@@ 949-952 (lines=4) @@
|
| 946 |
|
$date = date('Y-m-d H:i:s'); |
| 947 |
|
|
| 948 |
|
$invoice_total_query = $this->db_model->getSelect("*", "invoices", array("id"=> $invoice_id)); |
| 949 |
|
if ( $invoice_total_query ->num_rows() > 0) { |
| 950 |
|
$invoice_total_query= $invoice_total_query->result_array(); |
| 951 |
|
$debit=$invoice_total_query[0]['amount']; |
| 952 |
|
} |
| 953 |
|
|
| 954 |
|
$query="select sum(credit) as credit from invoice_details where invoiceid = ".$invoice_id." AND item_type !='PAYMENT' Group By invoiceid"; |
| 955 |
|
//echo $query; exit; |