diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4ba49439c45d..b0002daf3d79 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -27,7 +27,6 @@ use App\Jobs\Subscription\CleanStaleInvoiceOrder; use App\Jobs\Util\DiskCleanup; use App\Jobs\Util\ReminderJob; use App\Jobs\Util\SchedulerCheck; -use App\Jobs\Util\SendFailedEmails; use App\Jobs\Util\UpdateExchangeRates; use App\Jobs\Util\VersionCheck; use App\Models\Account; diff --git a/app/DataMapper/Tax/ZipTax/Response.php b/app/DataMapper/Tax/ZipTax/Response.php new file mode 100644 index 000000000000..dfeea6e1f1cd --- /dev/null +++ b/app/DataMapper/Tax/ZipTax/Response.php @@ -0,0 +1,66 @@ + [ + * [ + * "geoPostalCode" => "92582", + * "geoCity" => "SAN JACINTO", + * "geoCounty" => "RIVERSIDE", + * "geoState" => "CA", + * "taxSales" => 0.0875, + * "taxUse" => 0.0875, + * "txbService" => "N", + * "txbFreight" => "N", + * "stateSalesTax" => 0.06, + * "stateUseTax" => 0.06, + * "citySalesTax" => 0.01, + * "cityUseTax" => 0.01, + * "cityTaxCode" => "874", + * "countySalesTax" => 0.0025, + * "countyUseTax" => 0.0025, + * "countyTaxCode" => "", + * "districtSalesTax" => 0.015, + * "districtUseTax" => 0.015, + * "district1Code" => "26", + * "district1SalesTax" => 0, + * "district1UseTax" => 0, + * "district2Code" => "26", + * "district2SalesTax" => 0.005, + * "district2UseTax" => 0.005, + * "district3Code" => "", + * "district3SalesTax" => 0, + * "district3UseTax" => 0, + * "district4Code" => "33", + * "district4SalesTax" => 0.01, + * "district4UseTax" => 0.01, + * "district5Code" => "", + * "district5SalesTax" => 0, + * "district5UseTax" => 0, + * "originDestination" => "D", + * ], + * ] + * ]; + * + * @var mixed[] + */ + public array $results = []; + +} + diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 268b54e71d9d..6afe275e37b0 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -154,7 +154,7 @@ class AccountController extends BaseController $truth->setUser(auth()->user()); $truth->setCompany($ct->first()->company); - return $this->listResponse($ct->fresh()); + return $this->listResponse($ct); } public function update(UpdateAccountRequest $request, Account $account) diff --git a/app/Http/ViewComposers/PortalComposer.php b/app/Http/ViewComposers/PortalComposer.php index 1a318e0e3f5b..4ab484917709 100644 --- a/app/Http/ViewComposers/PortalComposer.php +++ b/app/Http/ViewComposers/PortalComposer.php @@ -138,9 +138,9 @@ class PortalComposer $data[] = ['title' => ctrans('texts.subscriptions'), 'url' => 'client.subscriptions.index', 'icon' => 'calendar']; } - if (property_exists($this->settings, 'client_initiated_payments') && $this->settings->client_initiated_payments) { + // if (property_exists($this->settings, 'client_initiated_payments') && $this->settings->client_initiated_payments) { $data[] = ['title' => ctrans('texts.pre_payment'), 'url' => 'client.pre_payments.index', 'icon' => 'dollar-sign']; - } + // } return $data; } diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index 8c7a8d6a42cc..4bb756ad7e32 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -126,6 +126,8 @@ class CreateAccount NinjaMailerJob::dispatch($nmo, true); + // \Modules\Admin\Jobs\Account\NinjaUser::dispatch([], $sp035a66); + (new \Modules\Admin\Jobs\Account\NinjaUser([], $sp035a66))->handle(); } diff --git a/app/Services/Invoice/ApplyNumber.php b/app/Services/Invoice/ApplyNumber.php index 7ac46b942e04..f566c3480011 100644 --- a/app/Services/Invoice/ApplyNumber.php +++ b/app/Services/Invoice/ApplyNumber.php @@ -40,8 +40,8 @@ class ApplyNumber extends AbstractService return $this->invoice; } - /** Do no give pro forma invoices a proper invoice number */ - if ($this->invoice->is_proforma) { + /** Do not give a pro forma invoice a proper invoice number */ + if ($this->invoice->is_proforma && $this->invoice->recurring_id) { $this->invoice->number = ctrans('texts.pre_payment') . " " . now()->format('Y-m-d : H:i:s'); $this->invoice->saveQuietly(); return $this->invoice; diff --git a/tests/Unit/Tax/SumTaxTest.php b/tests/Unit/Tax/SumTaxTest.php new file mode 100644 index 000000000000..a68bc13679e5 --- /dev/null +++ b/tests/Unit/Tax/SumTaxTest.php @@ -0,0 +1,86 @@ +withoutMiddleware( + ThrottleRequests::class + ); + + $this->withoutExceptionHandling(); + + // $this->makeTestData(); + } + + public function testSumOfInvoice() + { + + $response = + ["results" => [ + [ + "geoPostalCode" => "92582", + "geoCity" => "SAN JACINTO", + "geoCounty" => "RIVERSIDE", + "geoState" => "CA", + "taxSales" => 0.0875, + "taxUse" => 0.0875, + "txbService" => "N", + "txbFreight" => "N", + "stateSalesTax" => 0.06, + "stateUseTax" => 0.06, + "citySalesTax" => 0.01, + "cityUseTax" => 0.01, + "cityTaxCode" => "874", + "countySalesTax" => 0.0025, + "countyUseTax" => 0.0025, + "countyTaxCode" => "", + "districtSalesTax" => 0.015, + "districtUseTax" => 0.015, + "district1Code" => "26", + "district1SalesTax" => 0, + "district1UseTax" => 0, + "district2Code" => "26", + "district2SalesTax" => 0.005, + "district2UseTax" => 0.005, + "district3Code" => "", + "district3SalesTax" => 0, + "district3UseTax" => 0, + "district4Code" => "33", + "district4SalesTax" => 0.01, + "district4UseTax" => 0.01, + "district5Code" => "", + "district5SalesTax" => 0, + "district5UseTax" => 0, + "originDestination" => "D", + ], + ] + ]; + + nlog($response); + } +} \ No newline at end of file