Fixes for import

This commit is contained in:
David Bomba 2022-01-12 20:29:10 +11:00
parent 848cb6ae4c
commit c26387a376
3 changed files with 49 additions and 3 deletions

View File

@ -23,6 +23,43 @@ use Illuminate\Http\Response;
class StaticController extends BaseController
{
/**
* Show the list of Invoices.
*
* @param InvoiceFilters $filters The filters
*
* @return Response
*
* @OA\Get(
* path="/api/v1/statics",
* operationId="getStatics",
* tags={"statics"},
* summary="Gets a list of statics",
* description="Lists all statics",
*
* @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\Response(
* response=200,
* description="A list of static data",
* @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 __invoke()
{

View File

@ -1866,10 +1866,19 @@ class Import implements ShouldQueue
private function processNinjaTokens(array $data)
{
nlog("attempting to process Ninja Tokens");
if(Ninja::isHosted())
\Modules\Admin\Jobs\Account\NinjaUser::dispatchNow($data, $this->company);
if(Ninja::isHosted()){
try{
\Modules\Admin\Jobs\Account\NinjaUser::dispatchNow($data, $this->company);
}
catch(\Exception $e){
nlog($e->getMessage());
}
}
}

View File

@ -125,7 +125,7 @@ class AutoBillInvoice extends AbstractService
}
catch(\Exception $e){
nlog("payment NOT captured for ". $this->invoice->number . " with error " . $e->getMessage());
// nlog($e->getMessage());
$this->invoice->service()->removeUnpaidGatewayFees()->save();
}
if($payment){