mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Don’t show default tax rate until tax rates have been created
This commit is contained in:
parent
07f59f8076
commit
3a6b27ff9e
@ -389,7 +389,7 @@ class Client extends EntityModel
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAddress()
|
||||
public function hasAddress($shipping = false)
|
||||
{
|
||||
$fields = [
|
||||
'address1',
|
||||
@ -401,6 +401,9 @@ class Client extends EntityModel
|
||||
];
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if ($shipping) {
|
||||
$field = 'shipping_' . $field;
|
||||
}
|
||||
if ($this->$field) {
|
||||
return true;
|
||||
}
|
||||
|
@ -2606,6 +2606,8 @@ $LANG = array(
|
||||
'edit_times' => 'Edit Times',
|
||||
'inclusive_taxes_help' => 'Include <b>taxes in the cost</b>',
|
||||
'inclusive_taxes_warning' => 'Warning: existing invoices will need to be resaved',
|
||||
'copy_shipping' => 'Copy Shipping',
|
||||
'copy_billing' => 'Copy Billing',
|
||||
|
||||
);
|
||||
|
||||
|
@ -95,6 +95,14 @@
|
||||
{!! Former::text('postal_code') !!}
|
||||
{!! Former::select('country_id')->addOption('','')
|
||||
->fromQuery($countries, 'name', 'id') !!}
|
||||
|
||||
<div class="form-group" id="copyShippingDiv" style="display:none;">
|
||||
<label for="city" class="control-label col-lg-4 col-sm-4"></label>
|
||||
<div class="col-lg-8 col-sm-8">
|
||||
{!! Button::normal(trans('texts.copy_shipping'))->small() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="shipping_address">
|
||||
{!! Former::text('shipping_address1')->label('address1') !!}
|
||||
@ -104,6 +112,13 @@
|
||||
{!! Former::text('shipping_postal_code')->label('postal_code') !!}
|
||||
{!! Former::select('shipping_country_id')->addOption('','')
|
||||
->fromQuery($countries, 'name', 'id')->label('country_id') !!}
|
||||
|
||||
<div class="form-group" id="copyBillingDiv" style="display:none;">
|
||||
<label for="city" class="control-label col-lg-4 col-sm-4"></label>
|
||||
<div class="col-lg-8 col-sm-8">
|
||||
{!! Button::normal(trans('texts.copy_billing'))->small() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -290,6 +305,13 @@
|
||||
|
||||
$(function() {
|
||||
$('#country_id, #shipping_country_id').combobox();
|
||||
|
||||
if ({{ $client->hasAddress() ? 'true' : 'false' }}) {
|
||||
$('#copyBillingDiv').show();
|
||||
}
|
||||
if ({{ $client->hasAddress(true) ? 'true' : 'false' }}) {
|
||||
$('#copyShippingDiv').show();
|
||||
}
|
||||
});
|
||||
|
||||
function ContactModel(data) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user