mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-02 22:57:33 -05:00 
			
		
		
		
	Projects
This commit is contained in:
		
							parent
							
								
									218cf81922
								
							
						
					
					
						commit
						bb8bee0304
					
				@ -19,6 +19,7 @@ use App\Models\Document;
 | 
				
			|||||||
use App\Models\Expense;
 | 
					use App\Models\Expense;
 | 
				
			||||||
use App\Models\Invoice;
 | 
					use App\Models\Invoice;
 | 
				
			||||||
use App\Models\Payment;
 | 
					use App\Models\Payment;
 | 
				
			||||||
 | 
					use App\Models\Project;
 | 
				
			||||||
use App\Utils\Traits\WithSorting;
 | 
					use App\Utils\Traits\WithSorting;
 | 
				
			||||||
use Livewire\Component;
 | 
					use Livewire\Component;
 | 
				
			||||||
use Livewire\WithPagination;
 | 
					use Livewire\WithPagination;
 | 
				
			||||||
@ -78,6 +79,10 @@ class DocumentsTable extends Component
 | 
				
			|||||||
                $this->query = $this->payments();
 | 
					                $this->query = $this->payments();
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            case 'projects':
 | 
				
			||||||
 | 
					                $this->query = $this->projects();
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
                $this->query = $this->documents();
 | 
					                $this->query = $this->documents();
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
@ -120,4 +125,12 @@ class DocumentsTable extends Component
 | 
				
			|||||||
                $query->where('client_id', $this->client->id);
 | 
					                $query->where('client_id', $this->client->id);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected function projects()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return Document::query()
 | 
				
			||||||
 | 
					            ->whereHasMorph('documentable', [Project::class], function ($query) {
 | 
				
			||||||
 | 
					                $query->where('client_id', $this->client->id);
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -29,6 +29,12 @@
 | 
				
			|||||||
            wire:click="updateResources('payments')" />
 | 
					            wire:click="updateResources('payments')" />
 | 
				
			||||||
                {{ ctrans('texts.payments') }}
 | 
					                {{ ctrans('texts.payments') }}
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <button 
 | 
				
			||||||
 | 
					            class="button border border-transparent hover:border-gray-600 {{ $tab === 'projects' ? 'border-gray-600' : '' }}"ž
 | 
				
			||||||
 | 
					            wire:click="updateResources('projects')" />
 | 
				
			||||||
 | 
					                {{ ctrans('texts.projects') }}
 | 
				
			||||||
 | 
					        </button>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <div class="flex items-center justify-between mt-6">
 | 
					    <div class="flex items-center justify-between mt-6">
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user