mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
incr: set user email on created, modded
- set specific purposed payment paths in search
This commit is contained in:
parent
b7f0757d69
commit
58dce76d10
@ -40,6 +40,14 @@ export class AuthHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set user(value: string) {
|
||||||
|
this.#session.user = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get user(): string {
|
||||||
|
return this.#session.user;
|
||||||
|
}
|
||||||
|
|
||||||
get session(): Readonly<Session> {
|
get session(): Readonly<Session> {
|
||||||
return { ...this.#session };
|
return { ...this.#session };
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ export async function initializeInstance(
|
|||||||
await fyo.initializeAndRegister(models, regionalModels);
|
await fyo.initializeAndRegister(models, regionalModels);
|
||||||
|
|
||||||
await setSingles(fyo);
|
await setSingles(fyo);
|
||||||
|
await setCreds(fyo);
|
||||||
await setCurrencySymbols(fyo);
|
await setCurrencySymbols(fyo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,6 +39,15 @@ async function setSingles(fyo: Fyo) {
|
|||||||
await fyo.doc.getSingle(ModelNameEnum.GetStarted);
|
await fyo.doc.getSingle(ModelNameEnum.GetStarted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setCreds(fyo: Fyo) {
|
||||||
|
const email = (await fyo.getValue(
|
||||||
|
ModelNameEnum.AccountingSettings,
|
||||||
|
'email'
|
||||||
|
)) as string | undefined;
|
||||||
|
const user = fyo.auth.user;
|
||||||
|
fyo.auth.user = email ?? user;
|
||||||
|
}
|
||||||
|
|
||||||
async function setCurrencySymbols(fyo: Fyo) {
|
async function setCurrencySymbols(fyo: Fyo) {
|
||||||
const currencies = (await fyo.db.getAll(ModelNameEnum.Currency, {
|
const currencies = (await fyo.db.getAll(ModelNameEnum.Currency, {
|
||||||
fields: ['name', 'symbol'],
|
fields: ['name', 'symbol'],
|
||||||
|
@ -165,6 +165,10 @@ function getListViewList(): SearchItem[] {
|
|||||||
label: t`Sales Items`,
|
label: t`Sales Items`,
|
||||||
route: `/list/Item/for/Sales/${t`Sales Items`}`,
|
route: `/list/Item/for/Sales/${t`Sales Items`}`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t`Sales Payments`,
|
||||||
|
route: `/list/Payment/paymentType/Receive/${t`Sales Payments`}`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t`Purchase Items`,
|
label: t`Purchase Items`,
|
||||||
route: `/list/Item/for/Purchases/${t`Purchase Items`}`,
|
route: `/list/Item/for/Purchases/${t`Purchase Items`}`,
|
||||||
@ -173,6 +177,10 @@ function getListViewList(): SearchItem[] {
|
|||||||
label: t`Common Items`,
|
label: t`Common Items`,
|
||||||
route: `/list/Item/for/Both/${t`Common Items`}`,
|
route: `/list/Item/for/Both/${t`Common Items`}`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t`Purchase Payments`,
|
||||||
|
route: `/list/Payment/paymentType/Pay/${t`Purchase Payments`}`,
|
||||||
|
},
|
||||||
].map((i) => ({ ...i, group: 'List' } as SearchItem));
|
].map((i) => ({ ...i, group: 'List' } as SearchItem));
|
||||||
|
|
||||||
return [standardLists, filteredLists].flat();
|
return [standardLists, filteredLists].flat();
|
||||||
|
@ -55,7 +55,7 @@ function getCompleteSidebar(): SidebarConfig {
|
|||||||
schemaName: 'SalesInvoice',
|
schemaName: 'SalesInvoice',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`Payments`,
|
label: t`Sales Payments`,
|
||||||
name: 'payments',
|
name: 'payments',
|
||||||
route: '/list/Payment/paymentType/Receive',
|
route: '/list/Payment/paymentType/Receive',
|
||||||
schemaName: 'Payment',
|
schemaName: 'Payment',
|
||||||
@ -87,7 +87,7 @@ function getCompleteSidebar(): SidebarConfig {
|
|||||||
schemaName: 'PurchaseInvoice',
|
schemaName: 'PurchaseInvoice',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t`Payments`,
|
label: t`Purchase Payments`,
|
||||||
name: 'payments',
|
name: 'payments',
|
||||||
route: '/list/Payment/paymentType/Pay',
|
route: '/list/Payment/paymentType/Pay',
|
||||||
schemaName: 'Payment',
|
schemaName: 'Payment',
|
||||||
|
Loading…
Reference in New Issue
Block a user