mirror of
https://github.com/frappe/books.git
synced 2025-01-03 15:17:30 +00:00
chore: refactor code
This commit is contained in:
parent
b05c28c00a
commit
257737c8ab
@ -1,5 +1,7 @@
|
|||||||
import { Fyo, t } from 'fyo';
|
import {
|
||||||
import { Doc } from 'fyo/model/doc';
|
AccountRootType,
|
||||||
|
AccountRootTypeEnum,
|
||||||
|
} from './baseModels/Account/types';
|
||||||
import {
|
import {
|
||||||
Action,
|
Action,
|
||||||
ColumnConfig,
|
ColumnConfig,
|
||||||
@ -7,31 +9,30 @@ import {
|
|||||||
LeadStatus,
|
LeadStatus,
|
||||||
RenderData,
|
RenderData,
|
||||||
} from 'fyo/model/types';
|
} from 'fyo/model/types';
|
||||||
|
import { Fyo, t } from 'fyo';
|
||||||
|
import { InvoiceStatus, ModelNameEnum } from './types';
|
||||||
|
|
||||||
|
import { ApplicablePricingRules } from './baseModels/Invoice/types';
|
||||||
|
import { AppliedCouponCodes } from './baseModels/AppliedCouponCodes/AppliedCouponCodes';
|
||||||
|
import { CollectionRulesItems } from './baseModels/CollectionRulesItems/CollectionRulesItems';
|
||||||
|
import { CouponCode } from './baseModels/CouponCode/CouponCode';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import { Money } from 'pesa';
|
import { Doc } from 'fyo/model/doc';
|
||||||
import { safeParseFloat } from 'utils/index';
|
|
||||||
import { Router } from 'vue-router';
|
|
||||||
import {
|
|
||||||
AccountRootType,
|
|
||||||
AccountRootTypeEnum,
|
|
||||||
} from './baseModels/Account/types';
|
|
||||||
import { numberSeriesDefaultsMap } from './baseModels/Defaults/Defaults';
|
|
||||||
import { Invoice } from './baseModels/Invoice/Invoice';
|
import { Invoice } from './baseModels/Invoice/Invoice';
|
||||||
|
import { Lead } from './baseModels/Lead/Lead';
|
||||||
|
import { LoyaltyProgram } from './baseModels/LoyaltyProgram/LoyaltyProgram';
|
||||||
|
import { Money } from 'pesa';
|
||||||
|
import { Party } from './baseModels/Party/Party';
|
||||||
|
import { PricingRule } from './baseModels/PricingRule/PricingRule';
|
||||||
|
import { Router } from 'vue-router';
|
||||||
|
import { SalesInvoice } from './baseModels/SalesInvoice/SalesInvoice';
|
||||||
import { SalesQuote } from './baseModels/SalesQuote/SalesQuote';
|
import { SalesQuote } from './baseModels/SalesQuote/SalesQuote';
|
||||||
import { StockMovement } from './inventory/StockMovement';
|
import { StockMovement } from './inventory/StockMovement';
|
||||||
import { StockTransfer } from './inventory/StockTransfer';
|
import { StockTransfer } from './inventory/StockTransfer';
|
||||||
import { InvoiceStatus, ModelNameEnum } from './types';
|
|
||||||
import { Lead } from './baseModels/Lead/Lead';
|
|
||||||
import { PricingRule } from './baseModels/PricingRule/PricingRule';
|
|
||||||
import { ApplicablePricingRules } from './baseModels/Invoice/types';
|
|
||||||
import { LoyaltyProgram } from './baseModels/LoyaltyProgram/LoyaltyProgram';
|
|
||||||
import { CollectionRulesItems } from './baseModels/CollectionRulesItems/CollectionRulesItems';
|
|
||||||
import { isPesa } from 'fyo/utils';
|
|
||||||
import { Party } from './baseModels/Party/Party';
|
|
||||||
import { CouponCode } from './baseModels/CouponCode/CouponCode';
|
|
||||||
import { SalesInvoice } from './baseModels/SalesInvoice/SalesInvoice';
|
|
||||||
import { AppliedCouponCodes } from './baseModels/AppliedCouponCodes/AppliedCouponCodes';
|
|
||||||
import { ValidationError } from 'fyo/utils/errors';
|
import { ValidationError } from 'fyo/utils/errors';
|
||||||
|
import { isPesa } from 'fyo/utils';
|
||||||
|
import { numberSeriesDefaultsMap } from './baseModels/Defaults/Defaults';
|
||||||
|
import { safeParseFloat } from 'utils/index';
|
||||||
|
|
||||||
export function getQuoteActions(
|
export function getQuoteActions(
|
||||||
fyo: Fyo,
|
fyo: Fyo,
|
||||||
|
@ -39,14 +39,14 @@
|
|||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
"value": "Classic",
|
"value": "Classic",
|
||||||
"label": "POS1"
|
"label": "Classic"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"value": "Modern",
|
"value": "Modern",
|
||||||
"label": "POS2"
|
"label": "Modern"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"default": "POS1",
|
"default": "Classic",
|
||||||
"required": true,
|
"required": true,
|
||||||
"section": "Default"
|
"section": "Default"
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,18 @@ export type ModalName =
|
|||||||
| 'RouteToInvoiceList'
|
| 'RouteToInvoiceList'
|
||||||
| 'CouponCode';
|
| 'CouponCode';
|
||||||
|
|
||||||
|
export type ModernPosModalName =
|
||||||
|
| 'Keyboard'
|
||||||
|
| 'ShiftOpen'
|
||||||
|
| 'ShiftClose'
|
||||||
|
| 'Payment'
|
||||||
|
| 'LoyaltyProgram'
|
||||||
|
| 'SavedInvoice'
|
||||||
|
| 'RouteToInvoiceList'
|
||||||
|
| 'CouponCode';
|
||||||
|
|
||||||
export interface POSItem {
|
export interface POSItem {
|
||||||
|
id?: number;
|
||||||
image?: string;
|
image?: string;
|
||||||
name: string;
|
name: string;
|
||||||
rate: Money;
|
rate: Money;
|
||||||
|
@ -49,7 +49,7 @@ export default defineComponent({
|
|||||||
Modal,
|
Modal,
|
||||||
Button,
|
Button,
|
||||||
},
|
},
|
||||||
emits: ['toggleModal', 'selectedInvoiceName'],
|
emits: ['toggleModal'],
|
||||||
methods: {
|
methods: {
|
||||||
routeTo,
|
routeTo,
|
||||||
},
|
},
|
||||||
|
@ -102,16 +102,12 @@ function getInventorySidebar(): SidebarRoot[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPOSSidebar() {
|
function getPOSSidebar() {
|
||||||
const isPOSEnabled = !!fyo.singles.InventorySettings?.enablePointOfSale;
|
|
||||||
if (!isPOSEnabled) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
label: t`POS`,
|
label: t`POS`,
|
||||||
name: 'pos',
|
name: 'pos',
|
||||||
route: '/pos',
|
route: '/pos',
|
||||||
icon: 'pos',
|
icon: 'pos',
|
||||||
|
hidden: () => !fyo.singles.InventorySettings?.enablePointOfSale,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user