mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 14:07:32 -04:00 
			
		
		
		
	
						commit
						25c91d608f
					
				| @ -13,15 +13,21 @@ namespace App\Events\Client; | ||||
| 
 | ||||
| use App\Models\Client; | ||||
| use App\Models\Company; | ||||
| use League\Fractal\Manager; | ||||
| use League\Fractal\Resource\Item; | ||||
| use Illuminate\Broadcasting\Channel; | ||||
| use Illuminate\Broadcasting\InteractsWithSockets; | ||||
| use Illuminate\Foundation\Events\Dispatchable; | ||||
| use App\Transformers\ArraySerializer; | ||||
| use Illuminate\Queue\SerializesModels; | ||||
| use App\Transformers\ClientTransformer; | ||||
| use Illuminate\Broadcasting\PrivateChannel; | ||||
| use Illuminate\Foundation\Events\Dispatchable; | ||||
| use Illuminate\Broadcasting\InteractsWithSockets; | ||||
| use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | ||||
| 
 | ||||
| /** | ||||
|  * Class ClientWasArchived. | ||||
|  */ | ||||
| class ClientWasArchived | ||||
| class ClientWasArchived implements ShouldBroadcast | ||||
| { | ||||
|     use Dispatchable; | ||||
|     use InteractsWithSockets; | ||||
| @ -50,13 +56,34 @@ class ClientWasArchived | ||||
|         $this->event_vars = $event_vars; | ||||
|     } | ||||
| 
 | ||||
|     // /**
 | ||||
|     //  * Get the channels the event should broadcast on.
 | ||||
|     //  *
 | ||||
|     //  * @return Channel|array
 | ||||
|     //  */
 | ||||
