2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 12:08:27 +00:00

Merge pull request #715 from frappe/fix-terms

fix: minor UI/UX fixes and improvements
This commit is contained in:
Alan 2023-08-28 00:30:38 -07:00 committed by GitHub
commit 457559d8de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 61 additions and 38 deletions

View File

@ -56,6 +56,7 @@ export async function setupDummyInstance(
ModelNameEnum.SystemSettings,
'instanceId'
)) as string;
await fyo.singles.SystemSettings?.setAndSync('hideGetStarted', true);
fyo.store.skipTelemetryLogging = false;
return { companyName: options.companyName, instanceId };

View File

@ -478,23 +478,12 @@ export abstract class InvoiceItem extends Doc {
static filters: FiltersMap = {
item: (doc: Doc) => {
const itemList = doc.parentdoc!.items as Doc[];
const items = itemList.map((d) => d.item as string).filter(Boolean);
let itemNotFor = 'Sales';
if (doc.isSales) {
itemNotFor = 'Purchases';
}
const baseFilter = { for: ['not in', [itemNotFor]] };
if (items.length <= 0) {
return baseFilter;
}
return {
name: ['not in', items],
...baseFilter,
};
return { for: ['not in', [itemNotFor]] };
},
};

View File

@ -170,7 +170,7 @@ export function getMakeReturnDocAction(fyo: Fyo): Action {
doc.isSubmitted &&
!doc.isReturn,
action: async (doc: Doc) => {
const returnDoc = await (doc as StockTransfer).getReturnDoc();
const returnDoc = await (doc as StockTransfer)?.getReturnDoc();
if (!returnDoc || !returnDoc.name) {
return;
}

View File

@ -30,13 +30,6 @@
"fieldtype": "Data",
"required": true
},
{
"fieldname": "state",
"label": "State",
"placeholder": "State",
"options": [],
"fieldtype": "AutoComplete"
},
{
"fieldname": "country",
"label": "Country",
@ -45,6 +38,13 @@
"options": [],
"required": true
},
{
"fieldname": "state",
"label": "State",
"placeholder": "State",
"options": [],
"fieldtype": "AutoComplete"
},
{
"fieldname": "postalCode",
"label": "Postal Code",
@ -83,8 +83,8 @@
"addressLine1",
"addressLine2",
"city",
"state",
"country",
"state",
"postalCode"
],
"linkDisplayField": "addressDisplay"

View File

@ -20,12 +20,8 @@
"section": "Default"
},
{
"abstract": true,
"fieldname": "party",
"label": "Party",
"fieldtype": "Link",
"target": "Party",
"create": true,
"required": true,
"section": "Default"
},
{
@ -167,10 +163,8 @@
"section": "Outstanding"
},
{
"abstract": true,
"fieldname": "stockNotTransferred",
"label": "Stock Not Transferred",
"fieldtype": "Float",
"readOnly": true,
"section": "Outstanding"
},
{

View File

@ -20,7 +20,7 @@
},
{
"fieldname": "for",
"label": "For",
"label": "Purpose",
"fieldtype": "Select",
"options": [
{
@ -126,7 +126,7 @@
},
{
"fieldname": "trackItem",
"label": "Track Item",
"label": "Track Inventory",
"fieldtype": "Check",
"section": "Inventory",
"default": false

View File

@ -15,6 +15,15 @@
"default": "PINV-",
"section": "Default"
},
{
"fieldname": "party",
"label": "Supplier",
"fieldtype": "Link",
"target": "Party",
"create": true,
"required": true,
"section": "Default"
},
{
"fieldname": "backReference",
"label": "Back Reference",
@ -38,6 +47,13 @@
"required": true,
"edit": true,
"section": "Items"
},
{
"fieldname": "stockNotTransferred",
"label": "Stock Not Received",
"fieldtype": "Float",
"readOnly": true,
"section": "Outstanding"
}
],
"keywordFields": ["name", "party"]

View File

@ -15,6 +15,15 @@
"default": "SINV-",
"section": "Default"
},
{
"fieldname": "party",
"label": "Customer",
"fieldtype": "Link",
"target": "Party",
"create": true,
"required": true,
"section": "Default"
},
{
"fieldname": "backReference",
"label": "Back Reference",
@ -38,6 +47,13 @@
"required": true,
"edit": true,
"section": "Items"
},
{
"fieldname": "stockNotTransferred",
"label": "Stock Not Shipped",
"fieldtype": "Float",
"readOnly": true,
"section": "Outstanding"
}
],
"keywordFields": ["name", "party"]

View File

@ -1,6 +1,6 @@
{
"name": "Tax",
"label": "Tax",
"label": "Tax Template",
"naming": "manual",
"isSingle": false,
"isChild": false,

View File

@ -13,8 +13,8 @@
"addressLine1",
"addressLine2",
"city",
"state",
"country",
"state",
"postalCode",
"pos"
]

View File

@ -18,6 +18,7 @@
rounded-lg
border
"
:class="[config.containerBorder]"
style="pointer-events: auto"
>
<feather-icon
@ -51,11 +52,10 @@
</Teleport>
</template>
<script lang="ts">
import { getColorClass } from 'src/utils/colors';
import { getIconConfig } from 'src/utils/interactive';
import { ToastDuration, ToastType } from 'src/utils/types';
import { toastDurationMap } from 'src/utils/ui';
import { defineComponent, nextTick, PropType } from 'vue';
import { PropType, defineComponent, nextTick } from 'vue';
import FeatherIcon from './FeatherIcon.vue';
export default defineComponent({

View File

@ -359,6 +359,7 @@ export default defineComponent({
await this.setFiles();
this.fyo.telemetry.log(Verb.Created, 'dummy-instance');
this.creatingDemo = false;
this.$emit('file-selected', filePath);
},
async setFiles() {
const dbList = await ipc.getDbList();

View File

@ -34,7 +34,11 @@ export function getBgColorClass(color: string) {
return `bg-${vcolor}-200`;
}
export function getColorClass(color: string, type: 'bg' | 'text', value = 300) {
export function getColorClass(
color: string,
type: 'bg' | 'text' | 'border',
value = 300
) {
return `${type}-${getValidColor(color)}-${value}`;
}

View File

@ -70,6 +70,8 @@ export function getIconConfig(type: ToastType) {
}[type];
const iconColor = getColorClass(color ?? 'gray', 'text', 400);
const containerBackground = getColorClass(color ?? 'gray', 'bg', 100);
const containerBorder = getColorClass(color ?? 'gray', 'border', 300);
return { iconName, color, iconColor };
return { iconName, color, iconColor, containerBorder, containerBackground };
}

View File

@ -269,7 +269,7 @@ function getCompleteSidebar(): SidebarConfig {
route: '/chart-of-accounts',
},
{
label: t`Taxes`,
label: t`Tax Templates`,
name: 'taxes',
route: '/list/Tax',
schemaName: 'Tax',