mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:07:33 -05:00 
			
		
		
		
	Fix for #1238
This commit is contained in:
		
							parent
							
								
									a23107830e
								
							
						
					
					
						commit
						2e6888a474
					
				@ -21,6 +21,7 @@
 | 
			
		||||
            ->method($method) !!}
 | 
			
		||||
    <div style="display:none">
 | 
			
		||||
        {!! Former::text('action') !!}
 | 
			
		||||
        {!! Former::text('data')->data_bind('value: ko.mapping.toJSON(model)') !!}
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
	@if ($expense)
 | 
			
		||||
@ -306,9 +307,8 @@
 | 
			
		||||
            @else
 | 
			
		||||
                // otherwise create blank model
 | 
			
		||||
                window.model = new ViewModel({!! $expense !!});
 | 
			
		||||
 | 
			
		||||
                ko.applyBindings(model);
 | 
			
		||||
            @endif
 | 
			
		||||
            ko.applyBindings(model);
 | 
			
		||||
 | 
			
		||||
            @if (!$expense && $clientPublicId)
 | 
			
		||||
                onClientChange();
 | 
			
		||||
@ -386,6 +386,11 @@
 | 
			
		||||
            self.convert_currency = ko.observable({{ ($expense && $expense->isExchanged()) ? 'true' : 'false' }});
 | 
			
		||||
            self.apply_taxes = ko.observable({{ ($expense && ($expense->tax_name1 || $expense->tax_name2)) ? 'true' : 'false' }});
 | 
			
		||||
 | 
			
		||||
            self.account_currency_id = ko.observable({{ $account->getCurrencyId() }});
 | 
			
		||||
            self.client_id = ko.observable({{ $clientPublicId }});
 | 
			
		||||
            self.vendor_id = ko.observable({{ $vendorPublicId }});
 | 
			
		||||
            self.expense_category_id = ko.observable({{ $categoryPublicId }});
 | 
			
		||||
 | 
			
		||||
            self.mapping = {
 | 
			
		||||
                'documents': {
 | 
			
		||||
                    create: function(options) {
 | 
			
		||||
@ -398,11 +403,6 @@
 | 
			
		||||
                ko.mapping.fromJS(data, self.mapping, this);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            self.account_currency_id = ko.observable({{ $account->getCurrencyId() }});
 | 
			
		||||
            self.client_id = ko.observable({{ $clientPublicId }});
 | 
			
		||||
            self.vendor_id = ko.observable({{ $vendorPublicId }});
 | 
			
		||||
            self.expense_category_id = ko.observable({{ $categoryPublicId }});
 | 
			
		||||
 | 
			
		||||
            self.convertedAmount = ko.computed({
 | 
			
		||||
                read: function () {
 | 
			
		||||
                    return roundToTwo(self.amount() * self.exchange_rate()).toFixed(2);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user