Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23d49bb

Browse files
committed
Create & add another on PO created from orders
1 parent3136818 commit23d49bb

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

‎resources/views/purchase-order-lines/partials/fields.blade.php‎

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</td>
5656
</tr>
5757
@if($fromOrder)
58-
<trdata-number="{{$value}}"class="item-tr">
58+
{{--<tr data-number="{{ $value }}">
5959
<td colspan="5" class="border-0 pt-0 bind-select2-organisations" style="position: relative;">
6060
@include('laravel-crm::partials.form.select',[
6161
'name' => 'purchaseOrderLines['.$value.'][organisation_id]',
@@ -65,12 +65,12 @@
6565
],
6666
'value' => $this->organisation_id[$value] ?? null,
6767
'attributes' => [
68-
'wire:model'=>'organisation_idnpm .'.$value,
68+
'wire:model' => 'organisation_id .'.$value,
6969
'data-value' => $value
7070
]
7171
])
7272
</td>
73-
</tr>
73+
</tr>--}}
7474
@endif
7575
<trdata-number="{{$value}}"class="item-tr">
7676
<tdcolspan="2"class="border-0 pt-0">
@@ -84,7 +84,7 @@
8484
'wire:model'=>'price.'.$value,
8585
'wire:change'=>'calculateAmounts',
8686
'step'=>.01,
87-
'readonly'=>'readonly'
87+
/* 'readonly' => 'readonly'*/
8888
]
8989
])
9090
@else
@@ -103,7 +103,7 @@
103103
</td>
104104
<tdclass="border-0 pt-0">
105105
@if($fromOrder)
106-
@include('laravel-crm::partials.form.select',[
106+
{{--@include('laravel-crm::partials.form.select',[
107107
'name' => 'purchaseOrderLines['.$value.'][quantity]',
108108
'label' => ucfirst(__('laravel-crm::lang.quantity')),
109109
'options' => $this->order_quantities[$value],
@@ -113,6 +113,15 @@
113113
'data-value' => $value,
114114
'wire:change' => 'calculateAmounts'
115115
]
116+
])--}}
117+
@include('laravel-crm::partials.form.text',[
118+
'name'=>'purchaseOrderLines['.$value.'][quantity]',
119+
'label'=>ucfirst(__('laravel-crm::lang.quantity')),
120+
'type'=>'number',
121+
'attributes'=> [
122+
'wire:model'=>'quantity.'.$value,
123+
'wire:change'=>'calculateAmounts'
124+
]
116125
])
117126
@else
118127
@include('laravel-crm::partials.form.text',[
@@ -156,14 +165,21 @@
156165
<trdata-number="{{$value}}"class="item-tr">
157166
<tdcolspan="5"class="border-0 pt-0 pb-4">
158167
@if($fromOrder)
159-
@include('laravel-crm::partials.form.text',[
168+
{{-- @include('laravel-crm::partials.form.text',[
160169
'name' => 'purchaseOrderLines['.$value.'][comments]',
161170
'label' => ucfirst(__('laravel-crm::lang.comments')),
162171
'attributes' => [
163172
'wire:model' => 'comments.'.$value,
164173
'readonly' => 'readonly'
165174
]
166-
])
175+
])--}}
176+
@include('laravel-crm::partials.form.text',[
177+
'name'=>'purchaseOrderLines['.$value.'][comments]',
178+
'label'=>ucfirst(__('laravel-crm::lang.comments')),
179+
'attributes'=> [
180+
'wire:model'=>'comments.'.$value,
181+
]
182+
])
167183
@else
168184
@include('laravel-crm::partials.form.text',[
169185
'name'=>'purchaseOrderLines['.$value.'][comments]',

‎resources/views/purchase-orders/partials/card-create.blade.php‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@if(empty($order))
22
<formmethod="POST"action="{{url(route('laravel-crm.purchase-orders.store'))}}">
33
@else
4-
<formmethod="POST"action="{{url(route('laravel-crm.purchase-orders.store-multiple'))}}">
4+
<formmethod="POST"action="{{url(route('laravel-crm.purchase-orders.store'))}}?order={{$order->id}}">
55
@endif
66

77
@csrf
@@ -31,10 +31,8 @@
3131

3232
@component('laravel-crm::components.card-footer')
3333
<ahref="{{url(route('laravel-crm.purchase-orders.index'))}}"class="btn btn-outline-secondary">{{ucfirst(__('laravel-crm::lang.cancel'))}}</a>
34-
{{--
35-
<button type="submit" class="btn btn-primary">{{ ucfirst(__('laravel-crm::lang.create_and_add_another')) }}</button>
36-
--}}
37-
<buttontype="submit"class="btn btn-primary">{{ucfirst(__('laravel-crm::lang.create_purchase_order'))}}</button>
34+
<buttontype="submit"class="btn btn-primary"name="action"value="create_and_add_another">{{ucfirst(__('laravel-crm::lang.create_and_add_another'))}}</button>
35+
<buttontype="submit"class="btn btn-primary"name="action">{{ucfirst(__('laravel-crm::lang.create_purchase_order'))}}</button>
3836
@endcomponent
3937

4038
@endcomponent

‎resources/views/purchase-orders/partials/fields.blade.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
'name'=>'order_id',
55
'value'=>old('order_id',$invoice->order->id ??$order->id ??null),
66
])
7-
@empty($order)
87
<spanclass="autocomplete">
98
@include('laravel-crm::partials.form.hidden',[
109
'name'=>'person_id',
@@ -43,7 +42,6 @@
4342
'required'=>'true'
4443
])
4544
</span>
46-
@endempty
4745
<divclass="row">
4846
<divclass="col-sm-6">
4947
@include('laravel-crm::partials.form.text',[

‎src/Http/Controllers/PurchaseOrderController.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public function store(StorePurchaseOrderRequest $request)
137137

138138
flash(ucfirst(trans('laravel-crm::lang.purchase_order_created')))->success()->important();
139139

140+
if($request->action =='create_and_add_another') {
141+
returnredirect(route('laravel-crm.purchase-orders.create', ['model' =>'order','id' =>$request->order]));
142+
}
143+
140144
returnredirect(route('laravel-crm.purchase-orders.index'));
141145
}
142146

‎src/Http/Requests/StorePurchaseOrderRequest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public function rules()
3232
'currency' =>'required',
3333
];
3434

35-
if (!request('order_id')) {
36-
$rules['person_name'] ='required_without:organisation_name|max:255';
37-
$rules['organisation_name'] ='required_without:person_name|max:255';
38-
}
35+
//if (! request('order_id')) {
36+
$rules['person_name'] ='required_without:organisation_name|max:255';
37+
$rules['organisation_name'] ='required_without:person_name|max:255';
38+
//}
3939

4040
if(request('delivery_type') =='deliver') {
4141
$rules['delivery_address'] ='required';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp