def _generate_number(self, default_starting_number=1):
        default_starting_number = max(default_starting_number, 1)

        documents = self.__class__._default_manager.filter(
            provider=self.provider, series=self.series
        )
        if not documents.exists():
            # An invoice/proforma with this provider and series does not exist
            if self.series == self.default_series:
                return self._starting_number
            else:
                return default_starting_number
        else:
            # An invoice with this provider and series already exists
            max_existing_number = documents.aggregate(
                Max('number')
            )['number__max']
            if max_existing_number:
                if self._starting_number and self.series == self.default_series:
                    return max(max_existing_number + 1, self._starting_number)
                else:
                    return max_existing_number + 1
            else:
                return default_starting_number
Scans the path specification for a supported volume system format.
dataset/ETHPy150Open PressLabs/silver/silver/models.py/BillingDocument._generate_number--crossover with--dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/helpers/source_scanner.py/SourceScanner.ScanForVolumeSystem