mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'master'
This commit is contained in:
@ -60,9 +60,10 @@ class EstimatesController extends Controller
|
||||
$estimate_num_auto_generate = CompanySetting::getSetting('estimate_auto_generate', $request->header('company'));
|
||||
|
||||
$nextEstimateNumberAttribute = null;
|
||||
$nextEstimateNumber = Estimate::getNextEstimateNumber($estimate_prefix);
|
||||
|
||||
if ($estimate_num_auto_generate == "YES") {
|
||||
$nextEstimateNumberAttribute = Estimate::getNextEstimateNumber($estimate_prefix);
|
||||
$nextEstimateNumberAttribute = $nextEstimateNumber;
|
||||
}
|
||||
|
||||
$tax_per_item = CompanySetting::getSetting('tax_per_item', $request->header('company'));
|
||||
@ -71,7 +72,8 @@ class EstimatesController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'customers' => $customers,
|
||||
'nextEstimateNumber' => $nextEstimateNumberAttribute,
|
||||
'nextEstimateNumberAttribute' => $nextEstimateNumberAttribute,
|
||||
'nextEstimateNumber' => $estimate_prefix.'-'.$nextEstimateNumber,
|
||||
'taxes' => Tax::whereCompany($request->header('company'))->latest()->get(),
|
||||
'items' => Item::whereCompany($request->header('company'))->get(),
|
||||
'tax_per_item' => $tax_per_item,
|
||||
|
||||
@ -70,13 +70,15 @@ class InvoicesController extends Controller
|
||||
$invoice_num_auto_generate = CompanySetting::getSetting('invoice_auto_generate', $request->header('company'));
|
||||
|
||||
$nextInvoiceNumberAttribute = null;
|
||||
$nextInvoiceNumber = Invoice::getNextInvoiceNumber($invoice_prefix);
|
||||
|
||||
if ($invoice_num_auto_generate == "YES") {
|
||||
$nextInvoiceNumberAttribute = Invoice::getNextInvoiceNumber($invoice_prefix);
|
||||
$nextInvoiceNumberAttribute = $nextInvoiceNumber;
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'nextInvoiceNumber' => $nextInvoiceNumberAttribute,
|
||||
'nextInvoiceNumberAttribute' => $nextInvoiceNumberAttribute,
|
||||
'nextInvoiceNumber' => $invoice_prefix.'-'.$nextInvoiceNumber,
|
||||
'items' => Item::with('taxes')->whereCompany($request->header('company'))->get(),
|
||||
'invoiceTemplates' => InvoiceTemplate::all(),
|
||||
'tax_per_item' => $tax_per_item,
|
||||
|
||||
@ -56,16 +56,18 @@ class PaymentController extends Controller
|
||||
|
||||
|
||||
$nextPaymentNumberAttribute = null;
|
||||
$nextPaymentNumber = Payment::getNextPaymentNumber($payment_prefix);
|
||||
|
||||
if ($payment_num_auto_generate == "YES") {
|
||||
$nextPaymentNumberAttribute = Payment::getNextPaymentNumber($payment_prefix);
|
||||
$nextPaymentNumberAttribute = $nextPaymentNumber;
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'customers' => User::where('role', 'customer')
|
||||
->whereCompany($request->header('company'))
|
||||
->get(),
|
||||
'nextPaymentNumber' => $nextPaymentNumberAttribute,
|
||||
'nextPaymentNumberAttribute' => $nextPaymentNumberAttribute,
|
||||
'nextPaymentNumber' => $payment_prefix.'-'.$nextPaymentNumber,
|
||||
'payment_prefix' => $payment_prefix
|
||||
]);
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ export default {
|
||||
this.newEstimate.expiry_date = moment(today).add(7, 'days').toString()
|
||||
this.itemList = response.data.items
|
||||
this.estimatePrefix = response.data.estimate_prefix
|
||||
this.estimateNumAttribute = response.data.nextEstimateNumber
|
||||
this.estimateNumAttribute = response.data.nextEstimateNumberAttribute
|
||||
}
|
||||
this.initLoading = false
|
||||
},
|
||||
|
||||
@ -582,7 +582,7 @@ export default {
|
||||
this.newInvoice.due_date = moment(today).add(7, 'days').toString()
|
||||
this.itemList = response.data.items
|
||||
this.invoicePrefix = response.data.invoice_prefix
|
||||
this.invoiceNumAttribute = response.data.nextInvoiceNumber
|
||||
this.invoiceNumAttribute = response.data.nextInvoiceNumberAttribute
|
||||
}
|
||||
this.initLoading = false
|
||||
},
|
||||
|
||||
@ -50,7 +50,7 @@ export default {
|
||||
Layout.set('layout-default')
|
||||
},
|
||||
|
||||
created() {
|
||||
created () {
|
||||
this.bootstrap().then((res) => {
|
||||
this.setInitialCompany()
|
||||
})
|
||||
@ -59,7 +59,7 @@ export default {
|
||||
methods: {
|
||||
...mapActions(['bootstrap']),
|
||||
...mapActions('company', ['setSelectedCompany']),
|
||||
setInitialCompany() {
|
||||
setInitialCompany () {
|
||||
let selectedCompany = Ls.get('selectedCompany') !== null
|
||||
|
||||
if (selectedCompany) {
|
||||
|
||||
@ -309,7 +309,7 @@ export default {
|
||||
} else {
|
||||
let response = await this.fetchCreatePayment()
|
||||
this.customerList = response.data.customers
|
||||
this.paymentNumAttribute = response.data.nextPaymentNumber
|
||||
this.paymentNumAttribute = response.data.nextPaymentNumberAttribute
|
||||
this.paymentPrefix = response.data.payment_prefix
|
||||
this.formData.payment_date = moment(new Date()).toString()
|
||||
}
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
<head>
|
||||
<title>Estimate</title>
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
@ -58,13 +60,13 @@
|
||||
margin-left:160px;
|
||||
}
|
||||
.header {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.TextColor1 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
@ -339,7 +341,7 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -352,7 +354,7 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
<head>
|
||||
<title>Estimate</title>
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
@ -62,13 +64,13 @@
|
||||
margin-left:160px;
|
||||
}
|
||||
.header {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.TextColor1 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
@ -364,7 +366,7 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -377,7 +379,7 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
<head>
|
||||
<title>Estimate</title>
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
@ -64,13 +66,13 @@
|
||||
margin-left:160px;
|
||||
}
|
||||
.header {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.TextColor1 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
@ -372,7 +374,7 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -385,7 +387,7 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
<head>
|
||||
<title>Invoice</title>
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
@ -59,13 +61,13 @@
|
||||
margin-left:160px;
|
||||
}
|
||||
.header {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.TextColor1 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
@ -346,7 +348,7 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -359,7 +361,7 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -416,9 +418,8 @@
|
||||
<div class="bill-add">
|
||||
<div class="bill-address-container">
|
||||
@include('app.pdf.invoice.partials.billing-address')
|
||||
|
||||
</div>
|
||||
@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)
|
||||
@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))
|
||||
<div class="ship-address-container">
|
||||
@else
|
||||
<div class="ship-address-container " style="float:left;padding-left:0px;">
|
||||
|
||||
@ -3,9 +3,10 @@
|
||||
<head>
|
||||
<title>Invoice</title>
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
@ -61,13 +62,13 @@
|
||||
margin-left:160px;
|
||||
}
|
||||
.header {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.TextColor1 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
@ -373,7 +374,7 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -386,7 +387,7 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -431,7 +432,7 @@
|
||||
<div class="ship-address-container">
|
||||
@include('app.pdf.invoice.partials.shipping-address')
|
||||
</div>
|
||||
@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)
|
||||
@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))
|
||||
<div class="bill-address-container">
|
||||
@else
|
||||
<div class="bill-address-container" style="float:right;padding-right:0px;">
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
<head>
|
||||
<title>Invoice</title>
|
||||
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
}
|
||||
|
||||
html {
|
||||
@ -64,13 +66,13 @@
|
||||
margin-left:160px;
|
||||
}
|
||||
.header {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.TextColor1 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
@ -382,7 +384,7 @@
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-size: 12px;
|
||||
@ -395,7 +397,7 @@
|
||||
}
|
||||
|
||||
.notes-label {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-family: "DejaVu Sans";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
@ -436,7 +438,7 @@
|
||||
<div style="float:left;">
|
||||
@include('app.pdf.invoice.partials.billing-address')
|
||||
</div>
|
||||
@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)
|
||||
@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))
|
||||
<div style="float:right;">
|
||||
@else
|
||||
<div style="float:left;">
|
||||
|
||||
@ -3,6 +3,6 @@
|
||||
<div class="notes-label">
|
||||
Notes
|
||||
</div>
|
||||
{{$invoice->notes}}
|
||||
{!! $invoice->notes !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user