Skip to content

Commit

Permalink
Merge branch 'build-version210' into 'master'
Browse files Browse the repository at this point in the history
Build version210

See merge request mohit.panjvani/crater-web!139
  • Loading branch information
mohitpanjwani committed Dec 14, 2019
2 parents d926073 + bceffbf commit b9c32bb
Show file tree
Hide file tree
Showing 30 changed files with 213 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_ENV=production
APP_KEY=base64:kgk/4DW1vEVy7aEvet5FPp5un6PIGe/so8H0mvoUtW0=
APP_DEBUG=false
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://crater.test

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/CustomersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function update($id, Requests\CustomerRequest $request)
$customer->enable_portal = $request->enable_portal;
$customer->save();

$customer->addresses()->delete();
if ($request->addresses) {
foreach ($request->addresses as $address) {
$newAddress = $customer->addresses()->firstOrNew(['type' => $address["type"]]);
Expand Down
9 changes: 8 additions & 1 deletion app/Http/Controllers/OnboardingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,14 @@ public function companySettings(CompanySettingRequest $request)

if (file_exists($path)) {
file_put_contents($path, str_replace(
'PROXY_OAUTH_CLIENT_SECRET='.config('auth.proxy.client_secret'), 'PROXY_OAUTH_CLIENT_SECRET='.$client->secret, file_get_contents($path)
'PROXY_OAUTH_CLIENT_SECRET='.config('auth.proxy.client_secret'),
'PROXY_OAUTH_CLIENT_SECRET='.$client->secret,
file_get_contents($path)
));
file_put_contents($path, str_replace(
'APP_DEBUG=true',
'APP_DEBUG=false',
file_get_contents($path)
));
}

Expand Down
1 change: 1 addition & 0 deletions app/Listeners/Updates/v2/Version210.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Queue\InteractsWithQueue;
use Crater\Events\UpdateFinished;
use Crater\Listeners\Updates\Listener;
use Crater\Setting;

class Version210 extends Listener
{
Expand Down
2 changes: 1 addition & 1 deletion app/Space/EnvironmentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function saveDatabaseVariables(DatabaseEnvironmentRequest $request)
} catch (Exception $e) {

return [
'error' => $e->getMessage()
'error_message' => $e->getMessage()
];
}

Expand Down
2 changes: 1 addition & 1 deletion config/dompdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
* Used if no suitable fonts can be found. This must exist in the font folder.
* @var string
*/
"default_font" => "serif",
"default_font" => "DejaVu Sans",

/**
* Image DPI setting
Expand Down
2 changes: 1 addition & 1 deletion public/assets/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/assets/js/app.js": "/assets/js/app.js?id=0459d5b0a925f3472c37",
"/assets/js/app.js": "/assets/js/app.js?id=5e2defab289e20b6776c",
"/assets/css/crater.css": "/assets/css/crater.css?id=193e5770a0e7a8604f35"
}
2 changes: 1 addition & 1 deletion resources/assets/js/components/base/modal/TaxTypeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default {
},
percent: {
required,
between: between(-1, 100)
between: between(0, 100)
},
description: {
maxLength: maxLength(255)
Expand Down
58 changes: 54 additions & 4 deletions resources/assets/js/views/customers/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
:options="billingCountries"
:searchable="true"
:show-labels="false"
:allow-empty="false"
:allow-empty="true"
:tabindex="8"
:placeholder="$t('general.select_country')"
label="name"
Expand Down Expand Up @@ -265,7 +265,7 @@
:searchable="true"
:show-labels="false"
:tabindex="16"
:allow-empty="false"
:allow-empty="true"
:placeholder="$t('general.select_country')"
label="name"
track-by="id"
Expand Down Expand Up @@ -411,19 +411,53 @@ export default {
return true
}
return false
},
hasBillingAdd () {
let billing = this.billing
if (
billing.name ||
billing.country_id ||
billing.state ||
billing.city ||
billing.phone ||
billing.zip ||
billing.address_street_1 ||
billing.address_street_2) {
return true
}
return false
},
hasShippingAdd () {
let shipping = this.shipping
if (
shipping.name ||
shipping.country_id ||
shipping.state ||
shipping.city ||
shipping.phone ||
shipping.zip ||
shipping.address_street_1 ||
shipping.address_street_2) {
return true
}
return false
}
},
watch: {
billing_country (newCountry) {
if (newCountry) {
this.billing.country_id = newCountry.id
this.isDisabledBillingState = false
} else {
this.billing.country_id = null
}
},
shipping_country (newCountry) {
if (newCountry) {
this.shipping.country_id = newCountry.id
return true
} else {
this.shipping.country_id = null
}
}
},
Expand All @@ -446,7 +480,14 @@ export default {
]),
async loadCustomer () {
let { data: { customer, currencies, currency } } = await this.fetchCustomer(this.$route.params.id)
this.formData = customer
this.formData.id = customer.id
this.formData.name = customer.name
this.formData.contact_name = customer.contact_name
this.formData.email = customer.email
this.formData.phone = customer.phone
this.formData.currency_id = customer.currency_id
this.formData.website = customer.website
if (customer.billing_address) {
this.billing = customer.billing_address
Expand Down Expand Up @@ -495,7 +536,16 @@ export default {
if (this.$v.$invalid) {
return true
}
this.formData.addresses = [{...this.billing}, {...this.shipping}]
if (this.hasBillingAdd && this.hasShippingAdd) {
this.formData.addresses = [{...this.billing}, {...this.shipping}]
} else {
if (this.hasBillingAdd) {
this.formData.addresses = [{...this.billing}]
}
if (this.hasShippingAdd) {
this.formData.addresses = [{...this.shipping}]
}
}
if (this.isEdit) {
if (this.currency) {
Expand Down
10 changes: 5 additions & 5 deletions resources/assets/js/views/estimates/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
class="show-customer"
>
<div class="row px-2 mt-1">
<div class="col col-6">
<div v-if="selectedCustomer.billing_address != null" class="row address-menu">
<div v-if="selectedCustomer.billing_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.bill_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.billing_address.name">
Expand All @@ -57,8 +57,8 @@
</div>
</div>
</div>
<div class="col col-6">
<div v-if="selectedCustomer.shipping_address != null" class="row address-menu">
<div v-if="selectedCustomer.shipping_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.ship_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.shipping_address.name">
Expand All @@ -84,7 +84,7 @@
</div>
</div>
<div class="customer-content mb-1">
<label class="email">{{ selectedCustomer.email ? selectedCustomer.email : selectedCustomer.name }}</label>
<label class="email">{{ selectedCustomer.name }}</label>
<label class="action" @click="removeCustomer">{{ $t('general.remove') }}</label>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions resources/assets/js/views/invoices/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<div
v-if="selectedCustomer" class="show-customer">
<div class="row px-2 mt-1">
<div class="col col-6">
<div v-if="selectedCustomer.billing_address" class="row address-menu">
<div v-if="selectedCustomer.billing_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.bill_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.billing_address.name">
Expand All @@ -55,8 +55,8 @@
</div>
</div>
</div>
<div class="col col-6">
<div v-if="selectedCustomer.shipping_address" class="row address-menu">
<div v-if="selectedCustomer.shipping_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.ship_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.shipping_address.name">
Expand Down
4 changes: 3 additions & 1 deletion resources/assets/js/views/wizard/Database.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ export default {
this.$emit('next')
window.toastr['success'](this.$t('wizard.success.' + response.data.success))
return true
} else {
} else if (response.data.error) {
window.toastr['error'](this.$t('wizard.errors.' + response.data.error))
} else if (response.data.error_message) {
window.toastr['error'](response.data.error_message)
}
} catch (e) {
window.toastr['error'](e.response.data.message)
Expand Down
6 changes: 1 addition & 5 deletions resources/views/app/pdf/estimate/estimate1.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@
margin-left:160px;
}
.header {
font-family: "DejaVu Sans";
font-size: 20px;
color: rgba(0, 0, 0, 0.7);
}
.TextColor1 {
font-family: "DejaVu Sans";
font-size: 16px;
color: rgba(0, 0, 0, 0.5);
}
Expand Down Expand Up @@ -341,7 +339,6 @@
}
.notes {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: 300;
font-size: 12px;
Expand All @@ -354,7 +351,6 @@
}
.notes-label {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: normal;
font-size: 15px;
Expand Down Expand Up @@ -412,7 +408,7 @@
<div class="bill-address-container">
@include('app.pdf.estimate.partials.billing-address')
</div>
@if($estimate->user->billingaddress && ($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone))
@if($estimate->user->billingaddress)
<div class="ship-address-container">
@else
<div class="ship-address-container " style="float:left;padding-left:0px;">
Expand Down
6 changes: 1 addition & 5 deletions resources/views/app/pdf/estimate/estimate2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@
margin-left:160px;
}
.header {
font-family: "DejaVu Sans";
font-size: 20px;
color: rgba(0, 0, 0, 0.7);
}
.TextColor1 {
font-family: "DejaVu Sans";
font-size: 16px;
color: rgba(0, 0, 0, 0.5);
}
Expand Down Expand Up @@ -366,7 +364,6 @@
}
.notes {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: 300;
font-size: 12px;
Expand All @@ -379,7 +376,6 @@
}
.notes-label {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: normal;
font-size: 15px;
Expand Down Expand Up @@ -423,7 +419,7 @@
<div class="ship-address-container">
@include('app.pdf.estimate.partials.shipping-address')
</div>
@if($estimate->user->shippingaddress && ($estimate->user->shippingaddress->name || $estimate->user->shippingaddress->address_street_1 || $estimate->user->shippingaddress->address_street_2 || $estimate->user->shippingaddress->country || $estimate->user->shippingaddress->state || $estimate->user->shippingaddress->city || $estimate->user->shippingaddress->zip || $estimate->user->phone))
@if($estimate->user->shippingaddress)
<div class="bill-address-container">
@else
<div class="bill-address-container" style="float:right;padding-right:0px;">
Expand Down
6 changes: 1 addition & 5 deletions resources/views/app/pdf/estimate/estimate3.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@
margin-left:160px;
}
.header {
font-family: "DejaVu Sans";
font-size: 20px;
color: rgba(0, 0, 0, 0.7);
}
.TextColor1 {
font-family: "DejaVu Sans";
font-size: 16px;
color: rgba(0, 0, 0, 0.5);
}
Expand Down Expand Up @@ -374,7 +372,6 @@
}
.notes {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: 300;
font-size: 12px;
Expand All @@ -387,7 +384,6 @@
}
.notes-label {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: normal;
font-size: 15px;
Expand Down Expand Up @@ -428,7 +424,7 @@
<div style="float:left;">
@include('app.pdf.estimate.partials.billing-address')
</div>
@if($estimate->user->billingaddress && ($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone))
@if($estimate->user->billingaddress)
<div style="float:right;">
@else
<div style="float:left;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@if($estimate->user->billingaddress)
@if($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone)
<p class="bill-to">Bill To,</p>
@endif
<p class="bill-to">Bill To,</p>
@if($estimate->user->billingaddress->name)
<p class="bill-user-name">
{{$estimate->user->billingaddress->name}}
Expand All @@ -16,11 +14,11 @@
{{$estimate->user->billingaddress->address_street_2}}<br>
@endif

@if($estimate->user->billingaddress->city && $estimate->user->billingaddress->city)
@if($estimate->user->billingaddress->city)
{{$estimate->user->billingaddress->city}},
@endif

@if($estimate->user->billingaddress->state && $estimate->user->billingaddress->state)
@if($estimate->user->billingaddress->state)
{{$estimate->user->billingaddress->state}}.
@endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@if($estimate->user->shippingaddress)
@if($estimate->user->shippingaddress->name || $estimate->user->shippingaddress->address_street_1 || $estimate->user->shippingaddress->address_street_2 || $estimate->user->shippingaddress->country || $estimate->user->shippingaddress->state || $estimate->user->shippingaddress->city || $estimate->user->shippingaddress->zip || $estimate->user->phone)
<p class="ship-to">Ship To,</p>
@endif
<p class="ship-to">Ship To,</p>
@if($estimate->user->shippingaddress->name)
<p class="ship-user-name">
{{$estimate->user->shippingaddress->name}}
Expand Down
Loading

0 comments on commit b9c32bb

Please sign in to comment.