mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-06-02 08:29:01 +00:00
Invoice time support (#269)
* Changed invoice date to datetime * Fixed code style errors * Update TimeFormatsController.php * Update TimeFormatter.php * Update TimeFormatsController namespace * Fix missing comma in language file * Fix formatting --------- Co-authored-by: troky <troky2001@yahoo.com>
This commit is contained in:
committed by
GitHub
parent
32e03b98a3
commit
f52b73f517
20
resources/scripts/admin/stores/global.js
vendored
20
resources/scripts/admin/stores/global.js
vendored
@@ -21,6 +21,7 @@ export const useGlobalStore = (useWindow = false) => {
|
||||
// Global Lists
|
||||
timeZones: [],
|
||||
dateFormats: [],
|
||||
timeFormats: [],
|
||||
currencies: [],
|
||||
countries: [],
|
||||
languages: [],
|
||||
@@ -156,6 +157,25 @@ export const useGlobalStore = (useWindow = false) => {
|
||||
})
|
||||
},
|
||||
|
||||
fetchTimeFormats() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.timeFormats.length) {
|
||||
resolve(this.timeFormats)
|
||||
} else {
|
||||
axios
|
||||
.get('/api/v1/time/formats')
|
||||
.then((response) => {
|
||||
this.timeFormats = response.data.time_formats
|
||||
resolve(response)
|
||||
})
|
||||
.catch((err) => {
|
||||
handleError(err)
|
||||
reject(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
fetchTimeZones() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.timeZones.length) {
|
||||
|
||||
8
resources/scripts/admin/stores/invoice.js
vendored
8
resources/scripts/admin/stores/invoice.js
vendored
@@ -499,7 +499,13 @@ export const useInvoiceStore = (useWindow = false) => {
|
||||
this.newInvoice.sales_tax_address_type = companyStore.selectedCompanySettings.sales_tax_address_type
|
||||
this.newInvoice.discount_per_item =
|
||||
companyStore.selectedCompanySettings.discount_per_item
|
||||
this.newInvoice.invoice_date = moment().format('YYYY-MM-DD')
|
||||
|
||||
let dateFormat = 'YYYY-MM-DD';
|
||||
if (companyStore.selectedCompanySettings.invoice_use_time === 'YES') {
|
||||
dateFormat += ' HH:mm'
|
||||
}
|
||||
|
||||
this.newInvoice.invoice_date = moment().format(dateFormat)
|
||||
if (companyStore.selectedCompanySettings.invoice_set_due_date_automatically === 'YES') {
|
||||
this.newInvoice.due_date = moment()
|
||||
.add(companyStore.selectedCompanySettings.invoice_due_date_days, 'days')
|
||||
|
||||
Reference in New Issue
Block a user