From 72dc9950a1af93f305aaba8eb76bc41edd36d18a Mon Sep 17 00:00:00 2001 From: vdhanasekaran Date: Sat, 17 May 2014 17:29:23 +0530 Subject: [PATCH] report files language changes applied --- src/angadimainwindow.cpp | 35 ++++++++++++++++++++++++++++++++--- src/billform.cpp | 34 ++++++++++++++++++++++++++++++---- src/englishLanguage_la.ts | 12 ++++++++++++ src/tamilLanguage_la.qm | Bin 10604 -> 10944 bytes src/tamilLanguage_la.ts | 22 +++++++++++++++++++--- src/unpaidbillreport.cpp | 31 ++++++++++++++++++++++++++----- src/unpaidbillreport.ui | 7 +++++-- 7 files changed, 124 insertions(+), 17 deletions(-) diff --git a/src/angadimainwindow.cpp b/src/angadimainwindow.cpp index 1d8d081..7652fdd 100644 --- a/src/angadimainwindow.cpp +++ b/src/angadimainwindow.cpp @@ -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); } @@ -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); } @@ -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); } diff --git a/src/billform.cpp b/src/billform.cpp index 8335bc3..b65c429 100644 --- a/src/billform.cpp +++ b/src/billform.cpp @@ -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){ @@ -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); diff --git a/src/englishLanguage_la.ts b/src/englishLanguage_la.ts index 053b26c..01f107e 100644 --- a/src/englishLanguage_la.ts +++ b/src/englishLanguage_la.ts @@ -249,6 +249,10 @@ Are you sure you want to delete this bill? + + Product Id + + BillSettings @@ -804,5 +808,13 @@ dd/MM/yyyy + + UnPaid Bill Report + + + + Date + + diff --git a/src/tamilLanguage_la.qm b/src/tamilLanguage_la.qm index a4611e2686a0918e34a2e4b6fa90078995b9b552..9888d0961793e6ff073c427caf36a1c991dc2c1e 100644 GIT binary patch delta 1581 zcmZwHYfKzf6bJCL!_4esmR%MW7ItCTWl@O&(Nv%{B|%6_r41sFkOG!ap}I&|ULQp-aFjK zIrq%|ls{S2X;ocB`E^85=|m-MM21-sI}?d$nw8Iz*gHmKEN4S9NbKt)GWD_{AG494 zlXwi{j=OApE{Rt~qM#-=BAdi--zCyrXU#fR4c*8M+hH~;n2q(banG^wDv7HpSnvyy z3}@gnN!!pjZ(_r&Y}5&oj?5sCUN#u-1AX%=tTl}d?^#zR`%WHkX0h&PNt&!8vK}F6 z1`#Obti6?_+0*FXqu>F&cl}K<EJS~fN&+dj zR#Iv8J{&BGjkK_ybTMW>3$E9rcJ1RwSY);2p!WHkKW3=OAODUg@z5m~X!$mA9eq{8Z|UtH*dZY=AeUQTGM}wow}OKx3Gs zUI?U68IjgCcd^#Pp3#bZEATJvwz>WIYLd12wqaz*rtKQPkE>NjxDoZ8w)+p< zrF2p|(0&^=;MNIG{eY_|(@~kX>rmWIn3&D-+6~GEXkFzC?Q%f9I9Y)}Q0bC8bLlQs#AmUj-SDCDU6|<0@>Z zsBNrxsmbfBZS;3Y_MxM4n(&Mhb0?HjnAxvjCRS`kZvrdKUSFlF*xOj; zDyXQbT3^Gzq-)k2F?9|HI5$+QFO2nZh}s;Wo%j0{lPG5<|8hEMyK)D{r>vgb548C z@Ao^ud&e7oN%VRx0Et$hC2f&7gO^S4LSC$(4eKEsr^zme zjWl-kumwprAVD0+0`^7Lp!M9?b%yoqVZ94%;G;WQ2p!~!()|$Q&j6m^AhMK!Bf|#1 zg_t@)6{v!9gw{(N5E`4J3RPjlzDW|OUfu>MN!B^dnpxI=i4EV2>dJoFXO8uD=cM|V zyoZ{Vw*mKN)HF^2z86tzoS~9EhDT)zM7xECkvxqWL%wDwKLA$>Mj| zNRyOGNz@ysq`$XPAo+*#iUWgm_e=Ap_jl3;O>(90LHhj_HgcGa`Q%MWs#xJBHh6-K zYjVfc_o-gH<$;bFs@Q7zm^Dh7*#40}C?nM@>srpbqioR%Hk_8ftELLM&x*Ux(FVcQ z;_)sThyD`1v7IzOPwt{h-7iL?<+SfAF&ZcJ7I7|DG2O|!ZnEBhuU9q-PZY*;rrpE-j23tqv-wc*5BES_56h>&D0q%2Zm# z=3h6)Y%kFPlg3wbYpJAt#`hC>^j$d1hPFCS9-#xhb*}J*4k~rItL{tsfMLN5hdOEh zIy1c6OaFhw-2UGT@=;P{UVU>Ly>_K7z>-AzVbN_%$JCWl>O*^*yFee-r}dBZ&-6k4 Vg5IyEQ}w1dUF%pANu6Fc{6C0VToM2P diff --git a/src/tamilLanguage_la.ts b/src/tamilLanguage_la.ts index 9ddf3f6..b9d5e2e 100644 --- a/src/tamilLanguage_la.ts +++ b/src/tamilLanguage_la.ts @@ -96,11 +96,11 @@ Bill Transactions - + பில் பரிவர்த்தனைகள் Product List - பொருட்கள் + பொருள் Tamil @@ -124,7 +124,7 @@ Period Wise Sales - + விற்பனை அறிக்கை Transaction Report @@ -253,10 +253,18 @@ Quantity அளவு + + Rate + விலை + Are you sure you want to delete this bill? + + Product Id + + BillSettings @@ -839,6 +847,10 @@ UnpaidBillReport + + UnPaid Bill Report + கடன் பில் அறிக்கை + Form படிவம் @@ -859,6 +871,10 @@ To Date + + Date + தேதி + Customer Name வாடிக்கையாளர் பெயர் diff --git a/src/unpaidbillreport.cpp b/src/unpaidbillreport.cpp index 9d6edc3..055e0aa 100644 --- a/src/unpaidbillreport.cpp +++ b/src/unpaidbillreport.cpp @@ -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(); diff --git a/src/unpaidbillreport.ui b/src/unpaidbillreport.ui index 979a2ae..64c616f 100644 --- a/src/unpaidbillreport.ui +++ b/src/unpaidbillreport.ui @@ -84,9 +84,9 @@ - 776 + 690 480 - 51 + 140 21 @@ -100,6 +100,9 @@ Total + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter +