diff --git a/src/lib/decimal.ts b/src/lib/decimal.ts
index df24151..0d7fbba 100644
--- a/src/lib/decimal.ts
+++ b/src/lib/decimal.ts
@@ -3,7 +3,7 @@ export function DecimalFixed(n: number): string {
}
export function DecimalFixedNum(n: number) {
- let res: number = parseFloat((n * 100).toFixed(2));
+ let res: number = Number.parseFloat((n * 100).toFixed(2));
res = Math.floor(res) / 100;
return res;
}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 2a4c112..00ebdea 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,5 +1,5 @@
diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts
index 593dda3..6618e46 100644
--- a/src/routes/+layout.ts
+++ b/src/routes/+layout.ts
@@ -1 +1 @@
-export const prerender = true; // used for SSG(static site generation)
\ No newline at end of file
+export const prerender = true; // used for SSG(static site generation)
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 75e4f57..71f3053 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,7 +1,7 @@
diff --git a/src/routes/print/+layout.ts b/src/routes/print/+layout.ts
index 593dda3..6618e46 100644
--- a/src/routes/print/+layout.ts
+++ b/src/routes/print/+layout.ts
@@ -1 +1 @@
-export const prerender = true; // used for SSG(static site generation)
\ No newline at end of file
+export const prerender = true; // used for SSG(static site generation)
diff --git a/src/routes/print/+page.svelte b/src/routes/print/+page.svelte
index 697089f..38bfd42 100644
--- a/src/routes/print/+page.svelte
+++ b/src/routes/print/+page.svelte
@@ -1,5 +1,5 @@
diff --git a/src/store.ts b/src/store.ts
index 36accc7..886d0ac 100644
--- a/src/store.ts
+++ b/src/store.ts
@@ -1,17 +1,18 @@
-import { writable } from "svelte/store";
import { browser } from "$app/environment";
+import { writable } from "svelte/store";
type InvoiceRow = {
description: string;
rate: number | undefined;
quantity: number | undefined;
amount: string;
-}
+};
type InvoiceData = {
rows: Array;
currencySymbol: string;
totalAmount: number;
+
notes: string;
from: string;
to: string;
@@ -20,14 +21,14 @@ type InvoiceData = {
dueDate: string;
logoFilename: string;
logoBase64Img: string;
-}
+};
export const invoice = writable(fromLocalStorage());
invoice.subscribe(toLocalStorage);
// Get the values from localStorage if in browser and the value is stored
-function fromLocalStorage(key: string = "lamia-invoice-data"): InvoiceData {
- let empty: InvoiceData = {
+function fromLocalStorage(key = "lamia-invoice-data"): InvoiceData {
+ const empty: InvoiceData = {
rows: [
{
description: "",
@@ -50,7 +51,7 @@ function fromLocalStorage(key: string = "lamia-invoice-data"): InvoiceData {
if (!browser) {
return empty;
}
-
+
const stored = window.localStorage.getItem(key);
if (stored != null) {
return JSON.parse(stored);
@@ -65,4 +66,4 @@ function toLocalStorage(d: InvoiceData) {
return;
}
localStorage.setItem("lamia-invoice-data", JSON.stringify(d));
-}
\ No newline at end of file
+}
diff --git a/static/manifest.json b/static/manifest.json
index a1cdef8..32a7b7d 100644
--- a/static/manifest.json
+++ b/static/manifest.json
@@ -1 +1,19 @@
-{"name":"Lamia","short_name":"Lamia","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
\ No newline at end of file
+{
+ "name": "Lamia",
+ "short_name": "Lamia",
+ "icons": [
+ {
+ "src": "/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/android-chrome-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/svelte.config.js b/svelte.config.js
index f94c348..b832320 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -3,18 +3,16 @@ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
/** @type {import('@sveltejs/kit').Config} */
const config = {
- preprocess: [
- vitePreprocess(),
- ],
- kit: {
- adapter: adapter({
- pages: "build",
- assets: "build",
- fallback: undefined,
- precompress: false,
- strict: true
- }),
- },
+ preprocess: [vitePreprocess()],
+ kit: {
+ adapter: adapter({
+ pages: "build",
+ assets: "build",
+ fallback: undefined,
+ precompress: false,
+ strict: true,
+ }),
+ },
};
export default config;
diff --git a/tsconfig.json b/tsconfig.json
index fe1b114..9960ed4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,18 +1,18 @@
{
- "extends": "./.svelte-kit/tsconfig.json",
- "compilerOptions": {
- "allowJs": true,
- "checkJs": true,
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "resolveJsonModule": true,
- "skipLibCheck": true,
- "sourceMap": true,
- "strict": true,
- "moduleResolution": "bundler",
- }
- // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
- //
- // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
- // from the referenced tsconfig.json - TypeScript does not merge them in
+ "extends": "./.svelte-kit/tsconfig.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "checkJs": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "sourceMap": true,
+ "strict": true,
+ "moduleResolution": "bundler"
+ }
+ // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
+ //
+ // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
+ // from the referenced tsconfig.json - TypeScript does not merge them in
}
diff --git a/vite.config.ts b/vite.config.ts
index bbf8c7d..4a79a4b 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,6 +1,6 @@
-import { sveltekit } from '@sveltejs/kit/vite';
-import { defineConfig } from 'vite';
+import { sveltekit } from "@sveltejs/kit/vite";
+import { defineConfig } from "vite";
export default defineConfig({
- plugins: [sveltekit()]
+ plugins: [sveltekit()],
});