mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
fix pdf & installation issue
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
@ -177,6 +177,7 @@ class CustomersController extends Controller
|
||||
$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"]]);
|
||||
|
||||
@ -277,7 +277,14 @@ class OnboardingController extends Controller
|
||||
|
||||
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)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ return array(
|
||||
* 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
|
||||
|
||||
@ -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"
|
||||
@ -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"
|
||||
@ -411,6 +411,36 @@ 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: {
|
||||
@ -418,12 +448,16 @@ export default {
|
||||
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
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -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
|
||||
@ -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) {
|
||||
|
||||
@ -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">
|
||||
@ -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">
|
||||
@ -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>
|
||||
|
||||
@ -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">
|
||||
@ -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">
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -341,7 +339,6 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -354,7 +351,6 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -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;">
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -366,7 +364,6 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -379,7 +376,6 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -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;">
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -374,7 +372,6 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -387,7 +384,6 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -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;">
|
||||
|
||||
@ -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}}
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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}}
|
||||
|
||||
@ -61,13 +61,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);
|
||||
}
|
||||
@ -348,7 +346,6 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -361,7 +358,6 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -419,7 +415,7 @@
|
||||
<div class="bill-address-container">
|
||||
@include('app.pdf.invoice.partials.billing-address')
|
||||
</div>
|
||||
@if($invoice->user->billingaddress && ($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone))
|
||||
@if($invoice->user->billingaddress)
|
||||
<div class="ship-address-container">
|
||||
@else
|
||||
<div class="ship-address-container " style="float:left;padding-left:0px;">
|
||||
|
||||
@ -62,13 +62,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);
|
||||
}
|
||||
@ -374,7 +372,6 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -387,7 +384,6 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -432,7 +428,7 @@
|
||||
<div class="ship-address-container">
|
||||
@include('app.pdf.invoice.partials.shipping-address')
|
||||
</div>
|
||||
@if($invoice->user->shippingaddress && ($invoice->user->shippingaddress->name || $invoice->user->shippingaddress->address_street_1 || $invoice->user->shippingaddress->address_street_2 || $invoice->user->shippingaddress->country || $invoice->user->shippingaddress->state || $invoice->user->shippingaddress->city || $invoice->user->shippingaddress->zip || $invoice->user->phone))
|
||||
@if($invoice->user->shippingaddress)
|
||||
<div class="bill-address-container">
|
||||
@else
|
||||
<div class="bill-address-container" style="float:right;padding-right:0px;">
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -384,7 +382,6 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -397,7 +394,6 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -438,7 +434,7 @@
|
||||
<div style="float:left;">
|
||||
@include('app.pdf.invoice.partials.billing-address')
|
||||
</div>
|
||||
@if($invoice->user->billingaddress && ($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone))
|
||||
@if($invoice->user->billingaddress)
|
||||
<div style="float:right;">
|
||||
@else
|
||||
<div style="float:left;">
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
@if($invoice->user->billingaddress)
|
||||
@if($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone)
|
||||
<p class="bill-to">Bill To,</p>
|
||||
@endif
|
||||
<p class="bill-to">Bill To,</p>
|
||||
@if($invoice->user->billingaddress->name)
|
||||
<p class="bill-user-name">
|
||||
{{$invoice->user->billingaddress->name}}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
@if($invoice->user->shippingaddress)
|
||||
@if($invoice->user->shippingaddress->name || $invoice->user->shippingaddress->address_street_1 || $invoice->user->shippingaddress->address_street_2 || $invoice->user->shippingaddress->country || $invoice->user->shippingaddress->state || $invoice->user->shippingaddress->city || $invoice->user->shippingaddress->zip || $invoice->user->phone)
|
||||
<p class="ship-to">Ship To,</p>
|
||||
@endif
|
||||
<p class="ship-to">Ship To,</p>
|
||||
@if($invoice->user->shippingaddress->name)
|
||||
<p class="ship-user-name">
|
||||
{{$invoice->user->shippingaddress->name}}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
/* html {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
/* html {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
/* html {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
/* html {
|
||||
|
||||
Reference in New Issue
Block a user