mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
v6 update
This commit is contained in:
79
resources/scripts/admin/stub/abilities.js
Normal file
79
resources/scripts/admin/stub/abilities.js
Normal file
@ -0,0 +1,79 @@
|
||||
export default {
|
||||
DASHBOARD: 'dashboard',
|
||||
|
||||
// customers
|
||||
CREATE_CUSTOMER: 'create-customer',
|
||||
DELETE_CUSTOMER: 'delete-customer',
|
||||
EDIT_CUSTOMER: 'edit-customer',
|
||||
VIEW_CUSTOMER: 'view-customer',
|
||||
|
||||
// Items
|
||||
CREATE_ITEM: 'create-item',
|
||||
DELETE_ITEM: 'delete-item',
|
||||
EDIT_ITEM: 'edit-item',
|
||||
VIEW_ITEM: 'view-item',
|
||||
|
||||
// Tax Types
|
||||
CREATE_TAX_TYPE: 'create-tax-type',
|
||||
DELETE_TAX_TYPE: 'delete-tax-type',
|
||||
EDIT_TAX_TYPE: 'edit-tax-type',
|
||||
VIEW_TAX_TYPE: 'view-tax-type',
|
||||
|
||||
// Estimates
|
||||
CREATE_ESTIMATE: 'create-estimate',
|
||||
DELETE_ESTIMATE: 'delete-estimate',
|
||||
EDIT_ESTIMATE: 'edit-estimate',
|
||||
VIEW_ESTIMATE: 'view-estimate',
|
||||
SEND_ESTIMATE: 'send-estimate',
|
||||
|
||||
// Invoices
|
||||
CREATE_INVOICE: 'create-invoice',
|
||||
DELETE_INVOICE: 'delete-invoice',
|
||||
EDIT_INVOICE: 'edit-invoice',
|
||||
VIEW_INVOICE: 'view-invoice',
|
||||
SEND_INVOICE: 'send-invoice',
|
||||
|
||||
// Recurring Invoices
|
||||
CREATE_RECURRING_INVOICE: 'create-recurring-invoice',
|
||||
DELETE_RECURRING_INVOICE: 'delete-recurring-invoice',
|
||||
EDIT_RECURRING_INVOICE: 'edit-recurring-invoice',
|
||||
VIEW_RECURRING_INVOICE: 'view-recurring-invoice',
|
||||
|
||||
// Payment
|
||||
CREATE_PAYMENT: 'create-payment',
|
||||
DELETE_PAYMENT: 'delete-payment',
|
||||
EDIT_PAYMENT: 'edit-payment',
|
||||
VIEW_PAYMENT: 'view-payment',
|
||||
SEND_PAYMENT: 'send-payment',
|
||||
|
||||
// Payment
|
||||
CREATE_EXPENSE: 'create-expense',
|
||||
DELETE_EXPENSE: 'delete-expense',
|
||||
EDIT_EXPENSE: 'edit-expense',
|
||||
VIEW_EXPENSE: 'view-expense',
|
||||
|
||||
// Custom fields
|
||||
CREATE_CUSTOM_FIELDS: 'create-custom-field',
|
||||
DELETE_CUSTOM_FIELDS: 'delete-custom-field',
|
||||
EDIT_CUSTOM_FIELDS: 'edit-custom-field',
|
||||
VIEW_CUSTOM_FIELDS: 'view-custom-field',
|
||||
|
||||
// Roles
|
||||
CREATE_ROLE: 'create-role',
|
||||
DELETE_ROLE: 'delete-role',
|
||||
EDIT_ROLE: 'edit-role',
|
||||
VIEW_ROLE: 'view-role',
|
||||
|
||||
// exchange rates
|
||||
VIEW_EXCHANGE_RATE: 'view-exchange-rate-provider',
|
||||
CREATE_EXCHANGE_RATE: 'create-exchange-rate-provider',
|
||||
EDIT_EXCHANGE_RATE: 'edit-exchange-rate-provider',
|
||||
DELETE_EXCHANGE_RATE: 'delete-exchange-rate-provider',
|
||||
|
||||
// Reports
|
||||
VIEW_FINANCIAL_REPORT: 'view-financial-reports',
|
||||
|
||||
// settings
|
||||
MANAGE_NOTE: 'manage-all-notes',
|
||||
VIEW_NOTE: 'view-all-notes',
|
||||
}
|
||||
11
resources/scripts/admin/stub/address.js
Normal file
11
resources/scripts/admin/stub/address.js
Normal file
@ -0,0 +1,11 @@
|
||||
export default {
|
||||
name: null,
|
||||
phone: null,
|
||||
address_street_1: null,
|
||||
address_street_2: null,
|
||||
city: null,
|
||||
state: null,
|
||||
country_id: null,
|
||||
zip: null,
|
||||
type: null,
|
||||
}
|
||||
12
resources/scripts/admin/stub/custom-field.js
Normal file
12
resources/scripts/admin/stub/custom-field.js
Normal file
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
id: null,
|
||||
label: null,
|
||||
type: null,
|
||||
name: null,
|
||||
default_answer: null,
|
||||
is_required: false,
|
||||
placeholder: null,
|
||||
model_type: null,
|
||||
order: 1,
|
||||
options: [],
|
||||
}
|
||||
19
resources/scripts/admin/stub/customer.js
Normal file
19
resources/scripts/admin/stub/customer.js
Normal file
@ -0,0 +1,19 @@
|
||||
import addressStub from '@/scripts/admin/stub/address.js'
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
name: '',
|
||||
contact_name: '',
|
||||
email: '',
|
||||
phone: null,
|
||||
password: '',
|
||||
confirm_password:'',
|
||||
currency_id: null,
|
||||
website: null,
|
||||
billing: { ...addressStub },
|
||||
shipping: { ...addressStub },
|
||||
customFields: [],
|
||||
fields: [],
|
||||
enable_portal: false,
|
||||
}
|
||||
}
|
||||
19
resources/scripts/admin/stub/estimate-item.js
Normal file
19
resources/scripts/admin/stub/estimate-item.js
Normal file
@ -0,0 +1,19 @@
|
||||
export default {
|
||||
estimate_id: null,
|
||||
item_id: null,
|
||||
name: '',
|
||||
title: '',
|
||||
description: null,
|
||||
quantity: 1,
|
||||
price: 0,
|
||||
discount_type: 'fixed',
|
||||
discount_val: 0,
|
||||
discount: 0,
|
||||
total: 0,
|
||||
sub_total: 0,
|
||||
totalTax: 0,
|
||||
totalSimpleTax: 0,
|
||||
totalCompoundTax: 0,
|
||||
tax: 0,
|
||||
taxes: [],
|
||||
}
|
||||
39
resources/scripts/admin/stub/estimate.js
Normal file
39
resources/scripts/admin/stub/estimate.js
Normal file
@ -0,0 +1,39 @@
|
||||
import Guid from 'guid'
|
||||
import estimateItemStub from './estimate-item'
|
||||
import taxStub from './tax'
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
id: null,
|
||||
customer: null,
|
||||
template_name: '',
|
||||
tax_per_item: null,
|
||||
sales_tax_type: null,
|
||||
sales_tax_address_type: null,
|
||||
discount_per_item: null,
|
||||
estimate_date: '',
|
||||
expiry_date: '',
|
||||
estimate_number: '',
|
||||
customer_id: null,
|
||||
sub_total: 0,
|
||||
total: 0,
|
||||
tax: 0,
|
||||
notes: '',
|
||||
discount_type: 'fixed',
|
||||
discount_val: 0,
|
||||
reference_number: null,
|
||||
discount: 0,
|
||||
items: [
|
||||
{
|
||||
...estimateItemStub,
|
||||
id: Guid.raw(),
|
||||
taxes: [{ ...taxStub, id: Guid.raw() }],
|
||||
},
|
||||
],
|
||||
taxes: [],
|
||||
customFields: [],
|
||||
fields: [],
|
||||
selectedNote: null,
|
||||
selectedCurrency: '',
|
||||
}
|
||||
}
|
||||
17
resources/scripts/admin/stub/expense.js
Normal file
17
resources/scripts/admin/stub/expense.js
Normal file
@ -0,0 +1,17 @@
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
expense_category_id: null,
|
||||
expense_date: moment().format('YYYY-MM-DD'),
|
||||
amount: 100,
|
||||
notes: '',
|
||||
attachment_receipt: null,
|
||||
customer_id: '',
|
||||
currency_id: '',
|
||||
payment_method_id: '',
|
||||
receiptFiles: [],
|
||||
customFields: [],
|
||||
fields: [],
|
||||
in_use: false,
|
||||
selectedCurrency: null
|
||||
}
|
||||
18
resources/scripts/admin/stub/invoice-item.js
Normal file
18
resources/scripts/admin/stub/invoice-item.js
Normal file
@ -0,0 +1,18 @@
|
||||
export default {
|
||||
invoice_id: null,
|
||||
item_id: null,
|
||||
name: '',
|
||||
title: '',
|
||||
description: null,
|
||||
quantity: 1,
|
||||
price: 0,
|
||||
discount_type: 'fixed',
|
||||
discount_val: 0,
|
||||
discount: 0,
|
||||
total: 0,
|
||||
totalTax: 0,
|
||||
totalSimpleTax: 0,
|
||||
totalCompoundTax: 0,
|
||||
tax: 0,
|
||||
taxes: [],
|
||||
}
|
||||
39
resources/scripts/admin/stub/invoice.js
Normal file
39
resources/scripts/admin/stub/invoice.js
Normal file
@ -0,0 +1,39 @@
|
||||
import Guid from 'guid'
|
||||
import invoiceItemStub from './invoice-item'
|
||||
import taxStub from './tax'
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
id: null,
|
||||
invoice_number: '',
|
||||
customer: null,
|
||||
customer_id: null,
|
||||
template_name: null,
|
||||
invoice_date: '',
|
||||
due_date: '',
|
||||
notes: '',
|
||||
discount: 0,
|
||||
discount_type: 'fixed',
|
||||
discount_val: 0,
|
||||
reference_number: null,
|
||||
tax: 0,
|
||||
sub_total: 0,
|
||||
total: 0,
|
||||
tax_per_item: null,
|
||||
sales_tax_type: null,
|
||||
sales_tax_address_type: null,
|
||||
discount_per_item: null,
|
||||
taxes: [],
|
||||
items: [
|
||||
{
|
||||
...invoiceItemStub,
|
||||
id: Guid.raw(),
|
||||
taxes: [{ ...taxStub, id: Guid.raw() }],
|
||||
},
|
||||
],
|
||||
customFields: [],
|
||||
fields: [],
|
||||
selectedNote: null,
|
||||
selectedCurrency: '',
|
||||
}
|
||||
}
|
||||
15
resources/scripts/admin/stub/payment.js
Normal file
15
resources/scripts/admin/stub/payment.js
Normal file
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
maxPayableAmount: Number.MAX_SAFE_INTEGER,
|
||||
selectedCustomer: '',
|
||||
currency: null,
|
||||
currency_id: '',
|
||||
customer_id: '',
|
||||
payment_number: '',
|
||||
payment_date: '',
|
||||
amount: 0,
|
||||
invoice_id: '',
|
||||
notes: '',
|
||||
payment_method_id: '',
|
||||
customFields: [],
|
||||
fields: []
|
||||
}
|
||||
20
resources/scripts/admin/stub/recurring-invoice-item.js
Normal file
20
resources/scripts/admin/stub/recurring-invoice-item.js
Normal file
@ -0,0 +1,20 @@
|
||||
export default {
|
||||
recurring_invoice_id: null,
|
||||
item_id: null,
|
||||
name: '',
|
||||
title: '',
|
||||
sales_tax_type: null,
|
||||
sales_tax_address_type: null,
|
||||
description: null,
|
||||
quantity: 1,
|
||||
price: 0,
|
||||
discount_type: 'fixed',
|
||||
discount_val: 0,
|
||||
discount: 0,
|
||||
total: 0,
|
||||
totalTax: 0,
|
||||
totalSimpleTax: 0,
|
||||
totalCompoundTax: 0,
|
||||
tax: 0,
|
||||
taxes: [],
|
||||
}
|
||||
48
resources/scripts/admin/stub/recurring-invoice.js
Normal file
48
resources/scripts/admin/stub/recurring-invoice.js
Normal file
@ -0,0 +1,48 @@
|
||||
import Guid from 'guid'
|
||||
import recurringInvoiceItemStub from './recurring-invoice-item'
|
||||
import taxStub from './tax'
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
currency: null,
|
||||
customer: null,
|
||||
|
||||
customer_id: null,
|
||||
invoice_template_id: 1,
|
||||
sub_total: 0,
|
||||
total: 0,
|
||||
tax: 0,
|
||||
notes: '',
|
||||
discount_type: 'fixed',
|
||||
discount_val: 0,
|
||||
discount: 0,
|
||||
starts_at: null,
|
||||
send_automatically: true,
|
||||
status: 'ACTIVE',
|
||||
company_id: null,
|
||||
next_invoice_at: null,
|
||||
next_invoice_date: null,
|
||||
frequency: '0 0 * * 0',
|
||||
limit_count: null,
|
||||
limit_by: 'NONE',
|
||||
limit_date: null,
|
||||
exchange_rate: null,
|
||||
tax_per_item: null,
|
||||
discount_per_item: null,
|
||||
template_name: null,
|
||||
items: [
|
||||
{
|
||||
...recurringInvoiceItemStub,
|
||||
id: Guid.raw(),
|
||||
taxes: [{ ...taxStub, id: Guid.raw() }],
|
||||
},
|
||||
],
|
||||
taxes: [],
|
||||
customFields: [],
|
||||
fields: [],
|
||||
invoices: [],
|
||||
selectedNote: null,
|
||||
selectedFrequency: { label: 'Every Week', value: '0 0 * * 0' },
|
||||
selectedInvoice: null,
|
||||
}
|
||||
}
|
||||
8
resources/scripts/admin/stub/tax.js
Normal file
8
resources/scripts/admin/stub/tax.js
Normal file
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
name: '',
|
||||
tax_type_id: 0,
|
||||
type: 'GENERAL',
|
||||
amount: null,
|
||||
percent: null,
|
||||
compound_tax: false,
|
||||
}
|
||||
Reference in New Issue
Block a user