commit
1abb446f93
@ -17,7 +17,7 @@ class DocumentHistory extends Model
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Document\Document');
|
||||
return $this->belongsTo('App\Models\Document\Document')->where('type', $this->type);
|
||||
}
|
||||
|
||||
public function scopeType(Builder $query, string $type)
|
||||
|
@ -61,7 +61,7 @@ class DocumentItem extends Model
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Document\Document');
|
||||
return $this->belongsTo('App\Models\Document\Document')->where('type', $this->type);
|
||||
}
|
||||
|
||||
public function item()
|
||||
@ -126,7 +126,7 @@ class DocumentItem extends Model
|
||||
$tax_ids = [];
|
||||
|
||||
foreach ($this->taxes as $tax) {
|
||||
$tax_ids[] = (string)$tax->tax_id;
|
||||
$tax_ids[] = (string) $tax->tax_id;
|
||||
}
|
||||
|
||||
$this->setAttribute('tax_ids', $tax_ids);
|
||||
|
@ -6,7 +6,6 @@ use App\Abstracts\Model;
|
||||
use App\Traits\Currencies;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Znck\Eloquent\Relations\BelongsToThrough as BelongsToThroughRelation;
|
||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
|
||||
class DocumentItemTax extends Model
|
||||
@ -28,7 +27,7 @@ class DocumentItemTax extends Model
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Document\Document');
|
||||
return $this->belongsTo('App\Models\Document\Document')->where('type', $this->type);
|
||||
}
|
||||
|
||||
public function item()
|
||||
|
@ -29,7 +29,7 @@ class DocumentTotal extends Model
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Document\Document');
|
||||
return $this->belongsTo('App\Models\Document\Document')->where('type', $this->type);
|
||||
}
|
||||
|
||||
public function scopeType(Builder $query, string $type)
|
||||
|
@ -601,6 +601,10 @@ const app = new Vue({
|
||||
this.onCalculateTotal();
|
||||
},
|
||||
|
||||
onBindingItemField(item_index, field_name) {
|
||||
this.form.items[item_index][field_name] = this.items[item_index][field_name];
|
||||
},
|
||||
|
||||
async onPayment() {
|
||||
let document_id = document.getElementById('document_id').value;
|
||||
|
||||
|
@ -67,6 +67,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -45,6 +45,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -69,6 +69,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -47,6 +47,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -61,6 +61,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -39,6 +39,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -63,6 +63,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -41,6 +41,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -63,6 +63,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
@ -41,6 +41,10 @@
|
||||
@change="{{ $attributes['change'] }}($event)"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['visible-change']))
|
||||
@visible-change="{{ $attributes['visible-change'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['readonly']))
|
||||
:readonly="{{ $attributes['readonly'] }}"
|
||||
@endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user