|     public function broadcastWith() | ||||
|     { | ||||
|          | ||||
|         $manager = new Manager(); | ||||
|         $manager->setSerializer(new ArraySerializer()); | ||||
|         $class = sprintf('App\\Transformers\\%sTransformer', class_basename($this->client)); | ||||
| 
 | ||||
|         $transformer = new $class(); | ||||
| 
 | ||||
|         $resource = new Item($this->client, $transformer, $this->client->getEntityType()); | ||||
|         $data = $manager->createData($resource)->toArray(); | ||||
| 
 | ||||
|         return $data; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Get the channels the event should broadcast on. | ||||
|      * | ||||
|      * @return Channel|array | ||||
|      */ | ||||
|     public function broadcastOn() | ||||
|     { | ||||
|         return []; | ||||
|          | ||||
|         return [ | ||||
|             new PrivateChannel("company-{$this->company->company_key}"), | ||||
|         ]; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -450,6 +450,7 @@ class BaseExport | ||||
|         'status' => 'task.status_id', | ||||
|         'project' => 'task.project_id', | ||||
|         'billable' => 'task.billable', | ||||
|         'item_notes' => 'task.item_notes', | ||||
|     ]; | ||||
| 
 | ||||
|     protected array $forced_client_fields = [ | ||||
|  | ||||
| @ -156,7 +156,7 @@ class TaskExport extends BaseExport | ||||
|                 $entity[$key] = $transformed_entity[$parts[1]]; | ||||
|             } elseif (array_key_exists($key, $transformed_entity)) { | ||||
|                 $entity[$key] = $transformed_entity[$key]; | ||||
|             } elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration'])) { | ||||
|             } elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration', 'task.billable', 'task.item_notes'])) { | ||||
|                 $entity[$key] = ''; | ||||
|             } else { | ||||
|                 $entity[$key] = $this->decorator->transform($key, $task); | ||||
| @ -175,7 +175,7 @@ class TaskExport extends BaseExport | ||||
|     private function iterateLogs(Task $task, array $entity) | ||||
|     { | ||||
|         $timezone = Timezone::find($task->company->settings->timezone_id); | ||||
|         $timezone_name = 'US/Eastern'; | ||||
|         $timezone_name = 'America/New_York'; | ||||
| 
 | ||||
|         if ($timezone) { | ||||
|             $timezone_name = $timezone->name; | ||||
| @ -209,6 +209,14 @@ class TaskExport extends BaseExport | ||||
|                 $entity['task.duration_words'] =  $seconds > 86400 ? CarbonInterval::seconds($seconds)->locale($this->company->locale())->cascade()->forHumans() : now()->startOfDay()->addSeconds($seconds)->format('H:i:s'); | ||||
|             } | ||||
| 
 | ||||
|             if (in_array('task.billable', $this->input['report_keys']) || in_array('billable', $this->input['report_keys'])) { | ||||
|                 $entity['task.billable'] = isset($item[3]) && $item[3] == 'true' ? ctrans('texts.yes') : ctrans('texts.no'); | ||||
|             } | ||||
| 
 | ||||
|             if (in_array('task.item_notes', $this->input['report_keys']) || in_array('item_notes', $this->input['report_keys'])) { | ||||
|                 $entity['task.item_notes'] = isset($item[2]) ? (string)$item[2] : ''; | ||||
|             } | ||||
| 
 | ||||
|             $entity = $this->decorateAdvancedFields($task, $entity); | ||||
| 
 | ||||
|             $this->storage_array[] = $entity; | ||||
| @ -219,6 +227,8 @@ class TaskExport extends BaseExport | ||||
|             $entity['task.end_time'] = ''; | ||||
|             $entity['task.duration'] = ''; | ||||
|             $entity['task.duration_words'] = ''; | ||||
|             $entity['task.billable'] = ''; | ||||
|             $entity['task.item_notes'] = ''; | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|  | ||||
| @ -18,6 +18,7 @@ use Carbon\Carbon; | ||||
| 
 | ||||
| class TaskDecorator extends Decorator implements DecoratorInterface | ||||
| { | ||||
|     //@todo - we do not handle iterating through the timelog here.
 | ||||
|     public function transform(string $key, mixed $entity): mixed | ||||
|     { | ||||
|         $task = false; | ||||
| @ -42,7 +43,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface | ||||
|     { | ||||
| 
 | ||||
|         $timezone = Timezone::find($task->company->settings->timezone_id); | ||||
|         $timezone_name = 'US/Eastern'; | ||||
|         $timezone_name = 'America/New_York'; | ||||
| 
 | ||||
|         if ($timezone) { | ||||
|             $timezone_name = $timezone->name; | ||||
| @ -71,7 +72,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface | ||||
|     { | ||||
| 
 | ||||
|         $timezone = Timezone::find($task->company->settings->timezone_id); | ||||
|         $timezone_name = 'US/Eastern'; | ||||
|         $timezone_name = 'America/New_York'; | ||||
| 
 | ||||
|         if ($timezone) { | ||||
|             $timezone_name = $timezone->name; | ||||
| @ -95,6 +96,26 @@ class TaskDecorator extends Decorator implements DecoratorInterface | ||||
|         return ''; | ||||
| 
 | ||||
|     } | ||||
|      | ||||
|     /** | ||||
|      * billable | ||||
|      * | ||||
|      * @todo | ||||
|      */ | ||||
|     public function billable(Task $task) | ||||
|     { | ||||
|         return ''; | ||||
|     } | ||||
|      | ||||
|     /** | ||||
|      * items_notes | ||||
|      * @todo | ||||
|      */ | ||||
|     public function items_notes(Task $task) | ||||
|     { | ||||
|         return ''; | ||||
|     } | ||||
|      | ||||
|     public function duration(Task $task) | ||||
|     { | ||||
|         return $task->calcDuration(); | ||||
|  | ||||
| @ -171,7 +171,7 @@ class TransactionTransformer implements BankRevenueInterface | ||||
|     private function formatDate(string $input) | ||||
|     { | ||||
|         $timezone = Timezone::find($this->company->settings->timezone_id); | ||||
|         $timezone_name = 'US/Eastern'; | ||||
|         $timezone_name = 'America/New_York'; | ||||
| 
 | ||||
|         if ($timezone) { | ||||
|             $timezone_name = $timezone->name; | ||||
|  | ||||
| @ -27,7 +27,6 @@ use Illuminate\Contracts\Translation\HasLocalePreference; | ||||
| use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||||
| use Illuminate\Database\Eloquent\Relations\HasMany; | ||||
| use Illuminate\Database\Eloquent\SoftDeletes; | ||||
| use Illuminate\Support\Facades\Cache; | ||||
| use Laracasts\Presenter\PresentableTrait; | ||||
| 
 | ||||
| /** | ||||
| @ -124,7 +123,7 @@ class Client extends BaseModel implements HasLocalePreference | ||||
|     use AppSetup; | ||||
|     use ClientGroupSettingsSaver; | ||||
|     use Excludable; | ||||
| 
 | ||||
|      | ||||
|     protected $presenter = ClientPresenter::class; | ||||
| 
 | ||||
|     protected $hidden = [ | ||||
|  | ||||
| @ -128,7 +128,7 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver | ||||
| 
 | ||||
|         nlog($response); | ||||
| 
 | ||||
|         if($request->has('token') && strlen($request->input('token')) > 2) { | ||||
|         if($request->has('token') && strlen($request->input('token','')) > 2) { | ||||
|             return $this->processTokenPayment($request, $response); | ||||
|         } | ||||
| 
 | ||||
| @ -332,8 +332,6 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver | ||||
| 
 | ||||
|         $orderId = $this->createOrder($data); | ||||
| 
 | ||||
|         // $r = $this->gatewayRequest("/v2/checkout/orders/{$orderId}", 'get', ['body' => '']);
 | ||||
|          | ||||
|         try { | ||||
| 
 | ||||
|             $r = $this->gatewayRequest("/v2/checkout/orders/{$orderId}", 'get', ['body' => '']); | ||||
|  | ||||
| @ -151,8 +151,8 @@ class Peppol extends AbstractService | ||||
|     private InvoiceSum | InvoiceSumInclusive $calc; | ||||
| 
 | ||||
|     /** | ||||
|      * @param Invoice $invoice | ||||
|      */ | ||||
|     * @param Invoice $invoice | ||||
|     */ | ||||
|     public function __construct(public Invoice $invoice, public ?\InvoiceNinja\EInvoice\Models\Peppol\Invoice $p_invoice = null) | ||||
|     { | ||||
|         $this->p_invoice = $p_invoice ?? new \InvoiceNinja\EInvoice\Models\Peppol\Invoice(); | ||||
|  | ||||
| @ -32,10 +32,10 @@ | ||||
|     "type": "project", | ||||
|     "require": { | ||||
|         "php": "^8.2", | ||||
|         "ext-curl": "*", | ||||
|         "ext-dom": "*", | ||||
|         "ext-json": "*", | ||||
|         "ext-libxml": "*", | ||||
|         "ext-curl": "*", | ||||
|         "afosto/yaac": "^1.4", | ||||
|         "asm/php-ansible": "dev-main", | ||||
|         "authorizenet/authorizenet": "^2.0", | ||||
| @ -57,11 +57,10 @@ | ||||
|         "hedii/laravel-gelf-logger": "^9", | ||||
|         "horstoeko/orderx": "dev-master", | ||||
|         "horstoeko/zugferd": "^1", | ||||
|         "horstoeko/zugferdvisualizer":"^1", | ||||
|         "horstoeko/zugferdvisualizer": "^1", | ||||
|         "hyvor/php-json-exporter": "^0.0.3", | ||||
|         "imdhemy/laravel-purchases": "^1.7", | ||||
|         "intervention/image": "^2.5", | ||||
|         "invoiceninja/inspector": "^3.0", | ||||
|         "invoiceninja/einvoice": "dev-main", | ||||
|         "invoiceninja/ubl_invoice": "^2", | ||||
|         "josemmo/facturae-php": "^1.7", | ||||
|  | ||||
							
								
								
									
										72
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										72
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							| @ -4,7 +4,7 @@ | ||||
|         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", | ||||
|         "This file is @generated automatically" | ||||
|     ], | ||||
|     "content-hash": "edc6905124cb32fef6a13befb3d5a4e1", | ||||
|     "content-hash": "8fdb8245fbc563f8c09da161876f52a7", | ||||
|     "packages": [ | ||||
|         { | ||||
|             "name": "adrienrn/php-mimetyper", | ||||
| @ -2585,7 +2585,7 @@ | ||||
|         }, | ||||
|         { | ||||
|             "name": "google/apiclient-services", | ||||
|             "version": "v0.365.0", | ||||
|             "version": "v0.366.0", | ||||
|             "source": { | ||||
|                 "type": "git", | ||||
|                 "url": "https://github.com/googleapis/google-api-php-client-services.git", | ||||
| @ -2623,7 +2623,7 @@ | ||||
|             ], | ||||
|             "support": { | ||||
|                 "issues": "https://github.com/googleapis/google-api-php-client-services/issues", | ||||
|                 "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.365.0" | ||||
|                 "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.366.0" | ||||
|             }, | ||||
|             "time": "2024-07-11T01:08:44+00:00" | ||||
|         }, | ||||
| @ -4111,68 +4111,6 @@ | ||||
|             }, | ||||
|             "time": "2024-07-22T02:40:27+00:00" | ||||
|         }, | ||||
|         { | ||||
|             "name": "invoiceninja/inspector", | ||||
|             "version": "v3.0", | ||||
|             "source": { | ||||
|                 "type": "git", | ||||
|                 "url": "https://github.com/invoiceninja/inspector.git", | ||||
|                 "reference": "29bc1ee7ae9d967287ecbd3485a2fee41a13e65f" | ||||
|             }, | ||||
|             "dist": { | ||||
|                 "type": "zip", | ||||
|                 "url": "https://api.github.com/repos/invoiceninja/inspector/zipball/29bc1ee7ae9d967287ecbd3485a2fee41a13e65f", | ||||
|                 "reference": "29bc1ee7ae9d967287ecbd3485a2fee41a13e65f", | ||||
|                 "shasum": "" | ||||
|             }, | ||||
|             "require": { | ||||
|                 "doctrine/dbal": "^4.0", | ||||
|                 "illuminate/support": "^11.0", | ||||
|                 "php": "^8.2" | ||||
|             }, | ||||
|             "require-dev": { | ||||
|                 "orchestra/testbench": "^9.1", | ||||
|                 "phpunit/phpunit": "^11.1" | ||||
|             }, | ||||
|             "type": "library", | ||||
|             "extra": { | ||||
|                 "laravel": { | ||||
|                     "providers": [ | ||||
|                         "InvoiceNinja\\Inspector\\InspectorServiceProvider" | ||||
|                     ], | ||||
|                     "aliases": { | ||||
|                         "Inspector": "InvoiceNinja\\Inspector\\InspectorFacade" | ||||
|                     } | ||||
|                 } | ||||
|             }, | ||||
|             "autoload": { | ||||
|                 "psr-4": { | ||||
|                     "InvoiceNinja\\Inspector\\": "src" | ||||
|                 } | ||||
|             }, | ||||
|             "notification-url": "https://packagist.org/downloads/", | ||||
|             "license": [ | ||||
|                 "MIT" | ||||
|             ], | ||||
|             "authors": [ | ||||
|                 { | ||||
|                     "name": "Benjamin Beganović", | ||||
|                     "email": "benjamin.beganovic4@outlook.com", | ||||
|                     "role": "Developer" | ||||
|                 } | ||||
|             ], | ||||
|             "description": "Simplified database records management", | ||||
|             "homepage": "https://github.com/invoiceninja/inspector", | ||||
|             "keywords": [ | ||||
|                 "inspector", | ||||
|                 "invoiceninja" | ||||
|             ], | ||||
|             "support": { | ||||
|                 "issues": "https://github.com/invoiceninja/inspector/issues", | ||||
|                 "source": "https://github.com/invoiceninja/inspector/tree/v3.0" | ||||
|             }, | ||||
|             "time": "2024-06-04T12:31:47+00:00" | ||||
|         }, | ||||
|         { | ||||
|             "name": "invoiceninja/ubl_invoice", | ||||
|             "version": "v2.2.2", | ||||
| @ -19598,10 +19536,10 @@ | ||||
|     "prefer-lowest": false, | ||||
|     "platform": { | ||||
|         "php": "^8.2", | ||||
|         "ext-curl": "*", | ||||
|         "ext-dom": "*", | ||||
|         "ext-json": "*", | ||||
|         "ext-libxml": "*", | ||||
|         "ext-curl": "*" | ||||
|         "ext-libxml": "*" | ||||
|     }, | ||||
|     "platform-dev": [], | ||||
|     "plugin-api-version": "2.6.0" | ||||
|  | ||||
| @ -193,7 +193,7 @@ return [ | ||||
|          */ | ||||
|         App\Providers\AppServiceProvider::class, | ||||
|         App\Providers\AuthServiceProvider::class, | ||||
|         // App\Providers\BroadcastServiceProvider::class,
 | ||||
|         App\Providers\BroadcastServiceProvider::class, | ||||
|         App\Providers\EventServiceProvider::class, | ||||
|         App\Providers\RouteServiceProvider::class, | ||||
|         App\Providers\ComposerServiceProvider::class, | ||||
|  | ||||
| @ -39,7 +39,7 @@ return [ | ||||
|                 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com'), | ||||
|                 'port' => env('PUSHER_PORT', 443), | ||||
|                 'scheme' => env('PUSHER_SCHEME', 'https'), | ||||
|                 'encrypted' => true, | ||||
|                 'encrypted' => false, | ||||
|                 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', | ||||
|             ], | ||||
|             'client_options' => [ | ||||
|  | ||||
							
								
								
									
										1
									
								
								public/build/assets/app-039bd735.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								public/build/assets/app-039bd735.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -11,6 +11,13 @@ | ||||
| | | ||||
| */ | ||||
| 
 | ||||
| Broadcast::channel('App.User.{id}', function ($user, $id) { | ||||
|     return (int) $user->id === (int) $id; | ||||
| }); | ||||
| // Broadcast::channel('App.User.{id}', function ($user, $id) {
 | ||||
| //    nlog($id);
 | ||||
|     | ||||
| //     return false;
 | ||||
| //     // return (int) $user->id === (int) $id;
 | ||||
| // });
 | ||||
| 
 | ||||
| Broadcast::channel('company-{company_key}', function (\App\Models\User $user, string $company_key) { | ||||
|     return $user->company()->company_key === $company_key; | ||||
| }); | ||||
| @ -49,3 +49,5 @@ Route::get('checkout/3ds_redirect/{company_key}/{company_gateway_id}/{hash}', [C | ||||
| Route::get('mollie/3ds_redirect/{company_key}/{company_gateway_id}/{hash}', [Mollie3dsController::class, 'index'])->middleware('domain_db')->name('mollie.3ds_redirect'); | ||||
| Route::get('gocardless/ibp_redirect/{company_key}/{company_gateway_id}/{hash}', [GoCardlessController::class, 'ibpRedirect'])->middleware('domain_db')->name('gocardless.ibp_redirect'); | ||||
| Route::get('.well-known/apple-developer-merchantid-domain-association', [ApplePayDomainController::class, 'showAppleMerchantId']); | ||||
| 
 | ||||
| Broadcast::routes(['middleware' => ['token_auth']]); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user