ChemPal Documentation - v1.6.0
    Preparing search index...
    • Read all stats from IndexedDB, returning the SupplierStatsData shape: { [dateKey]: { [supplier]: SupplierDayStats } }. Recording runs in every build; only the stats UI is gated (dev builds, or advanced mode).

      Returns Promise<SupplierStatsData>

      export async function getStats(): Promise<SupplierStatsData> {
      // Flush any pending increments first
      await flushToStorage();
      try {
      return await getAllSupplierStats();
      } catch (error) {
      console.warn('Failed to read supplier stats:', error);
      return {};
      }
      }