Merge Invoice and Bill into Document

This commit is contained in:
Burak Çakırel
2020-12-24 01:28:38 +03:00
parent 830cc05957
commit 0c1424db47
436 changed files with 31655 additions and 37350 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\Purchase;
use App\Models\Document\Document;
use App\Scopes\ReplaceDeprecatedColumns;
/**
* @deprecated
* @see Document
*/
class Bill extends Document
{
protected static function booted()
{
static::addGlobalScope(new ReplaceDeprecatedColumns);
}
public function getBillNumberAttribute($value)
{
return $this->document_number;
}
public function setBillNumberAttribute($value)
{
$this->attributes['document_number'] = $value;
}
public function getBilledAtAttribute($value)
{
return $this->issued_at;
}
public function setBilledAtAttribute($value)
{
$this->attributes['issued_at'] = $value;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models\Purchase;
use App\Models\Document\DocumentHistory;
/**
* @deprecated
* @see DocumentHistory
*/
class BillHistory extends DocumentHistory
{
public function getBillIdAttribute($value)
{
return $this->document_id;
}
public function setBillIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models\Purchase;
use App\Models\Document\DocumentItem;
/**
* @deprecated
* @see DocumentItem
*/
class BillItem extends DocumentItem
{
public function getBillIdAttribute($value)
{
return $this->document_id;
}
public function setBillIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models\Purchase;
use App\Models\Document\DocumentItemTax;
/**
* @deprecated
* @see DocumentItemTax
*/
class BillItemTax extends DocumentItemTax
{
public function getBillIdAttribute($value)
{
return $this->document_id;
}
public function setBillIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
public function getBillItemIdAttribute($value)
{
return $this->document_item_id;
}
public function setBillItemIdAttribute($value)
{
$this->attributes['document_item_id'] = $value;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models\Purchase;
use App\Models\Document\DocumentTotal;
/**
* @deprecated
* @see DocumentTotal
*/
class BillTotal extends DocumentTotal
{
public function getBillIdAttribute($value)
{
return $this->document_id;
}
public function setBillIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\Sale;
use App\Models\Document\Document;
use App\Scopes\ReplaceDeprecatedColumns;
/**
* @deprecated
* @see Document
*/
class Invoice extends Document
{
protected static function booted()
{
static::addGlobalScope(new ReplaceDeprecatedColumns);
}
public function setInvoiceNumberAttribute($value)
{
$this->attributes['document_number'] = $value;
}
public function getInvoiceNumberAttribute($value)
{
return $this->document_number;
}
public function setInvoicedAtAttribute($value)
{
$this->attributes['issued_at'] = $value;
}
public function getInvoicedAtAttribute($value)
{
return $this->issued_at;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models\Sale;
use App\Models\Document\DocumentHistory;
/**
* @deprecated
* @see DocumentHistory
*/
class InvoiceHistory extends DocumentHistory
{
public function getInvoiceIdAttribute($value)
{
return $this->document_id;
}
public function setInvoiceIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models\Sale;
use App\Models\Document\DocumentItem;
/**
* @deprecated
* @see DocumentItem
*/
class InvoiceItem extends DocumentItem
{
public function getInvoiceIdAttribute($value)
{
return $this->document_id;
}
public function setInvoiceIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models\Sale;
use App\Models\Document\DocumentItemTax;
/**
* @deprecated
* @see DocumentItemTax
*/
class InvoiceItemTax extends DocumentItemTax
{
public function getInvoiceIdAttribute($value)
{
return $this->document_id;
}
public function setInvoiceIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
public function getInvoiceItemIdAttribute($value)
{
return $this->document_item_id;
}
public function setInvoiceItemIdAttribute($value)
{
$this->attributes['document_item_id'] = $value;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models\Sale;
use App\Models\Document\DocumentTotal;
/**
* @deprecated
* @see DocumentTotal
*/
class InvoiceTotal extends DocumentTotal
{
public function getInvoiceIdAttribute($value)
{
return $this->document_id;
}
public function setInvoiceIdAttribute($value)
{
$this->attributes['document_id'] = $value;
}
}