mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for autobill
This commit is contained in:
parent
99920389b4
commit
0ec89c18ac
@ -34,7 +34,7 @@ class UpdateGroupSettingRequest extends Request
|
||||
{
|
||||
$rules['settings'] = new ValidClientGroupSettingsRule();
|
||||
|
||||
$rules['name'] = 'unique:group_settings,name,'.$this->id.',id,company_id,'.$this->group_setting->company_id;
|
||||
// $rules['name'] = 'unique:group_settings,name,'.$this->id.',id,company_id,'.$this->group_setting->company_id;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
@ -21,9 +21,12 @@ use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
|
||||
class Charge
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
/** @var StripePaymentDriver */
|
||||
public $stripe;
|
||||
|
||||
@ -39,7 +42,7 @@ class Charge
|
||||
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
||||
{
|
||||
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
||||
$invoice = sInvoice::whereIn('id', $this->transformKeys(array_column($payment_hash->invoices(), 'invoice_id')))->first();
|
||||
$invoice = Invoice::whereIn('id', $this->transformKeys(array_column($payment_hash->invoices(), 'invoice_id')))->first();
|
||||
|
||||
if ($invoice) {
|
||||
$description = "Invoice {$invoice->number} for {$amount} for client {$this->stripe->client->present()->name()}";
|
||||
|
@ -84,7 +84,7 @@ class AutoBillInvoice extends AbstractService
|
||||
/* Build payment hash */
|
||||
$payment_hash = PaymentHash::create([
|
||||
'hash' => Str::random(128),
|
||||
'data' => ['invoice_id' => $this->invoice->hashed_id, 'amount' => $amount],
|
||||
'data' => [['invoice_id' => $this->invoice->hashed_id, 'amount' => $amount]],
|
||||
'fee_total' => $fee,
|
||||
'fee_invoice_id' => $this->invoice->id,
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user