diff --git a/.github/workflows/react_release.yml b/.github/workflows/react_release.yml index 2c795b37dd..e152890d2a 100644 --- a/.github/workflows/react_release.yml +++ b/.github/workflows/react_release.yml @@ -38,8 +38,6 @@ jobs: sudo php artisan cache:clear sudo find ./vendor/bin/ -type f -exec chmod +x {} \; sudo find ./ -type d -exec chmod 755 {} \; - sudo rm -f public/main.* - sudo rm -f public/flutter* - name: Prepare React FrontEnd run: | diff --git a/app/Helpers/Invoice/InvoiceSumInclusive.php b/app/Helpers/Invoice/InvoiceSumInclusive.php index 81028da5eb..5533f692ad 100644 --- a/app/Helpers/Invoice/InvoiceSumInclusive.php +++ b/app/Helpers/Invoice/InvoiceSumInclusive.php @@ -119,7 +119,7 @@ class InvoiceSumInclusive $this->total_custom_values += $this->valuer($this->invoice->custom_surcharge4); $this->total += $this->total_custom_values; - +nlog($this->total_taxes); return $this; } @@ -172,7 +172,8 @@ class InvoiceSumInclusive $this->total_taxes += $tax; $this->total_tax_map[] = ['name' => $this->invoice->tax_name3.' '.floatval($this->invoice->tax_rate3).'%', 'total' => $tax]; } - +nlog($this->total_taxes); +nlog($this->total_tax_map); return $this; } @@ -373,7 +374,7 @@ class InvoiceSumInclusive $this->total_taxes += $total_line_tax; } - +nlog($this->total_taxes); return $this; } diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 0c38823086..ce5be24555 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -685,7 +685,7 @@ class StripePaymentDriver extends BaseDriver //payment_intent.succeeded - this will confirm or cancel the payment if ($request->type === 'payment_intent.succeeded') { - PaymentIntentWebhook::dispatch($request->data, $request->company_key, $this->company_gateway->id)->delay(now()->addSeconds(rand(5, 10))); + PaymentIntentWebhook::dispatch($request->data, $request->company_key, $this->company_gateway->id)->delay(now()->addSeconds(rand(10, 15))); return response()->json([], 200); } diff --git a/tests/Unit/InvoiceInclusiveTest.php b/tests/Unit/InvoiceInclusiveTest.php index 0c557438cf..434dd3c974 100644 --- a/tests/Unit/InvoiceInclusiveTest.php +++ b/tests/Unit/InvoiceInclusiveTest.php @@ -105,18 +105,19 @@ class InvoiceInclusiveTest extends TestCase { $this->invoice->discount = 5; $this->invoice->custom_surcharge1 = 5; + $this->invoice->custom_surcharge_tax1 = false; $this->invoice->tax_name1 = 'GST'; $this->invoice->tax_rate1 = 10; $this->invoice->is_amount_discount = true; - - $this->invoice_calc = new InvoiceSumInclusive($this->invoice); - $this->invoice_calc->build(); + nlog($this->invoice->withoutRelations()->toArray()); - $this->assertEquals($this->invoice_calc->getSubTotal(), 20); - $this->assertEquals($this->invoice_calc->getTotalTaxes(), 1.36); - $this->assertEquals($this->invoice_calc->getTotal(), 20); - $this->assertEquals($this->invoice_calc->getBalance(), 20); + $calc = $this->invoice->calc(); + + $this->assertEquals($calc->getSubTotal(), 20); + $this->assertEquals($calc->getTotalTaxes(), 1.36); + $this->assertEquals($calc->getTotal(), 20); + $this->assertEquals($calc->getBalance(), 20); } public function testInvoiceTotalsWithPercentDiscountWithSurchargeWithInclusiveTax()