Merge pull request #7641 from turbo124/v5-develop

Company Import|Export for purchase orders
This commit is contained in:
David Bomba 2022-07-16 12:27:28 +10:00 committed by GitHub
commit 0959d81d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 296 additions and 151 deletions

View File

@ -1 +1 @@
5.4.9
5.4.10

View File

@ -400,6 +400,7 @@ class CreateSingleAccount extends Command
$vendor = Project::factory()->create([
'user_id' => $client->user->id,
'company_id' => $client->company->id,
'client_id' => $client->id,
]);
}

View File

@ -46,6 +46,8 @@ use Laravel\Socialite\Facades\Socialite;
use PragmaRX\Google2FA\Google2FA;
use Turbo124\Beacon\Facades\LightLogs;
use Microsoft\Graph\Model;
use Illuminate\Support\Facades\Http;
class LoginController extends BaseController
{
@ -334,8 +336,8 @@ class LoginController extends BaseController
} elseif (request()->input('provider') == 'microsoft') {
return $this->handleMicrosoftOauth();
} elseif (request()->input('provider') == 'apple') {
if (request()->has('token') || request()->has('auth_code')) {
$token = request()->has('token') ? request()->input('token') : request()->input('auth_code');
if (request()->has('id_token')) {
$token = request()->input('id_token');
return $this->handleSocialiteLogin('apple', $token);
} else {
$message = 'Token is missing for the apple login';

View File

@ -656,4 +656,84 @@ class ClientController extends BaseController
//todo add an event here using the client name as reference for purge event
}
/**
* Update the specified resource in storage.
*
* @param PurgeClientRequest $request
* @param Client $client
* @param string $mergeable client hashed_id
* @return Response
*
*
*
* @OA\Post(
* path="/api/v1/clients/{id}/{mergaeble_client_hashed_id}/merge",
* operationId="mergeClient",
* tags={"clients"},
* summary="Merges two clients",
* description="Handles merging 2 clients",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @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 Client Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Parameter(
* name="mergeable_client_hashedid",
* in="path",
* description="The Mergeable Client Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Response(
* response=200,
* description="Returns the client 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\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 merge(PurgeClientRequest $request, Client $client, string $mergeable_client)
{
$m_client = Client::withTrashed()
->where('id', $this->decodePrimaryKey($mergeable_client))
->where('company_id', auth()->user()->company()->id)
->first();
if(!$m_client)
return response()->json(['message' => "Client not found"]);
$merged_client = $client->service()->merge($m_client)->save();
return $this->itemResponse($merged_client);
}
}

View File

@ -73,6 +73,12 @@ class RequiredClientInfo extends Component
'state',
'postal_code',
'country_id',
'shipping_address1',
'shipping_address2',
'shipping_city',
'shipping_state',
'shipping_postal_code',
'shipping_country_id',
];
protected $rules = [

View File

@ -1,10 +1,10 @@
<?php
/**
* Quote Ninja (https://paymentninja.com).
* Invoice Ninja (https://paymentninja.com).
*
* @link https://github.com/paymentninja/paymentninja source repository
*
* @copyright Copyright (c) 2022. Quote Ninja LLC (https://paymentninja.com)
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://paymentninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
@ -24,7 +24,7 @@ class SortTaskRequest extends Request
{
return true;
// return auth()->user()->can('edit', $this->task);
}
public function rules()

View File

@ -20,6 +20,7 @@ use App\Mail\DownloadInvoices;
use App\Models\Company;
use App\Models\CreditInvitation;
use App\Models\InvoiceInvitation;
use App\Models\PurchaseOrderInvitation;
use App\Models\QuoteInvitation;
use App\Models\RecurringInvoice;
use App\Models\RecurringInvoiceInvitation;
@ -32,8 +33,8 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Storage;
class CompanyExport implements ShouldQueue
{
@ -424,9 +425,9 @@ class CompanyExport implements ShouldQueue
$this->export_data['vendor_contacts'] = VendorContact::where('company_id', $this->company->id)->withTrashed()->cursor()->map(function ($vendor){
$vendor = $this->transformBasicEntities($vendor);
$vendor->vendor_id = $this->encodePrimaryKey($vendor->vendor_id);
$vendor = $this->transformArrayOfKeys($vendor, ['vendor_id']);
return $vendor->makeVisible(['id']);
return $vendor->makeVisible(['id','user_id']);
})->all();
@ -439,6 +440,31 @@ class CompanyExport implements ShouldQueue
})->makeHidden(['id'])->all();
$this->export_data['purchase_orders'] = $this->company->purchase_orders()->orderBy('number', 'DESC')->cursor()->map(function ($purchase_order){
$purchase_order = $this->transformBasicEntities($purchase_order);
$purchase_order = $this->transformArrayOfKeys($purchase_order, ['expense_id','client_id', 'vendor_id', 'project_id', 'design_id', 'subscription_id','project_id']);
return $purchase_order->makeVisible(['id',
'private_notes',
'user_id',
'client_id',
'vendor_id',
'company_id',]);
})->all();
$this->export_data['purchase_order_invitations'] = PurchaseOrderInvitation::where('company_id', $this->company->id)->withTrashed()->cursor()->map(function ($purchase_order){
$purchase_order = $this->transformArrayOfKeys($purchase_order, ['company_id', 'user_id', 'vendor_contact_id', 'purchase_order_id']);
return $purchase_order->makeVisible(['id']);
})->all();
//write to tmp and email to owner();
$this->zipAndSend();

View File

@ -45,6 +45,8 @@ use App\Models\PaymentTerm;
use App\Models\Paymentable;
use App\Models\Product;
use App\Models\Project;
use App\Models\PurchaseOrder;
use App\Models\PurchaseOrderInvitation;
use App\Models\Quote;
use App\Models\QuoteInvitation;
use App\Models\RecurringExpense;
@ -74,7 +76,6 @@ use Illuminate\Support\Str;
use JsonMachine\JsonDecoder\ExtJsonDecoder;
use JsonMachine\JsonMachine;
use ZipArchive;
use function GuzzleHttp\json_encode;
class CompanyImport implements ShouldQueue
@ -122,6 +123,7 @@ class CompanyImport implements ShouldQueue
'clients',
'client_contacts',
'vendors',
'vendor_contacts',
'projects',
'products',
'company_gateways',
@ -147,6 +149,8 @@ class CompanyImport implements ShouldQueue
'documents',
'webhooks',
'system_logs',
'purchase_orders',
'purchase_order_invitations'
];
private $company_properties = [
@ -454,7 +458,7 @@ class CompanyImport implements ShouldQueue
$settings->ticket_number_counter = 1;
$settings->payment_number_counter = 1;
$settings->project_number_counter = 1;
$settings->purchase_order_counter = 1;
$this->company->settings = $co->settings;
// $this->company->settings = $this->backup_file->company->settings;
$this->company->save();
@ -471,6 +475,7 @@ class CompanyImport implements ShouldQueue
$this->company->vendors()->forceDelete();
$this->company->expenses()->forceDelete();
$this->company->subscriptions()->forceDelete();
$this->company->purchase_orders()->forceDelete();
$this->company->save();
@ -649,6 +654,19 @@ class CompanyImport implements ShouldQueue
return $this;
}
private function import_vendor_contacts()
{
$this->genericImport(VendorContact::class,
['user_id', 'company_id', 'id', 'hashed_id','company','assigned_user_id'],
[['users' => 'user_id'], ['vendors' => 'vendor_id']],
'vendor_contacts',
'email');
return $this;
}
private function import_projects()
{
@ -796,6 +814,42 @@ class CompanyImport implements ShouldQueue
return $this;
}
private function import_purchase_orders()
{
$this->genericImport(PurchaseOrder::class,
['user_id', 'company_id', 'id', 'hashed_id', 'recurring_id','status', 'vendor_id', 'subscription_id','client_id'],
[
['users' => 'user_id'],
['users' => 'assigned_user_id'],
['recurring_invoices' => 'recurring_id'],
['projects' => 'project_id'],
['vendors' => 'vendor_id'],
],
'purchase_orders',
'number');
return $this;
}
private function import_purchase_order_invitations()
{
$this->genericImport(PurchaseOrderInvitation::class,
['user_id', 'vendor_contact_id', 'company_id', 'id', 'hashed_id', 'purchase_order_id'],
[
['users' => 'user_id'],
['purchase_orders' => 'purchase_order_id'],
['vendor_contacts' => 'vendor_contact_id'],
],
'purchase_order_invitations',
'key');
return $this;
}
private function import_quotes()
{
@ -1425,6 +1479,13 @@ class CompanyImport implements ShouldQueue
$new_obj->save(['timestamps' => false]);
$new_obj->number = $this->getNextInvoiceNumber($client = Client::withTrashed()->find($obj_array['client_id']),$new_obj);
}
elseif($class == 'App\Models\PurchaseOrder' && is_null($obj->{$match_key})){
$new_obj = new PurchaseOrder();
$new_obj->company_id = $this->company->id;
$new_obj->fill($obj_array);
$new_obj->save(['timestamps' => false]);
$new_obj->number = $this->getNextPurchaseOrderNumber($new_obj);
}
elseif($class == 'App\Models\Payment' && is_null($obj->{$match_key})){
$new_obj = new Payment();
$new_obj->company_id = $this->company->id;
@ -1445,6 +1506,12 @@ class CompanyImport implements ShouldQueue
$new_obj->fill($obj_array);
$new_obj->save(['timestamps' => false]);
}
elseif($class == 'App\Models\VendorContact'){
$new_obj = new VendorContact();
$new_obj->company_id = $this->company->id;
$new_obj->fill($obj_array);
$new_obj->save(['timestamps' => false]);
}
elseif($class == 'App\Models\RecurringExpense' && is_null($obj->{$match_key})){
$new_obj = new RecurringExpense();
$new_obj->company_id = $this->company->id;
@ -1466,6 +1533,13 @@ class CompanyImport implements ShouldQueue
$new_obj->save(['timestamps' => false]);
$new_obj->number = $this->getNextTaskNumber($new_obj);
}
elseif($class == 'App\Models\Vendor' && is_null($obj->{$match_key})){
$new_obj = new Vendor();
$new_obj->company_id = $this->company->id;
$new_obj->fill($obj_array);
$new_obj->save(['timestamps' => false]);
$new_obj->number = $this->getNextVendorNumber($new_obj);
}
elseif($class == 'App\Models\CompanyLedger'){
$new_obj = $class::firstOrNew(
[$match_key => $obj->{$match_key}, 'company_id' => $this->company->id],

View File

@ -190,7 +190,7 @@ class Import implements ShouldQueue
public function middleware()
{
return [new WithoutOverlapping($this->company->account->key)];
return [new WithoutOverlapping($this->company->company_key)];
}
/**

View File

@ -32,7 +32,6 @@ class PurchaseOrder extends BaseModel
protected $fillable = [
'number',
'discount',
'company_id',
'status_id',
'last_sent_date',
'is_deleted',

View File

@ -66,7 +66,19 @@ class AuthorizePaymentDriver extends BaseDriver
public function getClientRequiredFields(): array
{
return [
$fields = [];
if ($this->company_gateway->require_shipping_address) {
$fields[] = ['name' => 'client_shipping_address_line_1', 'label' => ctrans('texts.shipping_address1'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_shipping_city', 'label' => ctrans('texts.shipping_city'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_shipping_state', 'label' => ctrans('texts.shipping_state'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_shipping_postal_code', 'label' => ctrans('texts.shipping_postal_code'), 'type' => 'text', 'validation' => 'required'];
$fields[] = ['name' => 'client_shipping_country_id', 'label' => ctrans('texts.shipping_country'), 'type' => 'text', 'validation' => 'required'];
}
$data = [
['name' => 'client_name', 'label' => ctrans('texts.name'), 'type' => 'text', 'validation' => 'required|min:2'],
['name' => 'contact_email', 'label' => ctrans('texts.email'), 'type' => 'text', 'validation' => 'required|email:rfc'],
['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required'],
@ -75,6 +87,9 @@ class AuthorizePaymentDriver extends BaseDriver
['name' => 'client_postal_code', 'label' => ctrans('texts.postal_code'), 'type' => 'text', 'validation' => 'required'],
['name' => 'client_country_id', 'label' => ctrans('texts.country'), 'type' => 'select', 'validation' => 'required'],
];
return array_merge($fields, $data);
}
public function authorizeView($payment_method)

View File

@ -116,7 +116,7 @@ class AddGatewayFee extends AbstractService
$this->invoice
->ledger()
->updateInvoiceBalance($adjustment, 'Adjustment for removing gateway fee');
->updateInvoiceBalance($adjustment, 'Adjustment for adding gateway fee');
}
return $this->invoice;
@ -165,7 +165,7 @@ class AddGatewayFee extends AbstractService
$this->invoice
->ledger()
->updateInvoiceBalance($adjustment * -1, 'Adjustment for removing gateway fee');
->updateInvoiceBalance($adjustment * -1, 'Adjustment for adding gateway fee');
}

194
composer.lock generated
View File

@ -434,16 +434,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.231.2",
"version": "3.231.5",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "9a7c2a8c4b7f95074749e1a7b575e6b4486bdcab"
"reference": "4ea642d1c7f8002037ef46e5f17c9fc1273a6021"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9a7c2a8c4b7f95074749e1a7b575e6b4486bdcab",
"reference": "9a7c2a8c4b7f95074749e1a7b575e6b4486bdcab",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4ea642d1c7f8002037ef46e5f17c9fc1273a6021",
"reference": "4ea642d1c7f8002037ef46e5f17c9fc1273a6021",
"shasum": ""
},
"require": {
@ -520,9 +520,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.231.2"
"source": "https://github.com/aws/aws-sdk-php/tree/3.231.5"
},
"time": "2022-07-08T18:16:11+00:00"
"time": "2022-07-13T18:36:03+00:00"
},
{
"name": "bacon/bacon-qr-code",
@ -2245,16 +2245,16 @@
},
{
"name": "gocardless/gocardless-pro",
"version": "4.18.0",
"version": "4.19.0",
"source": {
"type": "git",
"url": "https://github.com/gocardless/gocardless-pro-php.git",
"reference": "dee046abbb7a37ef0a60bb03e2a467afc79a92a5"
"reference": "ed88cd22b6a790ee37758afa8bf7c9d43caa796c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/gocardless/gocardless-pro-php/zipball/dee046abbb7a37ef0a60bb03e2a467afc79a92a5",
"reference": "dee046abbb7a37ef0a60bb03e2a467afc79a92a5",
"url": "https://api.github.com/repos/gocardless/gocardless-pro-php/zipball/ed88cd22b6a790ee37758afa8bf7c9d43caa796c",
"reference": "ed88cd22b6a790ee37758afa8bf7c9d43caa796c",
"shasum": ""
},
"require": {
@ -2294,9 +2294,9 @@
],
"support": {
"issues": "https://github.com/gocardless/gocardless-pro-php/issues",
"source": "https://github.com/gocardless/gocardless-pro-php/tree/v4.18.0"
"source": "https://github.com/gocardless/gocardless-pro-php/tree/v4.19.0"
},
"time": "2022-07-08T14:38:42+00:00"
"time": "2022-07-13T14:44:43+00:00"
},
{
"name": "google/apiclient",
@ -3680,16 +3680,16 @@
},
{
"name": "laravel/framework",
"version": "v8.83.18",
"version": "v8.83.19",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "db8188e9cc8359a5c6706fa9d9f55aad7f235077"
"reference": "4264f2ee12330bdb1be050998f58ba7271236395"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/db8188e9cc8359a5c6706fa9d9f55aad7f235077",
"reference": "db8188e9cc8359a5c6706fa9d9f55aad7f235077",
"url": "https://api.github.com/repos/laravel/framework/zipball/4264f2ee12330bdb1be050998f58ba7271236395",
"reference": "4264f2ee12330bdb1be050998f58ba7271236395",
"shasum": ""
},
"require": {
@ -3849,7 +3849,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-06-28T14:30:38+00:00"
"time": "2022-07-13T13:23:09+00:00"
},
{
"name": "laravel/serializable-closure",
@ -5124,16 +5124,16 @@
},
{
"name": "microsoft/microsoft-graph",
"version": "1.71.0",
"version": "1.72.0",
"source": {
"type": "git",
"url": "https://github.com/microsoftgraph/msgraph-sdk-php.git",
"reference": "f17ae778614d6ebf326d33292d09519d39b017a8"
"reference": "2cf18e6f3e4519a2a749ce4656b6d3bcae1e1ac4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/f17ae778614d6ebf326d33292d09519d39b017a8",
"reference": "f17ae778614d6ebf326d33292d09519d39b017a8",
"url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/2cf18e6f3e4519a2a749ce4656b6d3bcae1e1ac4",
"reference": "2cf18e6f3e4519a2a749ce4656b6d3bcae1e1ac4",
"shasum": ""
},
"require": {
@ -5169,22 +5169,22 @@
"homepage": "https://developer.microsoft.com/en-us/graph",
"support": {
"issues": "https://github.com/microsoftgraph/msgraph-sdk-php/issues",
"source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.71.0"
"source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.72.0"
},
"time": "2022-07-07T10:04:08+00:00"
"time": "2022-07-12T16:45:29+00:00"
},
{
"name": "mollie/mollie-api-php",
"version": "v2.44.1",
"version": "v2.45.0",
"source": {
"type": "git",
"url": "https://github.com/mollie/mollie-api-php.git",
"reference": "5906cf9ff3133a4f47fea47624f3839ac07d0805"
"reference": "43ae5471967a47b34752b6b3a229038a05034527"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/5906cf9ff3133a4f47fea47624f3839ac07d0805",
"reference": "5906cf9ff3133a4f47fea47624f3839ac07d0805",
"url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/43ae5471967a47b34752b6b3a229038a05034527",
"reference": "43ae5471967a47b34752b6b3a229038a05034527",
"shasum": ""
},
"require": {
@ -5261,9 +5261,9 @@
],
"support": {
"issues": "https://github.com/mollie/mollie-api-php/issues",
"source": "https://github.com/mollie/mollie-api-php/tree/v2.44.1"
"source": "https://github.com/mollie/mollie-api-php/tree/v2.45.0"
},
"time": "2022-05-24T14:03:01+00:00"
"time": "2022-07-11T15:03:39+00:00"
},
{
"name": "moneyphp/money",
@ -6578,16 +6578,16 @@
},
{
"name": "php-http/discovery",
"version": "1.14.2",
"version": "1.14.3",
"source": {
"type": "git",
"url": "https://github.com/php-http/discovery.git",
"reference": "c8d48852fbc052454af42f6de27635ddd916b959"
"reference": "31d8ee46d0215108df16a8527c7438e96a4d7735"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-http/discovery/zipball/c8d48852fbc052454af42f6de27635ddd916b959",
"reference": "c8d48852fbc052454af42f6de27635ddd916b959",
"url": "https://api.github.com/repos/php-http/discovery/zipball/31d8ee46d0215108df16a8527c7438e96a4d7735",
"reference": "31d8ee46d0215108df16a8527c7438e96a4d7735",
"shasum": ""
},
"require": {
@ -6639,9 +6639,9 @@
],
"support": {
"issues": "https://github.com/php-http/discovery/issues",
"source": "https://github.com/php-http/discovery/tree/1.14.2"
"source": "https://github.com/php-http/discovery/tree/1.14.3"
},
"time": "2022-05-25T07:26:05+00:00"
"time": "2022-07-11T14:04:40+00:00"
},
{
"name": "php-http/guzzle7-adapter",
@ -12853,30 +12853,29 @@
},
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.6.8",
"version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "814b36a08a60f4159cdcbb1c466a6a0027440b6c"
"reference": "3372ed65e6d2039d663ed19aa699956f9d346271"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/814b36a08a60f4159cdcbb1c466a6a0027440b6c",
"reference": "814b36a08a60f4159cdcbb1c466a6a0027440b6c",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/3372ed65e6d2039d663ed19aa699956f9d346271",
"reference": "3372ed65e6d2039d663ed19aa699956f9d346271",
"shasum": ""
},
"require": {
"illuminate/routing": "^6|^7|^8|^9",
"illuminate/session": "^6|^7|^8|^9",
"illuminate/support": "^6|^7|^8|^9",
"illuminate/routing": "^7|^8|^9",
"illuminate/session": "^7|^8|^9",
"illuminate/support": "^7|^8|^9",
"maximebf/debugbar": "^1.17.2",
"php": ">=7.2",
"symfony/debug": "^4.3|^5|^6",
"symfony/finder": "^4.3|^5|^6"
"php": ">=7.2.5",
"symfony/finder": "^5|^6"
},
"require-dev": {
"mockery/mockery": "^1.3.3",
"orchestra/testbench-dusk": "^4|^5|^6|^7",
"orchestra/testbench-dusk": "^5|^6|^7",
"phpunit/phpunit": "^8.5|^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
@ -12922,7 +12921,7 @@
],
"support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.8"
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.7.0"
},
"funding": [
{
@ -12934,20 +12933,20 @@
"type": "github"
}
],
"time": "2022-06-08T15:03:05+00:00"
"time": "2022-07-11T09:26:42+00:00"
},
{
"name": "brianium/paratest",
"version": "v6.5.1",
"version": "v6.6.0",
"source": {
"type": "git",
"url": "https://github.com/paratestphp/paratest.git",
"reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9"
"reference": "bce7b965a5fe5028a53c3151042ca12777600acd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9",
"reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/bce7b965a5fe5028a53c3151042ca12777600acd",
"reference": "bce7b965a5fe5028a53c3151042ca12777600acd",
"shasum": ""
},
"require": {
@ -12962,18 +12961,18 @@
"phpunit/php-timer": "^5.0.3",
"phpunit/phpunit": "^9.5.21",
"sebastian/environment": "^5.1.4",
"symfony/console": "^5.4.9 || ^6.1.1",
"symfony/console": "^5.4.9 || ^6.1.2",
"symfony/process": "^5.4.8 || ^6.1.0"
},
"require-dev": {
"doctrine/coding-standard": "^9.0.0",
"ext-pcov": "*",
"ext-posix": "*",
"infection/infection": "^0.26.12",
"infection/infection": "^0.26.13",
"malukenho/mcbumpface": "^1.1.5",
"squizlabs/php_codesniffer": "^3.7.1",
"symfony/filesystem": "^5.4.9 || ^6.1.0",
"vimeo/psalm": "^4.23.0"
"vimeo/psalm": "^4.24.0"
},
"bin": [
"bin/paratest",
@ -13014,7 +13013,7 @@
],
"support": {
"issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v6.5.1"
"source": "https://github.com/paratestphp/paratest/tree/v6.6.0"
},
"funding": [
{
@ -13026,7 +13025,7 @@
"type": "paypal"
}
],
"time": "2022-06-24T16:02:27+00:00"
"time": "2022-07-12T07:15:58+00:00"
},
{
"name": "composer/pcre",
@ -13897,16 +13896,16 @@
},
{
"name": "laravel/dusk",
"version": "v6.24.0",
"version": "v6.25.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/dusk.git",
"reference": "7fed3695741787d9998c5f04c94adfd62d70e766"
"reference": "b4632b7493a187d31afc5c9ddec437c81b16421a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/dusk/zipball/7fed3695741787d9998c5f04c94adfd62d70e766",
"reference": "7fed3695741787d9998c5f04c94adfd62d70e766",
"url": "https://api.github.com/repos/laravel/dusk/zipball/b4632b7493a187d31afc5c9ddec437c81b16421a",
"reference": "b4632b7493a187d31afc5c9ddec437c81b16421a",
"shasum": ""
},
"require": {
@ -13964,9 +13963,9 @@
],
"support": {
"issues": "https://github.com/laravel/dusk/issues",
"source": "https://github.com/laravel/dusk/tree/v6.24.0"
"source": "https://github.com/laravel/dusk/tree/v6.25.0"
},
"time": "2022-05-09T13:43:52+00:00"
"time": "2022-07-11T11:38:43+00:00"
},
{
"name": "maximebf/debugbar",
@ -16155,75 +16154,6 @@
},
"time": "2021-10-14T14:25:14+00:00"
},
{
"name": "symfony/debug",
"version": "v4.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"psr/log": "^1|^2|^3"
},
"conflict": {
"symfony/http-kernel": "<3.4"
},
"require-dev": {
"symfony/http-kernel": "^3.4|^4.0|^5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/debug/tree/v4.4.41"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"abandoned": "symfony/error-handler",
"time": "2022-04-12T15:19:55+00:00"
},
{
"name": "symfony/polyfill-php70",
"version": "v1.20.0",

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.4.9',
'app_tag' => '5.4.9',
'app_version' => '5.4.10',
'app_tag' => '5.4.10',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''),
@ -194,5 +194,8 @@ return [
'ninja_apple_bundle_id' => env('APPLE_BUNDLE_ID', false),
'ninja_apple_issuer_id' => env('APPLE_ISSUER_ID', false),
'react_app_enabled' => env('REACT_APP_ENABLED', false),
'ninja_apple_client_id' => env('APPLE_CLIENT_ID', false),
'ninja_apple_client_secret' => env('APPLE_CLIENT_SECRET',false),
'ninja_apple_redirect_url' => env('APPLE_REDIRECT_URI',false),
];

View File

@ -39,6 +39,11 @@
{{ ctrans('texts.invoice_number') }}
</span>
</th>
<th class="px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-white uppercase border-b border-gray-200 bg-primary">
<span role="button" wire:click="sortBy('number')" class="cursor-pointer">
{{ ctrans('texts.po_number') }}
</span>
</th>
<th class="px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-white uppercase border-b border-gray-200 bg-primary">
<span role="button" wire:click="sortBy('date')" class="cursor-pointer">
{{ ctrans('texts.invoice_date') }}
@ -78,6 +83,9 @@
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
{{ $invoice->number }}
</td>
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
{{ $invoice->po_number }}
</td>
<td class="px-6 py-4 text-sm leading-5 text-gray-500 whitespace-nowrap">
{{ $invoice->translateDate($invoice->date, $invoice->client->date_format(), $invoice->client->locale()) }}
</td>

View File

@ -42,6 +42,7 @@ Route::group(['middleware' => ['throttle:100,1', 'api_db', 'token_auth', 'locale
Route::put('clients/{client}/adjust_ledger', 'ClientController@adjustLedger')->name('clients.adjust_ledger');
Route::put('clients/{client}/upload', 'ClientController@upload')->name('clients.upload');
Route::post('clients/{client}/purge', 'ClientController@purge')->name('clients.purge')->middleware('password_protected');
Route::post('clients/{client}/{mergeable_client}/merge', 'ClientController@merge')->name('clients.merge')->middleware('password_protected');
Route::post('clients/bulk', 'ClientController@bulk')->name('clients.bulk');
Route::post('filters/{entity}', 'FilterController@index')->name('filters');
@ -157,7 +158,7 @@ Route::group(['middleware' => ['throttle:100,1', 'api_db', 'token_auth', 'locale
Route::post('recurring_quotes/bulk', 'RecurringQuoteController@bulk')->name('recurring_quotes.bulk');
Route::put('recurring_quotes/{recurring_quote}/upload', 'RecurringQuoteController@upload');
Route::post('refresh', 'Auth\LoginController@refresh')->middleware('throttle:150,3');
Route::post('refresh', 'Auth\LoginController@refresh')->middleware('throttle:300,3');
Route::post('reports/clients', 'Reports\ClientReportController');
Route::post('reports/contacts', 'Reports\ClientContactReportController');