Code Duplication    Length = 5-5 lines in 2 locations

web_interface/astpp/application/controllers/generateInvoice.php 1 location

@@ 131-135 (lines=5) @@
128
        $invoice_conf = (array)$invoice_conf->first_row();
129
        /*******************************************************/
130
        $last_invoice_ID = $this->common->get_invoice_date("invoiceid", "", $accountdata['reseller_id']);
131
        if ($last_invoice_ID && $last_invoice_ID > 0) {
132
            $last_invoice_ID = ($last_invoice_ID + 1);
133
        } else {
134
            $last_invoice_ID = $invoice_conf['invoice_start_from'];
135
        }
136
        $last_invoice_ID = str_pad($last_invoice_ID, (strlen($last_invoice_ID) + 4), '0', STR_PAD_LEFT);
137
        $invoice_sub_total = $this->count_invoice_data($accountdata, $start_date, $end_date);
138
        if ($invoice_sub_total > 0) {

web_interface/astpp/application/modules/invoices/controllers/invoices.php 1 location

@@ 1441-1445 (lines=5) @@
1438
			$invoice_conf = $invoice_conf[0];            
1439
		}
1440
		$last_invoice_ID = $this->get_invoice_date("invoiceid");
1441
		if($last_invoice_ID && $last_invoice_ID > 0){
1442
			$last_invoice_ID = ($last_invoice_ID+1);
1443
		}else{
1444
			$last_invoice_ID = $invoice_conf['invoice_start_from'];
1445
		}
1446
		$last_invoice_ID =str_pad($last_invoice_ID,(strlen($last_invoice_ID)+4),'0',STR_PAD_LEFT);
1447
		if($accountdata['posttoexternal'] == 1){
1448
	   			$balance = ($accountdata['credit_limit']-$accountdata['balance']);