importing sales started

This commit is contained in:
Martin Brodbeck 2018-08-02 15:28:35 +02:00
parent c82378dfa9
commit 0a91de4d86
5 changed files with 54 additions and 2 deletions

View file

@ -86,4 +86,19 @@ void JsonUtil::exportSales(const std::string& filename, Marketplace* market, int
}
writer->write(root, &file);
}
void JsonUtil::importSales(const std::string& filename, Marketplace* market, int cashPointNo)
{
Json::Value jsonValues;
std::ifstream file(filename);
file >> jsonValues;
int source_no = jsonValues["source_no"].asInt();
if (source_no == cashPointNo) {
throw std::runtime_error("Die Kassen-Nr. der zu imporierenden Daten wird von dieser Kasse "
"hier bereits verwendet.");
}
// TODO: Import sales
}

View file

@ -11,6 +11,7 @@ class JsonUtil
static void exportSellers(const std::string& filename, Marketplace* market);
static void importSellers(const std::string& filename, Marketplace* market);
static void exportSales(const std::string& filename, Marketplace* market, int cashPointNo);
static void importSales(const std::string& filename, Marketplace* market, int cashPointNo);
};
#endif