mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #7205 from turbo124/v5-develop
Disable autocomplete on expiry date of wepay credit cards
This commit is contained in:
commit
082da68497
@ -94,11 +94,8 @@ class InvoiceItemSum
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't round the cost x qty - will allow us to use higher precision costs */
|
|
||||||
private function sumLineItem()
|
private function sumLineItem()
|
||||||
{ //todo need to support quantities less than the precision amount
|
{
|
||||||
// $this->setLineTotal($this->formatValue($this->item->cost, $this->currency->precision) * $this->formatValue($this->item->quantity, $this->currency->precision));
|
|
||||||
|
|
||||||
$this->setLineTotal($this->item->cost * $this->item->quantity);
|
$this->setLineTotal($this->item->cost * $this->item->quantity);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -87,7 +87,10 @@ class InvoiceItemSumInclusive
|
|||||||
|
|
||||||
private function sumLineItem()
|
private function sumLineItem()
|
||||||
{
|
{
|
||||||
$this->setLineTotal($this->formatValue($this->item->cost, $this->currency->precision) * $this->formatValue($this->item->quantity, $this->currency->precision));
|
$this->setLineTotal($this->item->cost * $this->item->quantity);
|
||||||
|
|
||||||
|
//11-02-2022
|
||||||
|
// $this->setLineTotal($this->formatValue($this->item->cost, $this->currency->precision) * $this->formatValue($this->item->quantity, $this->currency->precision));
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,11 @@ class QuoteController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(count($ids) == 1){
|
if(count($ids) == 1){
|
||||||
|
|
||||||
|
//forward client to the invoice if it exists
|
||||||
|
if($quote->invoice()->exists())
|
||||||
|
return redirect()->route('client.invoice.show', $quote->invoice->hashed_id);
|
||||||
|
|
||||||
return redirect()->route('client.quote.show', $quotes->first()->hashed_id);
|
return redirect()->route('client.quote.show', $quotes->first()->hashed_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,6 +387,9 @@ class PreviewController extends BaseController
|
|||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
'company_id' => auth()->user()->company()->id,
|
'company_id' => auth()->user()->company()->id,
|
||||||
'client_id' => $client->id,
|
'client_id' => $client->id,
|
||||||
|
'terms' => 'Sample Terms',
|
||||||
|
'footer' => 'Sample Footer',
|
||||||
|
'public_notes' => 'Sample Public Notes',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invitation = InvoiceInvitation::factory()->create([
|
$invitation = InvoiceInvitation::factory()->create([
|
||||||
|
@ -243,6 +243,9 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
$data['$invoice.po_number'] = ['value' => $this->formatPoNumber(), 'label' => ctrans('texts.po_number')];
|
$data['$invoice.po_number'] = ['value' => $this->formatPoNumber(), 'label' => ctrans('texts.po_number')];
|
||||||
$data['$poNumber'] = &$data['$invoice.po_number'];
|
$data['$poNumber'] = &$data['$invoice.po_number'];
|
||||||
|
|
||||||
|
$arrKeysLength = array_map('strlen', array_keys($data));
|
||||||
|
array_multisort($arrKeysLength, SORT_DESC, $data);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ class Gateway extends StaticModel
|
|||||||
break;
|
break;
|
||||||
case 56:
|
case 56:
|
||||||
return [
|
return [
|
||||||
GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true],
|
GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true, 'webhooks' => ['payment_intent.succeeded']],
|
||||||
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable','charge.succeeded']],
|
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable','charge.succeeded']],
|
||||||
GatewayType::ALIPAY => ['refund' => false, 'token_billing' => false],
|
GatewayType::ALIPAY => ['refund' => false, 'token_billing' => false],
|
||||||
GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false],
|
GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false],
|
||||||
|
@ -159,10 +159,10 @@ class Quote extends BaseModel
|
|||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function contacts()
|
public function invoice()
|
||||||
// {
|
{
|
||||||
// return $this->hasManyThrough(ClientContact::class, Client::class);
|
return $this->belongsTo(Invoice::class)->withTrashed();
|
||||||
// }
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user()
|
||||||
{
|
{
|
||||||
|
2
public/css/app.css
vendored
2
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@
|
|||||||
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=dd6a49267dfe156c3bc9",
|
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=dd6a49267dfe156c3bc9",
|
||||||
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=a334dd9257dd510a1feb",
|
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=a334dd9257dd510a1feb",
|
||||||
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=37950e8a39281d2f596a",
|
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=37950e8a39281d2f596a",
|
||||||
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=ba4d5b7175117ababdb2",
|
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=916457009e78696019a5",
|
||||||
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=8328c6c32a65cd3e8a3d",
|
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=8328c6c32a65cd3e8a3d",
|
||||||
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=59d9913b746fe5a540ff",
|
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=59d9913b746fe5a540ff",
|
||||||
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=c2cf632fb3cc91b4ff7c",
|
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=c2cf632fb3cc91b4ff7c",
|
||||||
@ -38,7 +38,7 @@
|
|||||||
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=e240b907ad163cac04c0",
|
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=e240b907ad163cac04c0",
|
||||||
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=71e49866d66a6d85b88a",
|
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=71e49866d66a6d85b88a",
|
||||||
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=3a1cac8fb671c2e4337f",
|
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=3a1cac8fb671c2e4337f",
|
||||||
"/css/app.css": "/css/app.css?id=cab8a6526b0f9f71842d",
|
"/css/app.css": "/css/app.css?id=daf6d6885d24b59775d5",
|
||||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad",
|
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad",
|
||||||
"/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=ad98572d415d2f245284"
|
"/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=ad98572d415d2f245284"
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,12 @@ class WePayCreditCard {
|
|||||||
|
|
||||||
completePaymentWithoutToken() {
|
completePaymentWithoutToken() {
|
||||||
if (!this.validateCreditCardFields()) {
|
if (!this.validateCreditCardFields()) {
|
||||||
|
|
||||||
|
this.payNowButton = document.getElementById('pay-now');
|
||||||
|
this.payNowButton.disabled = false;
|
||||||
|
this.payNowButton.querySelector('svg').classList.add('hidden');
|
||||||
|
this.payNowButton.querySelector('span').classList.remove('hidden');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +174,6 @@ class WePayCreditCard {
|
|||||||
.getElementById('pay-now')
|
.getElementById('pay-now')
|
||||||
.addEventListener('click', () => {
|
.addEventListener('click', () => {
|
||||||
this.payNowButton = document.getElementById('pay-now');
|
this.payNowButton = document.getElementById('pay-now');
|
||||||
|
|
||||||
this.payNowButton.disabled = true;
|
this.payNowButton.disabled = true;
|
||||||
this.payNowButton.querySelector('svg').classList.remove('hidden');
|
this.payNowButton.querySelector('svg').classList.remove('hidden');
|
||||||
this.payNowButton.querySelector('span').classList.add('hidden');
|
this.payNowButton.querySelector('span').classList.add('hidden');
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
<select
|
<select
|
||||||
id="shipping_country"
|
id="shipping_country"
|
||||||
class="input w-full form-select"
|
class="input w-full form-select"
|
||||||
name="shipping_country">
|
name="country_id">
|
||||||
<option value="none"></option>
|
<option value="none"></option>
|
||||||
@foreach(App\Utils\TranslationHelper::getCountries() as $country)
|
@foreach(App\Utils\TranslationHelper::getCountries() as $country)
|
||||||
<option
|
<option
|
||||||
|
@ -86,7 +86,7 @@ class InvoiceTest extends TestCase
|
|||||||
public function testInvoiceTotalsWithDiscountWithSurcharge()
|
public function testInvoiceTotalsWithDiscountWithSurcharge()
|
||||||
{
|
{
|
||||||
$this->invoice->discount = 5;
|
$this->invoice->discount = 5;
|
||||||
$this->invoice->custom_value1 = 5;
|
$this->invoice->custom_surcharge1 = 5;
|
||||||
|
|
||||||
$this->invoice_calc->build();
|
$this->invoice_calc->build();
|
||||||
|
|
||||||
@ -98,21 +98,21 @@ class InvoiceTest extends TestCase
|
|||||||
public function testInvoiceTotalsWithDiscountWithSurchargeWithInclusiveTax()
|
public function testInvoiceTotalsWithDiscountWithSurchargeWithInclusiveTax()
|
||||||
{
|
{
|
||||||
$this->invoice->discount = 5;
|
$this->invoice->discount = 5;
|
||||||
$this->invoice->custom_value1 = 5;
|
$this->invoice->custom_surcharge1 = 5;
|
||||||
$this->invoice->tax_name1 = 'GST';
|
$this->invoice->tax_name1 = 'GST';
|
||||||
$this->invoice->tax_rate1 = 10;
|
$this->invoice->tax_rate1 = 10;
|
||||||
|
|
||||||
$this->invoice_calc->build();
|
$this->invoice_calc->build();
|
||||||
|
|
||||||
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotal(), 20);
|
// $this->assertEquals($this->invoice_calc->getTotal(), 21.5);
|
||||||
//$this->assertEquals($this->invoice_calc->getBalance(), 20);
|
//$this->assertEquals($this->invoice_calc->getBalance(), 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInvoiceTotalsWithDiscountWithSurchargeWithExclusiveTax()
|
public function testInvoiceTotalsWithDiscountWithSurchargeWithExclusiveTax()
|
||||||
{
|
{
|
||||||
$this->invoice->discount = 5;
|
$this->invoice->discount = 5;
|
||||||
$this->invoice->custom_value1 = 5;
|
$this->invoice->custom_surcharge1 = 5;
|
||||||
$this->invoice->tax_name1 = 'GST';
|
$this->invoice->tax_name1 = 'GST';
|
||||||
$this->invoice->tax_rate1 = 10;
|
$this->invoice->tax_rate1 = 10;
|
||||||
$this->invoice->uses_inclusive_taxes = false;
|
$this->invoice->uses_inclusive_taxes = false;
|
||||||
@ -124,7 +124,7 @@ class InvoiceTest extends TestCase
|
|||||||
|
|
||||||
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
||||||
// $this->assertEquals($this->invoice_calc->getGrossSubTotal(), 22);
|
// $this->assertEquals($this->invoice_calc->getGrossSubTotal(), 22);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotal(), 21.5);
|
$this->assertEquals($this->invoice_calc->getTotal(), 21.5);
|
||||||
//$this->assertEquals($this->invoice_calc->getBalance(), 21.5);
|
//$this->assertEquals($this->invoice_calc->getBalance(), 21.5);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotalTaxes(), 1.5);
|
//$this->assertEquals($this->invoice_calc->getTotalTaxes(), 1.5);
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ class InvoiceTest extends TestCase
|
|||||||
$this->invoice_calc = new InvoiceSum($this->invoice);
|
$this->invoice_calc = new InvoiceSum($this->invoice);
|
||||||
|
|
||||||
$this->invoice->discount = 5;
|
$this->invoice->discount = 5;
|
||||||
$this->invoice->custom_value1 = 5;
|
$this->invoice->custom_surcharge1 = 5;
|
||||||
$this->invoice->tax_name1 = 'GST';
|
$this->invoice->tax_name1 = 'GST';
|
||||||
$this->invoice->tax_rate1 = 10;
|
$this->invoice->tax_rate1 = 10;
|
||||||
$this->invoice->tax_name2 = 'GST';
|
$this->invoice->tax_name2 = 'GST';
|
||||||
@ -144,7 +144,7 @@ class InvoiceTest extends TestCase
|
|||||||
$this->invoice_calc->build();
|
$this->invoice_calc->build();
|
||||||
|
|
||||||
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotal(), 23);
|
$this->assertEquals($this->invoice_calc->getTotal(), 23);
|
||||||
//$this->assertEquals($this->invoice_calc->getBalance(), 23);
|
//$this->assertEquals($this->invoice_calc->getBalance(), 23);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotalTaxes(), 3);
|
//$this->assertEquals($this->invoice_calc->getTotalTaxes(), 3);
|
||||||
}
|
}
|
||||||
@ -217,8 +217,8 @@ class InvoiceTest extends TestCase
|
|||||||
$this->invoice_calc->build();
|
$this->invoice_calc->build();
|
||||||
|
|
||||||
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
$this->assertEquals($this->invoice_calc->getSubTotal(), 20);
|
||||||
$this->assertEquals($this->invoice_calc->getGrossSubTotal(), 22);
|
// $this->assertEquals($this->invoice_calc->getGrossSubTotal(), 22);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotal(), 26);
|
$this->assertEquals($this->invoice_calc->getTotal(), 26);
|
||||||
//$this->assertEquals($this->invoice_calc->getBalance(), 26);
|
//$this->assertEquals($this->invoice_calc->getBalance(), 26);
|
||||||
//$this->assertEquals($this->invoice_calc->getTotalTaxes(), 4);
|
//$this->assertEquals($this->invoice_calc->getTotalTaxes(), 4);
|
||||||
//$this->assertEquals(count($this->invoice_calc->getTaxMap()), 1);
|
//$this->assertEquals(count($this->invoice_calc->getTaxMap()), 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user