mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 16:37:31 -04:00 
			
		
		
		
	Merge pull request #8472 from turbo124/v5-develop
Update blacklist rules
This commit is contained in:
		
						commit
						d504a51fbd
					
				| @ -12,36 +12,37 @@ | ||||
| namespace App\Console\Commands; | ||||
| 
 | ||||
| use App; | ||||
| use Exception; | ||||
| use App\Models\User; | ||||
| use App\Utils\Ninja; | ||||
| use App\Models\Quote; | ||||
| use App\Models\Client; | ||||
| use App\Models\Credit; | ||||
| use App\Models\Vendor; | ||||
| use App\Models\Account; | ||||
| use App\Models\Company; | ||||
| use App\Models\Contact; | ||||
| use App\Models\Invoice; | ||||
| use App\Models\Payment; | ||||
| use App\Models\CompanyUser; | ||||
| use Illuminate\Support\Str; | ||||
| use App\Models\CompanyToken; | ||||
| use App\Models\ClientContact; | ||||
| use App\Models\CompanyLedger; | ||||
| use App\Models\PurchaseOrder; | ||||
| use App\Models\VendorContact; | ||||
| use App\Models\BankTransaction; | ||||
| use App\Models\QuoteInvitation; | ||||
| use Illuminate\Console\Command; | ||||
| use App\Models\CreditInvitation; | ||||
| use App\Models\InvoiceInvitation; | ||||
| use App\DataMapper\ClientSettings; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Facades\Mail; | ||||
| use App\Factory\ClientContactFactory; | ||||
| use App\Factory\VendorContactFactory; | ||||
| use App\Jobs\Company\CreateCompanyToken; | ||||
| use App\Models\Account; | ||||
| use App\Models\Client; | ||||
| use App\Models\ClientContact; | ||||
| use App\Models\Company; | ||||
| use App\Models\CompanyLedger; | ||||
| use App\Models\CompanyToken; | ||||
| use App\Models\CompanyUser; | ||||
| use App\Models\Contact; | ||||
| use App\Models\Credit; | ||||
| use App\Models\CreditInvitation; | ||||
| use App\Models\Invoice; | ||||
| use App\Models\InvoiceInvitation; | ||||
| use App\Models\Payment; | ||||
| use App\Models\PurchaseOrder; | ||||
| use App\Models\Quote; | ||||
| use App\Models\QuoteInvitation; | ||||
| use App\Models\RecurringInvoiceInvitation; | ||||
| use App\Models\User; | ||||
| use App\Models\Vendor; | ||||
| use App\Models\VendorContact; | ||||
| use App\Utils\Ninja; | ||||
| use Exception; | ||||
| use Illuminate\Console\Command; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Facades\Mail; | ||||
| use Illuminate\Support\Str; | ||||
| use Symfony\Component\Console\Input\InputOption; | ||||
| 
 | ||||
