Skip to content

Commit

Permalink
report files language changes applied
Browse files Browse the repository at this point in the history
  • Loading branch information
gvijaydhanasekaran committed May 17, 2014
1 parent 094a96a commit 72dc995
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 17 deletions.
35 changes: 32 additions & 3 deletions src/angadimainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,17 @@ void AngadiMainWindow::openUnpaidBillReportTab()
if(found == false){
unpaidBillReport = new UnpaidBillReport();
unpaidBillReport->setProperty("name", tabName);
ui->mainTab->addTab(unpaidBillReport, "UnPaid Bill Report");

if(checkLanguage() == "tamil_language"){ //tab language settings
QTranslator translator;
translator.load("tamilLanguage_la");
QApplication::instance()->installTranslator(&translator);
ui->mainTab->addTab(unpaidBillReport, UnpaidBillReport::tr("UnPaid Bill Report"));
}
else{
ui->mainTab->addTab(unpaidBillReport, "UnPaid Bill Report");
}

}
ui->mainTab->setCurrentWidget (unpaidBillReport);
}
Expand All @@ -465,7 +475,16 @@ void AngadiMainWindow::openPeriodWiseSalesTab()
if(found == false){
periodWiseSalesForm = new PeriodWiseSalesForm;
periodWiseSalesForm->setProperty("name", tabName);
ui->mainTab->addTab(periodWiseSalesForm, "Period Wise Sales");

if(checkLanguage() == "tamil_language"){ //tab language settings
QTranslator translator;
translator.load("tamilLanguage_la");
QApplication::instance()->installTranslator(&translator);
ui->mainTab->addTab(periodWiseSalesForm, AngadiMainWindow::tr("Period Wise Sales"));
}
else{
ui->mainTab->addTab(periodWiseSalesForm, "Period Wise Sales");
}
}
ui->mainTab->setCurrentWidget (periodWiseSalesForm);
}
Expand All @@ -479,7 +498,17 @@ void AngadiMainWindow::openTransactionReportTab()
if(found == false){
transactionReport = new TransactionReport();
transactionReport->setProperty("name",tabName);
ui->mainTab->addTab(transactionReport, "Transaction Report");

if(checkLanguage() == "tamil_language"){ //tab language settings
QTranslator translator;
translator.load("tamilLanguage_la");
QApplication::instance()->installTranslator(&translator);
ui->mainTab->addTab(transactionReport, AngadiMainWindow::tr("Transaction Report"));
}
else{
ui->mainTab->addTab(transactionReport, "Transaction Report");
}

}
ui->mainTab->setCurrentWidget (transactionReport);
}
Expand Down
34 changes: 30 additions & 4 deletions src/billform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1128,11 +1128,16 @@ void BillForm::addProductItem()
errors.append("\nThe Product field may be empty or not in our store");
}

