Document multi currency and edit currency rate issue solved..
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
namespace App\View\Components\Documents\Form;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentForm as Component;
|
||||
use App\Models\Setting\Currency;
|
||||
use App\Models\Setting\Tax;
|
||||
|
||||
class Items extends Component
|
||||
@ -15,10 +14,8 @@ class Items extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$currency = Currency::where('code', setting('default.currency'))->first();
|
||||
|
||||
$taxes = Tax::enabled()->orderBy('name')->get();
|
||||
|
||||
return view('components.documents.form.items', compact('currency', 'taxes'));
|
||||
return view('components.documents.form.items', compact('taxes'));
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\View\Components\Documents\Form;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentForm as Component;
|
||||
use App\Models\Setting\Currency;
|
||||
|
||||
class Totals extends Component
|
||||
{
|
||||
@ -14,9 +13,6 @@ class Totals extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$currencies = Currency::enabled()->pluck('name', 'code');
|
||||
$currency = Currency::where('code', setting('default.currency'))->first();
|
||||
|
||||
return view('components.documents.form.totals', compact('currencies', 'currency'));
|
||||
return view('components.documents.form.totals');
|
||||
}
|
||||
}
|
||||
|
@ -18,10 +18,14 @@ class Script extends Component
|
||||
/** @var string */
|
||||
public $version;
|
||||
|
||||
public $document;
|
||||
|
||||
public $items;
|
||||
|
||||
public $currencies;
|
||||
|
||||
public $currency_code;
|
||||
|
||||
public $taxes;
|
||||
|
||||
/**
|
||||
@ -29,13 +33,15 @@ class Script extends Component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(string $type = '', string $scriptFile = '', string $version = '', $items = [], $currencies = [], $taxes = [])
|
||||
public function __construct(string $type = '', string $scriptFile = '', string $version = '', $document = false, $items = [], $currencies = [], $taxes = [])
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->scriptFile = ($scriptFile) ? $scriptFile : 'public/js/common/documents.js';
|
||||
$this->version = $this->getVersion($version);
|
||||
$this->document = $document;
|
||||
$this->items = $items;
|
||||
$this->currencies = $this->getCurrencies($currencies);
|
||||
$this->currency_code = ($document) ? $document->currency_code : setting('default.currency');
|
||||
$this->taxes = $this->getTaxes($taxes);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user