| /* | ||||
| @ -81,7 +82,7 @@ class CheckData extends Command | ||||
|     /** | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $signature = 'ninja:check-data {--database=} {--fix=} {--portal_url=} {--client_id=} {--vendor_id=} {--paid_to_date=} {--client_balance=} {--ledger_balance=} {--balance_status=}'; | ||||
|     protected $signature = 'ninja:check-data {--database=} {--fix=} {--portal_url=} {--client_id=} {--vendor_id=} {--paid_to_date=} {--client_balance=} {--ledger_balance=} {--balance_status=} {--bank_transaction=}'; | ||||
| 
 | ||||
|     /** | ||||
|      * @var string | ||||
| @ -136,6 +137,10 @@ class CheckData extends Command | ||||
|             $this->checkOAuth(); | ||||
|         } | ||||
| 
 | ||||
|         if($this->option('bank_transaction')) { | ||||
|             $this->fixBankTransactions(); | ||||
|         } | ||||
| 
 | ||||
|         $this->logMessage('Done: '.strtoupper($this->isValid ? Account::RESULT_SUCCESS : Account::RESULT_FAILURE)); | ||||
|         $this->logMessage('Total execution time in seconds: ' . (microtime(true) - $time_start)); | ||||
| 
 | ||||
| @ -1090,4 +1095,23 @@ class CheckData extends Command | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public function fixBankTransactions() | ||||
|     { | ||||
|         $this->logMessage("checking bank transactions"); | ||||
| 
 | ||||
|         BankTransaction::with('payment')->withTrashed()->where('invoice_ids', ',,,,,,,,')->cursor()->each(function ($bt){ | ||||
| 
 | ||||
|             if($bt->payment->exists()) { | ||||
| 
 | ||||
|                 $bt->invoice_ids = collect($bt->payment->invoices)->pluck('hashed_id')->implode(','); | ||||
|                 $bt->save(); | ||||
| 
 | ||||
|                 $this->logMessage("Fixing - {$bt->id}"); | ||||
|                  | ||||
|             } | ||||
| 
 | ||||
|         }); | ||||
| 
 | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -44,50 +44,6 @@ class BankTransactionController extends BaseController | ||||
|         $this->bank_transaction_repo = $bank_transaction_repo; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @OA\Get( | ||||
|      *      path="/api/v1/bank_transactions", | ||||
|      *      operationId="getBankTransactions", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Gets a list of bank_transactions", | ||||
|      *      description="Lists all bank integrations", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/index"), | ||||
|      *      @OA\Parameter( | ||||
|      *          name="rows", | ||||
|      *          in="query", | ||||
|      *          description="The number of bank integrations to return", | ||||
|      *          example="50", | ||||
|      *          required=false, | ||||
|      *          @OA\Schema( | ||||
|      *              type="number", | ||||
|      *              format="integer", | ||||
|      *          ), | ||||
|      *      ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="A list of bank integrations", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/BankTransaction"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      * @param BankTransactionFilters $filter | ||||
|      * @return Response|mixed | ||||
|      */ | ||||
|     public function index(BankTransactionFilters $filters) | ||||
|     { | ||||
|         $bank_transactions = BankTransaction::filter($filters); | ||||
| @ -95,165 +51,16 @@ class BankTransactionController extends BaseController | ||||
|         return $this->listResponse($bank_transactions); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Display the specified resource. | ||||
|      * | ||||
|      * @param ShowBankTransactionRequest $request | ||||
|      * @param BankTransaction $bank_transaction | ||||
|      * @return Response | ||||
|      * | ||||
|      * | ||||
|      * @OA\Get( | ||||
|      *      path="/api/v1/bank_transactions/{id}", | ||||
|      *      operationId="showBankTransaction", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Shows a bank_transaction", | ||||
|      *      description="Displays a bank_transaction by id", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Parameter( | ||||
|      *          name="id", | ||||
|      *          in="path", | ||||
|      *          description="The BankTransaction Hashed ID", | ||||
|      *          example="D2J234DFA", | ||||
|      *          required=true, | ||||
|      *          @OA\Schema( | ||||
|      *              type="string", | ||||
|      *              format="string", | ||||
|      *          ), | ||||
|      *      ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="Returns the bank_transaction object", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/BankTransaction"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      * | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function show(ShowBankTransactionRequest $request, BankTransaction $bank_transaction) | ||||
|     { | ||||
|         return $this->itemResponse($bank_transaction); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * Show the form for editing the specified resource. | ||||
|      * | ||||
|      * @param EditBankTransactionRequest $request | ||||
|      * @param BankTransaction $bank_transaction | ||||
|      * @return Response | ||||
|      * | ||||
|      * | ||||
|      * @OA\Get( | ||||
|      *      path="/api/v1/bank_transactions/{id}/edit", | ||||
|      *      operationId="editBankTransaction", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Shows a bank_transaction for editing", | ||||
|      *      description="Displays a bank_transaction by id", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Parameter( | ||||
|      *          name="id", | ||||
|      *          in="path", | ||||
|      *          description="The BankTransaction Hashed ID", | ||||
|      *          example="D2J234DFA", | ||||
|      *          required=true, | ||||
|      *          @OA\Schema( | ||||
|      *              type="string", | ||||
|      *              format="string", | ||||
|      *          ), | ||||
|      *      ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="Returns the bank_transaction object", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/BankTransaction"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      * | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function edit(EditBankTransactionRequest $request, BankTransaction $bank_transaction) | ||||
|     { | ||||
|         return $this->itemResponse($bank_transaction); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Update the specified resource in storage. | ||||
|      * | ||||
|      * @param UpdateBankTransactionRequest $request | ||||
|      * @param BankTransaction $bank_transaction | ||||
|      * @return Response | ||||
|      * | ||||
|      * | ||||
|      * | ||||
|      * @OA\Put( | ||||
|      *      path="/api/v1/bank_transactions/{id}", | ||||
|      *      operationId="updateBankTransaction", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Updates a bank_transaction", | ||||
|      *      description="Handles the updating of a bank_transaction by id", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Parameter( | ||||
|      *          name="id", | ||||
|      *          in="path", | ||||
|      *          description="The BankTransaction Hashed ID", | ||||
|      *          example="D2J234DFA", | ||||
|      *          required=true, | ||||
|      *          @OA\Schema( | ||||
|      *              type="string", | ||||
|      *              format="string", | ||||
|      *          ), | ||||
|      *      ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="Returns the bank_transaction object", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/BankTransaction"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      * | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function update(UpdateBankTransactionRequest $request, BankTransaction $bank_transaction) | ||||
|     { | ||||
|         //stubs for updating the model
 | ||||
| @ -262,44 +69,6 @@ class BankTransactionController extends BaseController | ||||
|         return $this->itemResponse($bank_transaction->fresh()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Show the form for creating a new resource. | ||||
|      * | ||||
|      * @param CreateBankTransactionRequest $request | ||||
|      * @return Response | ||||
|      * | ||||
|      * | ||||
|      * | ||||
|      * @OA\Get( | ||||
|      *      path="/api/v1/bank_transactions/create", | ||||
|      *      operationId="getBankTransactionsCreate", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Gets a new blank bank_transaction object", | ||||
|      *      description="Returns a blank object with default values", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="A blank bank_transaction object", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/BankTransaction"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      * | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function create(CreateBankTransactionRequest $request) | ||||
|     { | ||||
|         $bank_transaction = BankTransactionFactory::create(auth()->user()->company()->id, auth()->user()->id, auth()->user()->account_id); | ||||
| @ -307,44 +76,6 @@ class BankTransactionController extends BaseController | ||||
|         return $this->itemResponse($bank_transaction); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Store a newly created resource in storage. | ||||
|      * | ||||
|      * @param StoreBankTransactionRequest $request | ||||
|      * @return Response | ||||
|      * | ||||
|      * | ||||
|      * | ||||
|      * @OA\Post( | ||||
|      *      path="/api/v1/bank_transactions", | ||||
|      *      operationId="storeBankTransaction", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Adds a bank_transaction", | ||||
|      *      description="Adds an bank_transaction to a company", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="Returns the saved bank_transaction object", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/BankTransaction"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      * | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function store(StoreBankTransactionRequest $request) | ||||
|     { | ||||
|         //stub to store the model
 | ||||
| @ -353,55 +84,6 @@ class BankTransactionController extends BaseController | ||||
|         return $this->itemResponse($bank_transaction); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Remove the specified resource from storage. | ||||
|      * | ||||
|      * @param DestroyBankTransactionRequest $request | ||||
|      * @param BankTransaction $bank_transaction | ||||
|      * @return Response | ||||
|      * | ||||
|      * | ||||
|      * @throws \Exception | ||||
|      * @OA\Delete( | ||||
|      *      path="/api/v1/bank_transactions/{id}", | ||||
|      *      operationId="deleteBankTransaction", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Deletes a bank_transaction", | ||||
|      *      description="Handles the deletion of a bank_transaction by id", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/include"), | ||||
|      *      @OA\Parameter( | ||||
|      *          name="id", | ||||
|      *          in="path", | ||||
|      *          description="The BankTransaction Hashed ID", | ||||
|      *          example="D2J234DFA", | ||||
|      *          required=true, | ||||
|      *          @OA\Schema( | ||||
|      *              type="string", | ||||
|      *              format="string", | ||||
|      *          ), | ||||
|      *      ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="Returns a HTTP status", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
|      * | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function destroy(DestroyBankTransactionRequest $request, BankTransaction $bank_transaction) | ||||
|     { | ||||
|         $this->bank_transaction_repo->delete($bank_transaction); | ||||
| @ -409,56 +91,6 @@ class BankTransactionController extends BaseController | ||||
|         return $this->itemResponse($bank_transaction->fresh()); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * Perform bulk actions on the list view. | ||||
|      * | ||||
|      * @return Collection | ||||
|      * | ||||
|      * @OA\Post( | ||||
|      *      path="/api/v1/bank_transations/bulk", | ||||
|      *      operationId="bulkBankTransactions", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Performs bulk actions on an array of bank_transations", | ||||
|      *      description="", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/index"), | ||||
|      *      @OA\RequestBody( | ||||
|      *         description="Action paramters", | ||||
|      *         required=true, | ||||
|      *         @OA\MediaType( | ||||
|      *             mediaType="application/json", | ||||
|      *             @OA\Schema( | ||||
|      *                 type="array", | ||||
|      *                 @OA\Items( | ||||
|      *                     type="integer", | ||||
|      *                     description="Array of hashed IDs to be bulk 'actioned", | ||||
|      *                     example="[0,1,2,3]", | ||||
|      *                 ), | ||||
|      *             ) | ||||
|      *         ) | ||||
|      *     ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="The Bulk Action response", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
| 
 | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function bulk(BulkBankTransactionRequest $request) | ||||
|     { | ||||
|         $action = $request->input('action'); | ||||
| @ -480,55 +112,6 @@ class BankTransactionController extends BaseController | ||||
|         return $this->listResponse(BankTransaction::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Perform bulk actions on the list view. | ||||
|      * | ||||
|      * @return Collection | ||||
|      * | ||||
|      * @OA\Post( | ||||
|      *      path="/api/v1/bank_transations/match", | ||||
|      *      operationId="matchBankTransactions", | ||||
|      *      tags={"bank_transactions"}, | ||||
|      *      summary="Performs match actions on an array of bank_transactions", | ||||
|      *      description="", | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/X-Requested-With"), | ||||
|      *      @OA\Parameter(ref="#/components/parameters/index"), | ||||
|      *      @OA\RequestBody( | ||||
|      *         description="Action paramters", | ||||
|      *         required=true, | ||||
|      *         @OA\MediaType( | ||||
|      *             mediaType="application/json", | ||||
|      *             @OA\Schema( | ||||
|      *                 type="array", | ||||
|      *                 @OA\Items( | ||||
|      *                     type="integer", | ||||
|      *                     description="Array of hashed IDs to be bulk 'actioned", | ||||
|      *                     example="[0,1,2,3]", | ||||
|      *                 ), | ||||
|      *             ) | ||||
|      *         ) | ||||
|      *     ), | ||||
|      *      @OA\Response( | ||||
|      *          response=200, | ||||
|      *          description="The Bulk Action response", | ||||
|      *          @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), | ||||
|      *          @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), | ||||
|      *          @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *          response=422, | ||||
|      *          description="Validation error", | ||||
|      *          @OA\JsonContent(ref="#/components/schemas/ValidationError"), | ||||
| 
 | ||||
|      *       ), | ||||
|      *       @OA\Response( | ||||
|      *           response="default", | ||||
|      *           description="Unexpected Error", | ||||
|      *           @OA\JsonContent(ref="#/components/schemas/Error"), | ||||
|      *       ), | ||||
|      *     ) | ||||
|      */ | ||||
|     public function match(MatchBankTransactionRequest $request) | ||||
|     { | ||||
|         $bts = (new MatchBankTransactions(auth()->user()->company()->id, auth()->user()->company()->db, $request->all()))->handle(); | ||||
|  | ||||
| @ -361,7 +361,7 @@ class BaseController extends Controller | ||||
|                         $query->where('designs.user_id', $user->id); | ||||
|                     } | ||||
|                 }, | ||||
|                 'company.documents'=> function ($query) { | ||||
|                 'company.documents'=> function ($query) use ($updated_at) { | ||||
|                     $query->where('updated_at', '>=', $updated_at); | ||||
|                 }, | ||||
|                 'company.expenses'=> function ($query) use ($updated_at, $user) { | ||||
|  | ||||
| @ -13,7 +13,6 @@ namespace App\Http\Requests\BankTransaction; | ||||
| 
 | ||||
| use App\Http\Requests\Request; | ||||
| use App\Models\BankTransaction; | ||||
| use App\Models\Expense; | ||||
| use App\Models\Payment; | ||||
| 
 | ||||
| class MatchBankTransactionRequest extends Request | ||||
| @ -39,7 +38,6 @@ class MatchBankTransactionRequest extends Request | ||||
|         $rules['transactions.*.vendor_id'] = 'bail|nullable|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; | ||||
|         $rules['transactions.*.id'] = 'bail|required|exists:bank_transactions,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; | ||||
|         $rules['transactions.*.payment_id'] = 'bail|sometimes|nullable|exists:payments,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; | ||||
|         // $rules['transactions.*.expense_id'] = 'bail|sometimes|nullable|exists:expenses,id,company_id,'.auth()->user()->company()->id.',is_deleted,0';
 | ||||
| 
 | ||||
|         return $rules; | ||||
|     } | ||||
| @ -47,7 +45,7 @@ class MatchBankTransactionRequest extends Request | ||||
|     public function prepareForValidation() | ||||
|     { | ||||
|         $inputs = $this->all(); | ||||
|         nlog($inputs); | ||||
| 
 | ||||
|         foreach ($inputs['transactions'] as $key => $input) { | ||||
|             if (array_key_exists('id', $inputs['transactions'][$key])) { | ||||
|                 $inputs['transactions'][$key]['id'] = $this->decodePrimaryKey($input['id']); | ||||
| @ -71,20 +69,8 @@ class MatchBankTransactionRequest extends Request | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             if (array_key_exists('expense_id', $inputs['transactions'][$key]) && strlen($inputs['transactions'][$key]['expense_id']) >= 1) { | ||||
|                 // $inputs['transactions'][$key]['expense_id'] = $this->decodePrimaryKey($inputs['transactions'][$key]['expense_id']);
 | ||||
| 
 | ||||
|                 // $e = Expense::withTrashed()->where('company_id', auth()->user()->company()->id)->where('id', $inputs['transactions'][$key]['expense_id'])->first();
 | ||||
| 
 | ||||
|                 /*Ensure we don't relink an existing expense*/ | ||||
|                 // if (!$e || is_numeric($e->transaction_id)) {
 | ||||
|                 //     unset($inputs['transactions'][$key]['expense_id']);
 | ||||
|                 // }
 | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         nlog($inputs); | ||||
| 
 | ||||
|         $this->replace($inputs); | ||||
|     } | ||||
| } | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -77,7 +77,7 @@ class CreateAccount | ||||
|             $sp794f3f->hosted_company_count = config('ninja.quotas.free.max_companies'); | ||||
|             $sp794f3f->account_sms_verified = true; | ||||
| 
 | ||||
|             if (in_array($this->getDomain($this->request['email']), ['givmail.com','yopmail.com','gmail.com', 'hotmail.com', 'outlook.com', 'yahoo.com', 'aol.com', 'mail.ru','brand-app.biz','proton.me','ema-sofia.eu', 'mail.com', 'fastmail.com'])) { | ||||
|             if (in_array($this->getDomain($this->request['email']), ['mailto.plus', 'givmail.com','yopmail.com','gmail.com', 'hotmail.com', 'outlook.com', 'yahoo.com', 'aol.com', 'mail.ru','brand-app.biz','proton.me','ema-sofia.eu', 'mail.com', 'fastmail.com'])) { | ||||
|                 $sp794f3f->account_sms_verified = false; | ||||
|             } | ||||
| 
 | ||||
|  | ||||
| @ -118,7 +118,7 @@ class MatchBankTransactions implements ShouldQueue | ||||
|         return BankTransaction::whereIn('id', $this->bts); | ||||
|     } | ||||
| 
 | ||||
|     private function getInvoices(string $invoice_hashed_ids) | ||||
|     private function getInvoices(string $invoice_hashed_ids): array | ||||
|     { | ||||
|         $collection = collect(); | ||||
| 
 | ||||
| @ -132,7 +132,7 @@ class MatchBankTransactions implements ShouldQueue | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return $collection; | ||||
|         return $collection->toArray(); | ||||
|     } | ||||
| 
 | ||||
|     private function checkPayable($invoices) :bool | ||||
| @ -205,7 +205,7 @@ class MatchBankTransactions implements ShouldQueue | ||||
|          | ||||
|         if ($payment && !$payment->transaction_id) { | ||||
|             $payment->transaction_id = $this->bt->id; | ||||
|             $payment->save(); | ||||
|             $payment->saveQuietly(); | ||||
| 
 | ||||
|             $this->bt->payment_id = $payment->id; | ||||
|             $this->bt->status_id = BankTransaction::STATUS_CONVERTED; | ||||
| @ -229,7 +229,7 @@ class MatchBankTransactions implements ShouldQueue | ||||
|         $_invoices = Invoice::query() | ||||
|                             ->withTrashed() | ||||
|                             ->where('company_id', $this->bt->company_id) | ||||
|                             ->where('id',$this->getInvoices($input['invoice_ids'])); | ||||
|                             ->whereIn('id', $this->getInvoices($input['invoice_ids'])); | ||||
|          | ||||
|         $amount = $this->bt->amount; | ||||
| 
 | ||||
| @ -383,7 +383,7 @@ class MatchBankTransactions implements ShouldQueue | ||||
|         event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); | ||||
|         event(new InvoiceWasPaid($this->invoice, $payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); | ||||
| 
 | ||||
|         $this->bt->invoice_ids = collect($invoices)->pluck('hashed_id')->implode(','); | ||||
|         $this->bt->invoice_ids = $invoices->get()->pluck('hashed_id')->implode(','); | ||||
|         $this->bt->status_id = BankTransaction::STATUS_CONVERTED; | ||||
|         $this->bt->payment_id = $payment->id; | ||||
|         $this->bt->save(); | ||||
|  | ||||
| @ -170,6 +170,10 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Company> $companies | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyUser> $company_users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankIntegration> $bank_integrations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Company> $companies | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyUser> $company_users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $users | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Account extends BaseModel | ||||
|  | ||||
| @ -42,6 +42,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankSubaccount> $bank_subaccounts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankSubaccount> $bank_subaccounts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankSubaccount> $bank_subaccounts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankSubaccount> $bank_subaccounts | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class BankAccount extends BaseModel | ||||
|  | ||||
| @ -85,6 +85,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class BankIntegration extends BaseModel | ||||
|  | ||||
| @ -87,6 +87,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereVendorId($value) | ||||
|  * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction withTrashed() | ||||
|  * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction withoutTrashed() | ||||
|  * @property-read \App\Models\Payment|null $payment | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class BankTransaction extends BaseModel | ||||
| @ -180,6 +181,11 @@ class BankTransaction extends BaseModel | ||||
|         return $this->belongsTo(Account::class)->withTrashed(); | ||||
|     } | ||||
| 
 | ||||
|     public function payment() | ||||
|     { | ||||
|         return $this->belongsTo(Payment::class)->withTrashed(); | ||||
|     } | ||||
| 
 | ||||
|     public function service() :BankService | ||||
|     { | ||||
|         return new BankService($this); | ||||
|  | ||||
| @ -347,6 +347,25 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoice> $recurring_invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\SystemLog> $system_logs | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @property string|null $routing_id | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $contacts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Expense> $expenses | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $gateway_tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $ledger | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $primary_contact | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Project> $projects | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringExpense> $recurring_expenses | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoice> $recurring_invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\SystemLog> $system_logs | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @method static \Illuminate\Database\Eloquent\Builder|Client whereRoutingId($value) | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Client extends BaseModel implements HasLocalePreference | ||||
|  | ||||
| @ -173,6 +173,11 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations | ||||
|  * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class ClientContact extends Authenticatable implements HasLocalePreference | ||||
|  | ||||
| @ -733,6 +733,51 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Vendor> $vendors | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Webhook> $webhooks | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $all_activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $all_documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankIntegration> $bank_integrations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransactionRule> $bank_transaction_rules | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $bank_transactions | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $client_contacts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Client> $clients | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyGateway> $company_gateways | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyUser> $company_users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $contacts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Design> $designs | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ExpenseCategory> $expense_categories | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Expense> $expenses | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\GroupSetting> $group_settings | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\GroupSetting> $groups | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $ledger | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PaymentTerm> $payment_terms | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Product> $products | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Project> $projects | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PurchaseOrder> $purchase_orders | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringExpense> $recurring_expenses | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoice> $recurring_invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Scheduler> $schedulers | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Subscription> $subscriptions | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\SystemLog> $system_log_relation | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\SystemLog> $system_logs | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Scheduler> $task_schedulers | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\TaskStatus> $task_statuses | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\TaxRate> $tax_rates | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $tokens_hashed | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Design> $user_designs | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PaymentTerm> $user_payment_terms | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Vendor> $vendors | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Webhook> $webhooks | ||||
|  * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableEInvoice($value) | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Company extends BaseModel | ||||
|  | ||||
| @ -102,6 +102,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class CompanyGateway extends BaseModel | ||||
|  | ||||
| @ -97,6 +97,9 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $token | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $token | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $users | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class CompanyUser extends Pivot | ||||
|  | ||||
| @ -255,6 +255,13 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Credit extends BaseModel | ||||
|  | ||||
| @ -141,6 +141,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \App\Models\BankTransaction|null $transaction | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Expense extends BaseModel | ||||
|  | ||||
| @ -38,6 +38,7 @@ namespace App\Models; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PaymentType> $payment_methods | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PaymentType> $payment_methods | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PaymentType> $payment_methods | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PaymentType> $payment_methods | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class GatewayType extends StaticModel | ||||
|  | ||||
| @ -74,6 +74,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Client> $clients | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Client> $clients | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class GroupSetting extends StaticModel | ||||
|  | ||||
| @ -295,6 +295,15 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Expense> $expenses | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Invoice extends BaseModel | ||||
|  | ||||
| @ -182,6 +182,11 @@ use Illuminate\Database\Eloquent\SoftDeletes; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Paymentable> $paymentables | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Paymentable> $paymentables | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Payment extends BaseModel | ||||
|  | ||||
| @ -108,6 +108,7 @@ use League\CommonMark\CommonMarkConverter; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Product extends BaseModel | ||||
|  | ||||
| @ -94,6 +94,8 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @method static \Illuminate\Database\Eloquent\Builder|Project whereCurrentHours($value) | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Project extends BaseModel | ||||
|  | ||||
| @ -38,6 +38,7 @@ use App\Utils\Traits\MakesHash; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Proposal extends BaseModel | ||||
|  | ||||
| @ -240,6 +240,12 @@ use Illuminate\Support\Facades\Storage; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PurchaseOrderInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PurchaseOrderInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class PurchaseOrder extends BaseModel | ||||
|  | ||||
| @ -221,6 +221,10 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $invitations | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Quote extends BaseModel | ||||
|  | ||||
| @ -149,6 +149,7 @@ use Illuminate\Support\Carbon; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class RecurringExpense extends BaseModel | ||||
|  | ||||
| @ -229,6 +229,11 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class RecurringInvoice extends BaseModel | ||||
|  | ||||
| @ -221,6 +221,11 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class RecurringQuote extends BaseModel | ||||
|  | ||||
| @ -101,6 +101,7 @@ use Illuminate\Support\Carbon; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Task extends BaseModel | ||||
|  | ||||
| @ -209,6 +209,13 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $tokens | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Client> $clients | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Company> $companies | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyUser> $company_users | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $contacts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyToken> $tokens | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class User extends Authenticatable implements MustVerifyEmail | ||||
|  | ||||
| @ -144,6 +144,10 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\VendorContact> $contacts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\VendorContact> $primary_contact | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\VendorContact> $contacts | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\VendorContact> $primary_contact | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class Vendor extends BaseModel | ||||
|  | ||||
| @ -130,6 +130,8 @@ use Laracasts\Presenter\PresentableTrait; | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PurchaseOrderInvitation> $purchase_order_invitations | ||||
|  * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PurchaseOrderInvitation> $purchase_order_invitations | ||||
|  * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications | ||||
|  * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PurchaseOrderInvitation> $purchase_order_invitations | ||||
|  * @mixin \Eloquent | ||||
|  */ | ||||
| class VendorContact extends Authenticatable implements HasLocalePreference | ||||
|  | ||||
| @ -44,7 +44,6 @@ class EmailSpamNotification extends Notification | ||||
|      * Get the mail representation of the notification. | ||||
|      * | ||||
|      * @param  mixed  $notifiable | ||||
|      * @return MailMessage | ||||
|      */ | ||||
|     public function toMail($notifiable) | ||||
|     { | ||||
|  | ||||
| @ -33,8 +33,8 @@ class ZipTax implements TaxProviderInterface | ||||
|         if($response->successful()) | ||||
|             return $response->json(); | ||||
| 
 | ||||
|         if($this->postal_code) { | ||||
|            $response = $this->callApi(['key' => $this->api_key, 'address' => $this->postal_code]); | ||||
|         if(isset($this->address['postal_code'])) { | ||||
|            $response = $this->callApi(['key' => $this->api_key, 'address' => $this->address['postal_code']]); | ||||
| 
 | ||||
|             if($response->successful()) | ||||
|                 return $response->json(); | ||||
|  | ||||
| @ -4989,11 +4989,6 @@ $LANG = array( | ||||
|     'notification_payment_emailed' => 'Payment :payment was emailed to :client', | ||||
|     'notification_payment_emailed_subject' => 'Payment :payment was emailed', | ||||
|     'record_not_found' => 'Record not found', | ||||
|     'product_tax_exempt' => 'Product Tax Exempt', | ||||
|     'product_type_physical' => 'Physical Goods', | ||||
|     'product_type_digital' => 'Digital Goods', | ||||
|     'product_type_service' => 'Services', | ||||
|     'product_type_freight' => 'Shipping', | ||||
|     'minimum_payment_amount' => 'Minimum Payment Amount', | ||||
|     'client_initiated_payments' => 'Client Initiated Payments', | ||||
|     'client_initiated_payments_help' => 'Support making a payment in the client portal without an invoice', | ||||
|  | ||||
| @ -4949,7 +4949,7 @@ Una vez que tenga los montos, vuelva a esta página de métodos de pago y haga c | ||||
|     'failed' => 'Fallido', | ||||
|     'client_contacts' => 'Contactos del cliente', | ||||
|     'sync_from' => 'sincronizar desde', | ||||
|     'gateway_payment_text' => 'Facturas: :invoices por importe de :amount del cliente :client', | ||||
|     'gateway_payment_text' => 'Factura: :invoices por importe de :amount de :client', | ||||
|     'gateway_payment_text_no_invoice' => 'Pago sin factura por importe :amount del cliente :client', | ||||
|     'click_to_variables' => 'Aquí para ver todas las variables del cliente', | ||||
|     'ship_to' => 'Enviar a', | ||||
| @ -5052,6 +5052,14 @@ Una vez que tenga los montos, vuelva a esta página de métodos de pago y haga c | ||||
|     'here' => 'aquí', | ||||
|     'industry_Restaurant & Catering' => 'Restaurante y Catering', | ||||
|     'show_credits_table' => 'Mostrar tabla de créditos', | ||||
|     'manual_payment' => 'Pago Manual', | ||||
|     'tax_summary_report' => 'Informe resumido de impuestos', | ||||
|     'tax_category' => 'Categoría de impuestos', | ||||
|     'physical_goods' => 'Bienes físicos', | ||||
|     'digital_products' => 'Productos digitales', | ||||
|     'services' => 'Servicios', | ||||
|     'shipping' => 'Envío', | ||||
|     'tax_exempt' => 'Exento de impuestos', | ||||
| ); | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user