if(!formValidation->isDouble(ui->lineEditQty->text()))
if(ui->lineEditQty->text().toDouble() < 0.005){
if(!formValidation->isDouble(ui->lineEditQty->text())){
validError = 1;
errors.append("\n\nThe quantity field may be empty or its very low to sale");
errors.append("\n\nThe quantity field may be empty or not a number.");
}

if(ui->lineEditQty->text().toDouble() < 0.005){
validError = 1;
errors.append("\n\nThe quantity field is very low to sale");
}

if(validError == 0){
int row;
if(productUpdateFlag == 0){
Expand Down Expand Up @@ -1299,7 +1304,28 @@ void BillForm::convertDoubleAll()

void BillForm::defaultProductList()
{
header << "Product Name" << "Qunatity" << "Rate" << "Unit" << "Total" << "Product Id";

QString app_path;
app_path = QApplication::applicationDirPath() + QDir::separator() + "settings.ini";
QSettings settings(app_path,QSettings::IniFormat);
QString content = settings.value("s_language","").toString();

if(content == "tamil_language"){
QTranslator translator;
translator.load("tamilLanguage_la");
// QApplication::installTranslator(&translator);
QApplication::instance()->installTranslator(&translator);
header << BillForm::tr("Product Name") << BillForm::tr("Quantity") << BillForm::tr("Unit Price") << BillForm::tr("Unit") << BillForm::tr("Total") << BillForm::tr("Product Id");
}else{
QTranslator translator;
translator.load("englishLanguage_la");
// QApplication::installTranslator(&translator);
QApplication::instance()->installTranslator(&translator);
header << "Product Name" << "Quantity" << "Rate" << "Unit" << "Total" << "Product Id";
}



columnCount = 6;

ui->tableWidget->setColumnCount(columnCount);
Expand Down
12 changes: 12 additions & 0 deletions src/englishLanguage_la.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@
<source>Are you sure you want to delete this bill?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Product Id</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BillSettings</name>
Expand Down Expand Up @@ -804,5 +808,13 @@
<source>dd/MM/yyyy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>UnPaid Bill Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Date</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Binary file modified src/tamilLanguage_la.qm
Binary file not shown.
22 changes: 19 additions & 3 deletions src/tamilLanguage_la.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@
</message>
<message>
<source>Bill Transactions</source>
<translation type="unfinished"></translation>
<translation type="unfinished">பில் பரிவர்த்தனைகள்</translation>
</message>
<message>
<source>Product List</source>
<translation type="unfinished">பொருட்கள்</translation>
<translation type="unfinished">பொருள்</translation>
</message>
<message>
<source>Tamil</source>
Expand All @@ -124,7 +124,7 @@
</message>
<message>
<source>Period Wise Sales</source>
<translation type="unfinished"></translation>
<translation type="unfinished">விற்பனை அறிக்கை</translation>
</message>
<message>
<source>Transaction Report</source>
Expand Down Expand Up @@ -253,10 +253,18 @@
<source>Quantity</source>
<translation type="unfinished">அளவு</translation>
</message>
<message>
<source>Rate</source>
<translation type="obsolete">விலை</translation>
</message>
<message>
<source>Are you sure you want to delete this bill?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Product Id</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BillSettings</name>
Expand Down Expand Up @@ -839,6 +847,10 @@
</context>
<context>
<name>UnpaidBillReport</name>
<message>
<source>UnPaid Bill Report</source>
<translation type="unfinished">கடன் பில் அறிக்கை</translation>
</message>
<message>
<source>Form</source>
<translation type="unfinished">படிவம்</translation>
Expand All @@ -859,6 +871,10 @@
<source>To Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Date</source>
<translation type="unfinished">தேதி</translation>
</message>
<message>
<source>Customer Name</source>
<translation type="unfinished">வாடிக்கையாளர் பெயர்</translation>
Expand Down
31 changes: 26 additions & 5 deletions src/unpaidbillreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,32 @@ UnpaidBillReport::UnpaidBillReport(QWidget *parent) :
billModel->setTable("bill");
billModel->setEditStrategy(QSqlTableModel::OnManualSubmit);
billModel->setRelation(3, QSqlRelation("customers", "id", "name"));
billModel->setHeaderData(1, Qt::Horizontal,QObject::tr("Invoice No"));
billModel->setHeaderData(2, Qt::Horizontal,QObject::tr("Date"));
billModel->setHeaderData(3, Qt::Horizontal,QObject::tr("Customer Name"));
billModel->setHeaderData(6, Qt::Horizontal,QObject::tr("Bill Amount"));
billModel->setHeaderData(7, Qt::Horizontal,QObject::tr("Balance"));

QString app_path;
app_path = QApplication::applicationDirPath() + QDir::separator() + "settings.ini";
QSettings settings(app_path,QSettings::IniFormat);
QString content = settings.value("s_language","").toString();

if(content == "tamil_language"){
QTranslator translator;
translator.load("tamilLanguage_la");
// QApplication::installTranslator(&translator);
QApplication::instance()->installTranslator(&translator);
billModel->setHeaderData(1, Qt::Horizontal,UnpaidBillReport::tr("Invoice No"));
billModel->setHeaderData(2, Qt::Horizontal,UnpaidBillReport::tr("Date"));
billModel->setHeaderData(3, Qt::Horizontal,UnpaidBillReport::tr("Customer Name"));
billModel->setHeaderData(6, Qt::Horizontal,UnpaidBillReport::tr("Bill Amount"));
billModel->setHeaderData(7, Qt::Horizontal,UnpaidBillReport::tr("Balance"));

}else{
billModel->setHeaderData(1, Qt::Horizontal,QObject::tr("Invoice No"));
billModel->setHeaderData(2, Qt::Horizontal,QObject::tr("Date"));
billModel->setHeaderData(3, Qt::Horizontal,QObject::tr("Customer Name"));
billModel->setHeaderData(6, Qt::Horizontal,QObject::tr("Bill Amount"));
billModel->setHeaderData(7, Qt::Horizontal,QObject::tr("Balance"));
}


filter = "paidStatus = 'U'";
billModel->setFilter(filter);
billModel->select();
Expand Down
7 changes: 5 additions & 2 deletions src/unpaidbillreport.ui
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>776</x>
<x>690</x>
<y>480</y>
<width>51</width>
<width>140</width>
<height>21</height>
</rect>
</property>
Expand All @@ -100,6 +100,9 @@
<property name="text">
<string>Total</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
Expand Down

0 comments on commit 72dc995

Please sign in to comment.