mirror of
https://github.com/frappe/books.git
synced 2025-01-09 09:50:27 +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;
|
||||
}
|
||||
|
||||
get shouldDocSyncToERPNext() {
|
||||
get shouldDocSyncToERPNext(): boolean {
|
||||
const syncEnabled = !!this.fyo.singles.ERPNextSyncSettings?.isEnabled;
|
||||
if (!syncEnabled) {
|
||||
return false;
|
||||
|
@ -52,7 +52,8 @@ export function initERPNSync(fyo: Fyo) {
|
||||
return;
|
||||
}
|
||||
|
||||
const syncInterval = fyo.singles.ERPNextSyncSettings?.dataSyncInterval;
|
||||
const syncInterval = fyo.singles.ERPNextSyncSettings
|
||||
?.dataSyncInterval as number;
|
||||
|
||||
if (!syncInterval) {
|
||||
return;
|
||||
@ -72,8 +73,8 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
|
||||
return;
|
||||
}
|
||||
|
||||
const token = fyo.singles.ERPNextSyncSettings?.authToken;
|
||||
const endpoint = fyo.singles.ERPNextSyncSettings?.endpoint;
|
||||
const token = fyo.singles.ERPNextSyncSettings?.authToken as string;
|
||||
const endpoint = fyo.singles.ERPNextSyncSettings?.endpoint as string;
|
||||
|
||||
if (!token || !endpoint) {
|
||||
return;
|
||||
@ -104,7 +105,7 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
|
||||
);
|
||||
|
||||
await existingDoc.setMultiple(doc);
|
||||
await performPreSync(fyo, doc, existingDoc);
|
||||
await performPreSync(fyo, doc);
|
||||
existingDoc._addDocToSyncQueue = false;
|
||||
|
||||
await existingDoc.sync();
|
||||
@ -125,7 +126,7 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
|
||||
try {
|
||||
const newDoc = fyo.doc.getNewDoc(getDocTypeName(doc), doc);
|
||||
|
||||
await performPreSync(fyo, doc, newDoc);
|
||||
await performPreSync(fyo, doc);
|
||||
newDoc._addDocToSyncQueue = false;
|
||||
|
||||
await newDoc.sync();
|
||||
@ -497,7 +498,7 @@ export function getShouldDocSyncToERPNext(
|
||||
syncSettings.supplierSyncType !== 'ERPNext to FBooks'
|
||||
);
|
||||
|
||||
case ModelNameEnum.PriceListItem:
|
||||
case 'PriceListItem':
|
||||
const isPriceListSyncEnabled = !!syncSettings.syncPriceList;
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user