mirror of
https://github.com/frappe/books.git
synced 2025-01-24 07:38:25 +00:00
feat: models for erpnext sync
This commit is contained in:
parent
dae9ed2244
commit
3d94b4b8ea
61
models/baseModels/ERPNextSyncSettings/ERPNextSyncSettings.ts
Normal file
61
models/baseModels/ERPNextSyncSettings/ERPNextSyncSettings.ts
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import { Doc } from 'fyo/model/doc';
|
||||||
|
import { HiddenMap } from 'fyo/model/types';
|
||||||
|
|
||||||
|
export class ERPNextSyncSettings extends Doc {
|
||||||
|
endpoint?: string;
|
||||||
|
authToken?: string;
|
||||||
|
integrationAppVersion?: string;
|
||||||
|
isEnabled?: boolean;
|
||||||
|
dataSyncInterval?: number;
|
||||||
|
|
||||||
|
syncItem?: boolean;
|
||||||
|
itemSyncType?: string;
|
||||||
|
|
||||||
|
syncCustomer?: boolean;
|
||||||
|
customerSyncType?: string;
|
||||||
|
|
||||||
|
syncSupplier?: boolean;
|
||||||
|
supplierSyncType?: string;
|
||||||
|
|
||||||
|
syncSalesInvoice?: boolean;
|
||||||
|
salesInvoiceSyncType?: string;
|
||||||
|
|
||||||
|
syncSalesInvoicePayment?: boolean;
|
||||||
|
sinvPaymentType?: string;
|
||||||
|
|
||||||
|
syncStockMovement?: boolean;
|
||||||
|
stockMovementSyncType?: string;
|
||||||
|
|
||||||
|
syncPriceList?: boolean;
|
||||||
|
priceListSyncType?: string;
|
||||||
|
|
||||||
|
syncSerialNumber?: boolean;
|
||||||
|
serialNumberSyncType?: string;
|
||||||
|
|
||||||
|
syncBatch?: boolean;
|
||||||
|
batchSyncType?: string;
|
||||||
|
|
||||||
|
syncShipment?: boolean;
|
||||||
|
shipmentSyncType?: string;
|
||||||
|
|
||||||
|
hidden: HiddenMap = {
|
||||||
|
syncPriceList: () => {
|
||||||
|
return !this.fyo.singles.AccountingSettings?.enablePriceList;
|
||||||
|
},
|
||||||
|
priceListSyncType: () => {
|
||||||
|
return !this.fyo.singles.AccountingSettings?.enablePriceList;
|
||||||
|
},
|
||||||
|
syncSerialNumber: () => {
|
||||||
|
return !this.fyo.singles.InventorySettings?.enableSerialNumber;
|
||||||
|
},
|
||||||
|
serialNumberSyncType: () => {
|
||||||
|
return !this.fyo.singles.InventorySettings?.enableSerialNumber;
|
||||||
|
},
|
||||||
|
syncBatch: () => {
|
||||||
|
return !this.fyo.singles.InventorySettings?.enableBatches;
|
||||||
|
},
|
||||||
|
batchSyncType: () => {
|
||||||
|
return !this.fyo.singles.InventorySettings?.enableBatches;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
@ -49,6 +49,7 @@ import { OpeningAmounts } from './inventory/Point of Sale/OpeningAmounts';
|
|||||||
import { OpeningCash } from './inventory/Point of Sale/OpeningCash';
|
import { OpeningCash } from './inventory/Point of Sale/OpeningCash';
|
||||||
import { POSSettings } from './inventory/Point of Sale/POSSettings';
|
import { POSSettings } from './inventory/Point of Sale/POSSettings';
|
||||||
import { POSShift } from './inventory/Point of Sale/POSShift';
|
import { POSShift } from './inventory/Point of Sale/POSShift';
|
||||||
|
import { ERPNextSyncSettings } from './baseModels/ERPNextSyncSettings/ERPNextSyncSettings';
|
||||||
|
|
||||||
export const models = {
|
export const models = {
|
||||||
Account,
|
Account,
|
||||||
@ -103,6 +104,8 @@ export const models = {
|
|||||||
OpeningCash,
|
OpeningCash,
|
||||||
POSSettings,
|
POSSettings,
|
||||||
POSShift,
|
POSShift,
|
||||||
|
// ERPNext Sync
|
||||||
|
ERPNextSyncSettings,
|
||||||
} as ModelMap;
|
} as ModelMap;
|
||||||
|
|
||||||
export async function getRegionalModels(
|
export async function getRegionalModels(
|
||||||
|
@ -59,7 +59,9 @@ export enum ModelNameEnum {
|
|||||||
CustomForm = 'CustomForm',
|
CustomForm = 'CustomForm',
|
||||||
CustomField = 'CustomField',
|
CustomField = 'CustomField',
|
||||||
POSSettings = 'POSSettings',
|
POSSettings = 'POSSettings',
|
||||||
POSShift = 'POSShift'
|
POSShift = 'POSShift',
|
||||||
|
|
||||||
|
ERPNextSyncSettings= 'ERPNextSyncSettings'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ModelName = keyof typeof ModelNameEnum;
|
export type ModelName = keyof typeof ModelNameEnum;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user