mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:07:32 -05:00 
			
		
		
		
	Merged minor fixes
This commit is contained in:
		
							parent
							
								
									536b21595d
								
							
						
					
					
						commit
						dade97fbfa
					
				@ -124,25 +124,23 @@ class AccountRepository
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        $client = $this->getNinjaClient(Auth::user()->account);
 | 
			
		||||
        $invitation = $this->createNinjaInvoice($client);
 | 
			
		||||
 | 
			
		||||
        $account = Auth::user()->account;
 | 
			
		||||
        $client = $this->getNinjaClient($account);
 | 
			
		||||
        $invitation = $this->createNinjaInvoice($client, $account);
 | 
			
		||||
        return $invitation;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function createNinjaInvoice($client)
 | 
			
		||||
    public function createNinjaInvoice($client, $clientAccount)
 | 
			
		||||
    {
 | 
			
		||||
        $account = $this->getNinjaAccount();
 | 
			
		||||
        $lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first();
 | 
			
		||||
        $publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
 | 
			
		||||
 | 
			
		||||
        $invoice = new Invoice();
 | 
			
		||||
        $invoice->account_id = $account->id;
 | 
			
		||||
        $invoice->user_id = $account->users()->first()->id;
 | 
			
		||||
        $invoice->public_id = $publicId;
 | 
			
		||||
        $invoice->client_id = $client->id;
 | 
			
		||||
        $invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
 | 
			
		||||
        $invoice->invoice_date = Auth::user()->account->getRenewalDate();
 | 
			
		||||
        $invoice->invoice_date = $clientAccount->getRenewalDate();
 | 
			
		||||
        $invoice->amount = PRO_PLAN_PRICE;
 | 
			
		||||
        $invoice->balance = PRO_PLAN_PRICE;
 | 
			
		||||
        $invoice->save();
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
<?php namespace app\Services;
 | 
			
		||||
<?php namespace App\Services;
 | 
			
		||||
 | 
			
		||||
use stdClass;
 | 
			
		||||
use Excel;
 | 
			
		||||
 | 
			
		||||
@ -269,6 +269,7 @@
 | 
			
		||||
            processData: false,
 | 
			
		||||
            contentType: 'application/json; charset=utf-8',
 | 
			
		||||
            success: function (result) {
 | 
			
		||||
                NINJA.formIsChanged = false;
 | 
			
		||||
                model.importResults(result);
 | 
			
		||||
                model.setPage('done');
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -354,7 +354,7 @@
 | 
			
		||||
 | 
			
		||||
    // Focus the search input if the user clicks forward slash
 | 
			
		||||
    $('body').keypress(function(event) {
 | 
			
		||||
        if (event.which == 47) {
 | 
			
		||||
        if (event.which == 47 && !$('*:focus').length) {
 | 
			
		||||
            event.preventDefault();
 | 
			
		||||
            showSearch();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user