mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:07:32 -05:00 
			
		
		
		
	Fixes for payment methods
This commit is contained in:
		
							parent
							
								
									9034e5253c
								
							
						
					
					
						commit
						1b2a5fa09a
					
				@ -1 +1 @@
 | 
				
			|||||||
5.3.60
 | 
					5.3.61
 | 
				
			||||||
@ -80,7 +80,6 @@ class BaseImport
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public function getCsvData($entity_type)
 | 
						public function getCsvData($entity_type)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		nlog("get csv data = entity name = " . $entity_type);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$base64_encoded_csv = Cache::pull($this->hash . '-' . $entity_type);
 | 
							$base64_encoded_csv = Cache::pull($this->hash . '-' . $entity_type);
 | 
				
			||||||
		if (empty($base64_encoded_csv)) {
 | 
							if (empty($base64_encoded_csv)) {
 | 
				
			||||||
 | 
				
			|||||||
@ -70,24 +70,26 @@ class PaymentMethod
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
 | 
					            $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $this->gateways = 
 | 
					            $this->gateways = $this->client
 | 
				
			||||||
                             CompanyGateway::with('gateway')
 | 
					                             ->company
 | 
				
			||||||
                             ->where('company_id', $this->client->company_id)
 | 
					                             ->company_gateways
 | 
				
			||||||
                             ->whereIn('id', $transformed_ids)
 | 
					                             ->whereIn('id', $transformed_ids)
 | 
				
			||||||
                             ->where('is_deleted', false)
 | 
					                             ->where('is_deleted', false)
 | 
				
			||||||
                             ->whereNull('deleted_at')
 | 
					                             ->whereNull('deleted_at')
 | 
				
			||||||
                             ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
 | 
					                             ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
 | 
				
			||||||
                             ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
 | 
					                             ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
 | 
				
			||||||
                                 return array_search($model->id, $transformed_ids);// this closure sorts for us
 | 
					                                 return array_search($model->id, $transformed_ids);// this closure sorts for us
 | 
				
			||||||
                             })->get();
 | 
					                             });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
             $this->gateways = CompanyGateway::with('gateway')
 | 
					             $this->gateways = $this->client
 | 
				
			||||||
                             ->where('company_id', $this->client->company_id)
 | 
					                             ->company
 | 
				
			||||||
 | 
					                             ->company_gateways
 | 
				
			||||||
                             ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
 | 
					                             ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
 | 
				
			||||||
                             ->whereNull('deleted_at')
 | 
					                             ->whereNull('deleted_at')
 | 
				
			||||||
                             ->where('is_deleted', false)->get();
 | 
					                             ->where('is_deleted', false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
@ -105,23 +107,25 @@ class PaymentMethod
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
 | 
					            $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $this->gateways = CompanyGateway::with('gateway')
 | 
					            $this->gateways = $this->client
 | 
				
			||||||
                             ->where('company_id', $this->client->company_id)
 | 
					                             ->company
 | 
				
			||||||
 | 
					                             ->company_gateways
 | 
				
			||||||
                             ->whereIn('id', $transformed_ids)
 | 
					                             ->whereIn('id', $transformed_ids)
 | 
				
			||||||
                             ->where('is_deleted', false)
 | 
					                             ->where('is_deleted', false)
 | 
				
			||||||
                             ->whereNull('deleted_at')
 | 
					                             ->whereNull('deleted_at')
 | 
				
			||||||
                             ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
 | 
					                             ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
 | 
				
			||||||
                             ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
 | 
					                             ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
 | 
				
			||||||
                                 return array_search($model->id, $transformed_ids);// this closure sorts for us
 | 
					                                 return array_search($model->id, $transformed_ids);// this closure sorts for us
 | 
				
			||||||
                             })->get();
 | 
					                             });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
             $this->gateways = CompanyGateway::with('gateway')
 | 
					             $this->gateways = $this->client
 | 
				
			||||||
                             ->where('company_id', $this->client->company_id)
 | 
					                             ->company
 | 
				
			||||||
 | 
					                             ->company_gateways
 | 
				
			||||||
                             ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
 | 
					                             ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
 | 
				
			||||||
                             ->whereNull('deleted_at')
 | 
					                             ->whereNull('deleted_at')
 | 
				
			||||||
                             ->where('is_deleted', false)->get();
 | 
					                             ->where('is_deleted', false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
				
			|||||||
@ -200,10 +200,13 @@ class Number
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /* 08-01-2022 allow increased precision for unit price*/
 | 
					        /* 08-01-2022 allow increased precision for unit price*/
 | 
				
			||||||
        $v = rtrim(sprintf('%f', $value),"0");
 | 
					        $v = rtrim(sprintf('%f', $value),"0");
 | 
				
			||||||
        // $precision = strlen(substr(strrchr($v, $decimal), 1));
 | 
					        $precision = strlen(substr(strrchr($v, $decimal), 1));
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if($v<1)
 | 
					        // if($v<1)
 | 
				
			||||||
            $precision = strlen($v) - strrpos($v, '.') - 1;
 | 
					        //     $precision = strlen($v) - strrpos($v, '.') - 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if($precision == 1)
 | 
				
			||||||
 | 
					            $precision = 2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $value = number_format($v, $precision, $decimal, $thousand);
 | 
					        $value = number_format($v, $precision, $decimal, $thousand);
 | 
				
			||||||
        $symbol = $currency->symbol;
 | 
					        $symbol = $currency->symbol;
 | 
				
			||||||
 | 
				
			|||||||
@ -14,8 +14,8 @@ return [
 | 
				
			|||||||
    'require_https' => env('REQUIRE_HTTPS', true),
 | 
					    'require_https' => env('REQUIRE_HTTPS', true),
 | 
				
			||||||
    'app_url' => rtrim(env('APP_URL', ''), '/'),
 | 
					    'app_url' => rtrim(env('APP_URL', ''), '/'),
 | 
				
			||||||
    'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
 | 
					    'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
 | 
				
			||||||
    'app_version' => '5.3.60',
 | 
					    'app_version' => '5.3.61',
 | 
				
			||||||
    'app_tag' => '5.3.60',
 | 
					    'app_tag' => '5.3.61',
 | 
				
			||||||
    'minimum_client_version' => '5.0.16',
 | 
					    'minimum_client_version' => '5.0.16',
 | 
				
			||||||
    'terms_version' => '1.0.1',
 | 
					    'terms_version' => '1.0.1',
 | 
				
			||||||
    'api_secret' => env('API_SECRET', ''),
 | 
					    'api_secret' => env('API_SECRET', ''),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user