mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Adjustments for default quantities
This commit is contained in:
parent
46eb525189
commit
820c76ea4d
@ -23,7 +23,10 @@ class StoreProductRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth()->user()->can('create', Product::class);
|
||||
/** @var \App\Models\User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
return $user->can('create', Product::class);
|
||||
}
|
||||
|
||||
public function rules()
|
||||
@ -54,7 +57,7 @@ class StoreProductRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if (! isset($input['quantity']) || $input['quantity'] < 1) {
|
||||
if (! isset($input['quantity'])) {
|
||||
$input['quantity'] = 1;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ class UpdateProductRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if (! isset($input['quantity']) || $input['quantity'] < 1) {
|
||||
if (! isset($input['quantity'])) {
|
||||
$input['quantity'] = 1;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ class ProductTransformer extends EntityTransformer
|
||||
'notes' => $product->notes ?: '',
|
||||
'cost' => (float) $product->cost ?: 0,
|
||||
'price' => (float) $product->price ?: 0,
|
||||
'quantity' => (float) $product->quantity ?: 1.0,
|
||||
'quantity' => (float) is_numeric($product->quantity) ? $product->quantity : 1.0,
|
||||
'tax_name1' => $product->tax_name1 ?: '',
|
||||
'tax_rate1' => (float) $product->tax_rate1 ?: 0,
|
||||
'tax_name2' => $product->tax_name2 ?: '',
|
||||
|
@ -28,12 +28,13 @@
|
||||
@endsection
|
||||
|
||||
@push('footer')
|
||||
<script src="https://www.paypal.com/sdk/js?enable-funding={!! $funding_options !!}&disable-funding=credit&components=buttons,hosted-fields,funding-eligibility&intent=capture&client-id={!! $client_id !!}" data-client-token="{!! $token !!}">
|
||||
<script src="https://www.paypal.com/sdk/js?enable-funding={!! $funding_options !!}&disable-funding=credit&components=buttons,hosted-fields,funding-eligibility&intent=capture&client-id={!! $client_id !!}&buyer-country=US¤cy=USD" data-client-token="{!! $token !!}">
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
paypal.Buttons({
|
||||
fundingSource: "{{ $funding_options }}",
|
||||
env: "{{ $gateway->company_gateway->getConfigField('testMode') ? 'sandbox' : 'production' }}",
|
||||
client: {
|
||||
@if($gateway->company_gateway->getConfigField('testMode'))
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
@push('footer')
|
||||
|
||||
<script src="https://www.paypal.com/sdk/js?client-id={!! $client_id !!}¤cy={!! $currency !!}&merchant-id={!! $merchantId !!}&components=buttons,funding-eligibility&intent=capture" data-partner-attribution-id="invoiceninja_SP_PPCP"></script>
|
||||
<script src="https://www.paypal.com/sdk/js?client-id={!! $client_id !!}¤cy={!! $currency !!}&merchant-id={!! $merchantId !!}&components=buttons,funding-eligibility&intent=capture&enable-funding={!! $funding_source !!}" data-partner-attribution-id="invoiceninja_SP_PPCP"></script>
|
||||
<div id="paypal-button-container"></div>
|
||||
<script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user