Merge pull request #1699 from SevanNerse/master

minor bugs fixed
This commit is contained in:
Cüneyt Şentürk 2020-12-28 12:45:03 +03:00 committed by GitHub
commit 1abb446f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 49 additions and 6 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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()

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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