mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 14:44:46 -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
|
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()
|
public function rules()
|
||||||
@ -54,7 +57,7 @@ class StoreProductRequest extends Request
|
|||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
if (! isset($input['quantity']) || $input['quantity'] < 1) {
|
if (! isset($input['quantity'])) {
|
||||||
$input['quantity'] = 1;
|
$input['quantity'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class UpdateProductRequest extends Request
|
|||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
if (! isset($input['quantity']) || $input['quantity'] < 1) {
|
if (! isset($input['quantity'])) {
|
||||||
$input['quantity'] = 1;
|
$input['quantity'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class ProductTransformer extends EntityTransformer
|
|||||||
'notes' => $product->notes ?: '',
|
'notes' => $product->notes ?: '',
|
||||||
'cost' => (float) $product->cost ?: 0,
|
'cost' => (float) $product->cost ?: 0,
|
||||||
'price' => (float) $product->price ?: 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_name1' => $product->tax_name1 ?: '',
|
||||||
'tax_rate1' => (float) $product->tax_rate1 ?: 0,
|
'tax_rate1' => (float) $product->tax_rate1 ?: 0,
|
||||||
'tax_name2' => $product->tax_name2 ?: '',
|
'tax_name2' => $product->tax_name2 ?: '',
|
||||||
|
@ -28,12 +28,13 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@push('footer')
|
@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>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
paypal.Buttons({
|
paypal.Buttons({
|
||||||
|
fundingSource: "{{ $funding_options }}",
|
||||||
env: "{{ $gateway->company_gateway->getConfigField('testMode') ? 'sandbox' : 'production' }}",
|
env: "{{ $gateway->company_gateway->getConfigField('testMode') ? 'sandbox' : 'production' }}",
|
||||||
client: {
|
client: {
|
||||||
@if($gateway->company_gateway->getConfigField('testMode'))
|
@if($gateway->company_gateway->getConfigField('testMode'))
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
@push('footer')
|
@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>
|
<div id="paypal-button-container"></div>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user