Esempio n. 1
0
QString PatientAccounter::createBillFile(const QDate& date)
{
	// \todo This emethod actually needs the current accounted date
	// instead of the current actual date Otherwise this only shows the month
	// and year when the accounting happened
	//Create the bill RTF for this patient
	//Format shall be: Abrechnungen/Date/patientName.rtf
	QString monthString;
	monthString.setNum(date.month());
	QString yearString;
	yearString.setNum(date.year());

	QString billFile("Abrechnungen/");

	billFile.append(yearString);
	billFile.append(monthString);
	mkdir(billFile.toStdString().c_str(), 0777);
	billFile.append("/");

	//\todo What to do when two people have the same name?
	//Possible: if_exists: add: _no. to the fileName
	billFile.append(m_patient.value(FirstName).toString());
	billFile.append(m_patient.value(LastName).toString());

	billFile.append(".rtf");
	return billFile;
}
Esempio n. 2
0
void CashboxWindow::nextCustomer()
{
    //Save Calculation in bilance.csv
    QFile billFile(this->cashboxpath+"bilance.csv");
    billFile.open(QIODevice::WriteOnly|QIODevice::Append);
    QTextStream out(&billFile);
    for(int i = 0; i < MyHotkeys.count(); i++) {
        if(MyHotkeys.at(i)->getCount()>0) {
        //Gehe die einzelnen Hotkeys durch(so wie table-Darstellung und schreibe es anstatt in eine Table in eine Zeile
        out << QString::number(this->last_calc_id) << "," << MyHotkeys.at(i)->getProductname()<< "," << QString::number(MyHotkeys.at(i)->getCount()) << ","<< MyHotkeys.at(i)->getPrice()<<","<<QString::number(MyHotkeys.at(i)->getPrice()*MyHotkeys.at(i)->getCount())<<";\n";
        //Setze Hotkeys-Counts auf 0
        MyHotkeys.at(i)->setCount(0);
        }
    }
    billFile.close();
    //Clear Table
    this->product_table->clear();
    //Old Structur pls
    QTableWidgetItem *amountItem = new QTableWidgetItem("Amount");
    product_table->setHorizontalHeaderItem(0,amountItem);
    QTableWidgetItem *productnameItem = new QTableWidgetItem("Productname");
    product_table->setHorizontalHeaderItem(1,productnameItem);
    QTableWidgetItem *singlePriceItem = new QTableWidgetItem("Single Price");
    product_table->setHorizontalHeaderItem(2,singlePriceItem);
    QTableWidgetItem *totalPriceItem = new QTableWidgetItem("Total Price");
    product_table->setHorizontalHeaderItem(3,totalPriceItem);
    //Delete Calculator
    this->outputNum->setText("");
    //Delete Outputs
    this->totalPrice = 0;
    this->lbTotalPrice->setText(QString::number(this->totalPrice)+"€");
    this->moneyback = 0;
    this->lbMoneyBack->setText(QString::number( this->moneyback)+"€");
    this->payed = 0;
    this->lbPaidPrice->setText(QString::number(this->payed)+"€");
    //Incremente
    this->last_calc_id++;
    this->lbId->setText(QString::number(this->last_calc_id));


}