Merge Invoice and Bill into Document
This commit is contained in:
38
modules/BC21/Models/Sale/Invoice.php
Normal file
38
modules/BC21/Models/Sale/Invoice.php
Normal 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;
|
||||
}
|
||||
}
|
22
modules/BC21/Models/Sale/InvoiceHistory.php
Normal file
22
modules/BC21/Models/Sale/InvoiceHistory.php
Normal 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;
|
||||
}
|
||||
}
|
22
modules/BC21/Models/Sale/InvoiceItem.php
Normal file
22
modules/BC21/Models/Sale/InvoiceItem.php
Normal 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;
|
||||
}
|
||||
}
|
32
modules/BC21/Models/Sale/InvoiceItemTax.php
Normal file
32
modules/BC21/Models/Sale/InvoiceItemTax.php
Normal 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;
|
||||
}
|
||||
}
|
22
modules/BC21/Models/Sale/InvoiceTotal.php
Normal file
22
modules/BC21/Models/Sale/InvoiceTotal.php
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user