Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 197-201 (lines=5) @@
194
     */
195
    function create_invoice($account, $from_date, $to_date, $last_invoice_ID, $INVprefix, $invoiceconf) {
196
        //$due_date = gmdate("Y-m-d H:i:s",strtotime($to_date." +".$invoiceconf['interval']." days"));
197
        if ($invoiceconf['interval'] > 0) {
198
            $due_date = gmdate("Y-m-d H:i:s", strtotime(gmdate("Y-m-d H:i:s")." +".$invoiceconf['interval']." days"));
199
        } else {
200
            $due_date = gmdate("Y-m-d H:i:s", strtotime(gmdate("Y-m-d H:i:s")." +7 days"));
201
        }
202
        // echo "due daye-------".$due_date.'----------'.$to_date.'------------> Invoice interval'.$invoiceconf['interval']; 
203
        $balance = ($account['credit_limit'] - $account['balance']);
204
        $automatic_flag = self::$global_config['system_config']['automatic_invoice'];

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

@@ 1452-1456 (lines=5) @@
1449
		}else{
1450
	   			$balance = $accountdata['balance'];
1451
		}
1452
		if($accountdata['invoice_interval'] > 0){
1453
			$due_date = gmdate("Y-m-d H:i:s",strtotime(gmdate("Y-m-d H:i:s")." +".$accountdata['invoice_interval']." days"));
1454
		}else{
1455
			$due_date = gmdate("Y-m-d H:i:s",strtotime(gmdate("Y-m-d H:i:s")." +7 days"));
1456
		}	
1457
		$invoice_data = array("accountid"=>$accountdata['id'],"invoice_prefix" =>$invoice_conf['invoice_prefix'],"invoiceid"=>$last_invoice_ID,"reseller_id"=>   
1458
		$accountdata['reseller_id'],"invoice_date"=>gmdate("Y-m-d H:i:s"),"from_date"=>$from_date,"to_date"=>$todate,"due_date"=>$due_date,"status"=>1,"amount"=>"0.00","balance"=>$balance,'generate_type'=>1,'confirm'=>0,'notes'=>$data['notes']);
1459
		// echo "<pre>"; print_r($invoice_data); exit;