mirror of
https://github.com/frappe/books.git
synced 2025-01-24 07:38:25 +00:00
incr: fix types
This commit is contained in:
parent
603f2d972f
commit
22b9b6e1a4
@ -249,7 +249,7 @@ export class Doc extends Observable<DocValue | Doc[]> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
get shouldDocSyncToERPNext() {
|
get shouldDocSyncToERPNext(): boolean {
|
||||||
const syncEnabled = !!this.fyo.singles.ERPNextSyncSettings?.isEnabled;
|
const syncEnabled = !!this.fyo.singles.ERPNextSyncSettings?.isEnabled;
|
||||||
if (!syncEnabled) {
|
if (!syncEnabled) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -52,7 +52,8 @@ export function initERPNSync(fyo: Fyo) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const syncInterval = fyo.singles.ERPNextSyncSettings?.dataSyncInterval;
|
const syncInterval = fyo.singles.ERPNextSyncSettings
|
||||||
|
?.dataSyncInterval as number;
|
||||||
|
|
||||||
if (!syncInterval) {
|
if (!syncInterval) {
|
||||||
return;
|
return;
|
||||||
@ -72,8 +73,8 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = fyo.singles.ERPNextSyncSettings?.authToken;
|
const token = fyo.singles.ERPNextSyncSettings?.authToken as string;
|
||||||
const endpoint = fyo.singles.ERPNextSyncSettings?.endpoint;
|
const endpoint = fyo.singles.ERPNextSyncSettings?.endpoint as string;
|
||||||
|
|
||||||
if (!token || !endpoint) {
|
if (!token || !endpoint) {
|
||||||
return;
|
return;
|
||||||
@ -104,7 +105,7 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await existingDoc.setMultiple(doc);
|
await existingDoc.setMultiple(doc);
|
||||||
await performPreSync(fyo, doc, existingDoc);
|
await performPreSync(fyo, doc);
|
||||||
existingDoc._addDocToSyncQueue = false;
|
existingDoc._addDocToSyncQueue = false;
|
||||||
|
|
||||||
await existingDoc.sync();
|
await existingDoc.sync();
|
||||||
@ -125,7 +126,7 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
|
|||||||
try {
|
try {
|
||||||
const newDoc = fyo.doc.getNewDoc(getDocTypeName(doc), doc);
|
const newDoc = fyo.doc.getNewDoc(getDocTypeName(doc), doc);
|
||||||
|
|
||||||
await performPreSync(fyo, doc, newDoc);
|
await performPreSync(fyo, doc);
|
||||||
newDoc._addDocToSyncQueue = false;
|
newDoc._addDocToSyncQueue = false;
|
||||||
|
|
||||||
await newDoc.sync();
|
await newDoc.sync();
|
||||||
@ -497,7 +498,7 @@ export function getShouldDocSyncToERPNext(
|
|||||||
syncSettings.supplierSyncType !== 'ERPNext to FBooks'
|
syncSettings.supplierSyncType !== 'ERPNext to FBooks'
|
||||||
);
|
);
|
||||||
|
|
||||||
case ModelNameEnum.PriceListItem:
|
case 'PriceListItem':
|
||||||
const isPriceListSyncEnabled = !!syncSettings.syncPriceList;
|
const isPriceListSyncEnabled = !!syncSettings.syncPriceList;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user