mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Release transactions on failures
This commit is contained in:
parent
bc76424fd7
commit
3a6258fd42
@ -309,6 +309,10 @@ class BaseImport
|
||||
);
|
||||
}
|
||||
} catch (\Exception $ex) {
|
||||
|
||||
if(\DB::connection(config('database.default'))->transactionLevel() > 0)
|
||||
\DB::connection(config('database.default'))->rollBack();
|
||||
|
||||
if ($ex instanceof ImportException) {
|
||||
$message = $ex->getMessage();
|
||||
} else {
|
||||
|
@ -445,7 +445,7 @@ class StripePaymentDriver extends BaseDriver
|
||||
|
||||
if(count($searchResults) == 1){
|
||||
$customer = $searchResults->data[0];
|
||||
$this->updateStripeCustomer($customer);
|
||||
// $this->updateStripeCustomer($customer);
|
||||
return $customer;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ class MarkPaid extends AbstractService
|
||||
/* Get the last record for the client and set the current balance*/
|
||||
$client = Client::where('id', $this->invoice->client_id)->lockForUpdate()->first();
|
||||
$client->paid_to_date += $payment->amount;
|
||||
$client->balance += $payment->amount * -1;
|
||||
$client->balance -= $payment->amount;
|
||||
$client->save();
|
||||
|
||||
}, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user