mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:57:32 -05:00 
			
		
		
		
	Minor fixes
This commit is contained in:
		
							parent
							
								
									665730e29e
								
							
						
					
					
						commit
						e09bbfaaea
					
				@ -137,7 +137,11 @@ class InvitationController extends Controller
 | 
			
		||||
 | 
			
		||||
        $entity_obj = 'App\Models\\'.ucfirst(Str::camel($entity)).'Invitation';
 | 
			
		||||
 | 
			
		||||
        $invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key])
 | 
			
		||||
        // $invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key])
 | 
			
		||||
        //                             ->with('contact.client')
 | 
			
		||||
        //                             ->firstOrFail();
 | 
			
		||||
 | 
			
		||||
        $invitation = $entity_obj::where('key', $invitation_key)
 | 
			
		||||
                                    ->with('contact.client')
 | 
			
		||||
                                    ->firstOrFail();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -39,6 +39,7 @@ class CreditsTable extends Component
 | 
			
		||||
            ->where('client_id', auth('contact')->user()->client->id)
 | 
			
		||||
            ->where('company_id', $this->company->id)
 | 
			
		||||
            ->where('status_id', '<>', Credit::STATUS_DRAFT)
 | 
			
		||||
            ->where('is_deleted', 0)
 | 
			
		||||
            ->where(function ($query){
 | 
			
		||||
                $query->whereDate('due_date', '<=', now())
 | 
			
		||||
                      ->orWhereNull('due_date');
 | 
			
		||||
 | 
			
		||||
@ -41,6 +41,7 @@ class PaymentsTable extends Component
 | 
			
		||||
    {
 | 
			
		||||
        $query = Payment::query()
 | 
			
		||||
            ->with('type', 'client')
 | 
			
		||||
            ->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_REFUNDED, Payment::STATUS_PARTIALLY_REFUNDED])
 | 
			
		||||
            ->where('company_id', $this->company->id)
 | 
			
		||||
            ->where('client_id', auth('contact')->user()->client->id)
 | 
			
		||||
            ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
 | 
			
		||||
 | 
			
		||||
@ -204,7 +204,10 @@ class RecurringExpense extends BaseModel
 | 
			
		||||
 | 
			
		||||
    public function nextDateByFrequency($date)
 | 
			
		||||
    {
 | 
			
		||||
        $offset = $this->client->timezone_offset();
 | 
			
		||||
        $offset = 0;
 | 
			
		||||
 | 
			
		||||
        if($this->client)
 | 
			
		||||
            $offset = $this->client->timezone_offset();
 | 
			
		||||
 | 
			
		||||
        switch ($this->frequency_id) {
 | 
			
		||||
            case RecurringInvoice::FREQUENCY_DAILY:
 | 
			
		||||
 | 
			
		||||
@ -84,7 +84,7 @@ class AutoBillInvoice extends AbstractService
 | 
			
		||||
        $gateway_token = $this->getGateway($amount);
 | 
			
		||||
 | 
			
		||||
        /* Bail out if no payment methods available */
 | 
			
		||||
        if (! $gateway_token || ! $gateway_token->gateway->driver($this->client)->token_billing){
 | 
			
		||||
        if (! $gateway_token || ! $gateway_token->gateway || ! $gateway_token->gateway->driver($this->client)->token_billing){
 | 
			
		||||
            nlog("Bailing out - no suitable gateway token found.");
 | 
			
		||||
            return $this->invoice;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user