UI changes for HDPI.

Voucher could be marked as EET not entering.
print
Pepa Rokos 8 years ago
parent e028116ab8
commit 94e4edc6e6

@ -18,6 +18,6 @@
#navigation QToolButton { #navigation QToolButton {
color: white; color: white;
font-weight: bold; font-weight: bold;
min-width: 80px; min-width: 90px;
font: 10px; font: 10pt;
} }

@ -123,6 +123,12 @@ QByteArray ReceiptGenerator::generate()
out.append("\x0a"); out.append("\x0a");
out.append(prepareString("IC: " + QString::number(gs->ic()))); out.append(prepareString("IC: " + QString::number(gs->ic())));
out.append("\x0a"); out.append("\x0a");
out.append(prepareString("DIC: " + gs->dic()));
out.append("\x0a");
out.append(prepareString("ID provozovny: " + shopSettings->eetShopId()));
out.append("\x0a");
out.append(prepareString("ID pokladny: " + shopSettings->eetRegisterId()));
out.append("\x0a");
out.append("\x1b\x21"); out.append("\x1b\x21");
out.append(printMode); out.append(printMode);
@ -135,12 +141,14 @@ QByteArray ReceiptGenerator::generate()
out.append("\x0a"); out.append("\x0a");
foreach (QSharedPointer<VoucherItem> item, m_voucher->items()) { foreach (QSharedPointer<VoucherItem> item, m_voucher->items()) {
QString count = QString::number(item->count());
QString name = item->name(); QString name = item->name();
QString price = QString::number(item->price().toDouble(), 'f', 2); QString price = QString::number(item->price().toDouble(), 'f', 2);
int numSpaces = 0; int numSpaces = 0;
if ((name.length() + price.length()) < shopSettings->lettersPerLine()) if ((name.length() + price.length()) < shopSettings->lettersPerLine())
{ {
name = count + "x " + name;
numSpaces = shopSettings->lettersPerLine() - (name.length() + price.length()); numSpaces = shopSettings->lettersPerLine() - (name.length() + price.length());
out.append(prepareString(name)); out.append(prepareString(name));
} }
@ -171,7 +179,7 @@ QByteArray ReceiptGenerator::generate()
out.append("\x1b\x21"); out.append("\x1b\x21");
out.append(printMode); out.append(printMode);
out.append("Celekem:"); out.append("Celkem:");
QString totalPrice = QString::number(m_voucher->totalPrice().toDouble(), 'f', 2); QString totalPrice = QString::number(m_voucher->totalPrice().toDouble(), 'f', 2);
int numSpaces = shopSettings->lettersPerLine() - (8 + totalPrice.length()); int numSpaces = shopSettings->lettersPerLine() - (8 + totalPrice.length());
@ -184,6 +192,8 @@ QByteArray ReceiptGenerator::generate()
out.append("\x1b\x21"); out.append("\x1b\x21");
out.append((char)0); out.append((char)0);
out.append("\x0a"); out.append("\x0a");
if (!m_voucher->eetBkp().isEmpty())
{
out.append("BKP:"); out.append("BKP:");
out.append("\x0a"); out.append("\x0a");
out.append(prepareString(m_voucher->eetBkp())); out.append(prepareString(m_voucher->eetBkp()));
@ -193,6 +203,9 @@ QByteArray ReceiptGenerator::generate()
out.append(prepareString(m_voucher->eetFik())); out.append(prepareString(m_voucher->eetFik()));
out.append("\x0a"); out.append("\x0a");
out.append("\x0a"); out.append("\x0a");
}
out.append("\x0a");
out.append("\x0a");
out.append("\x0a"); out.append("\x0a");
return out; return out;

@ -333,6 +333,8 @@ void ShopForm::on_payButton_clicked()
connect(dialog, &QDialog::accepted, [this, dialog](){ connect(dialog, &QDialog::accepted, [this, dialog](){
ShopService srv; ShopService srv;
srv.pay(m_voucher); srv.pay(m_voucher);
m_voucher->setEetStatus(dialog->sendToEet() ? Voucher::EET_FOR_SEND : Voucher::EET_NOT_ENTERING);
srv.update(m_voucher);
QString eetMsg; QString eetMsg;
if (srv.isEetEnabled() && dialog->sendToEet()) if (srv.isEetEnabled() && dialog->sendToEet())

@ -37,12 +37,6 @@
</property> </property>
<item> <item>
<widget class="QWidget" name="widgetComodity" native="true"> <widget class="QWidget" name="widgetComodity" native="true">
<property name="maximumSize">
<size>
<width>500</width>
<height>16777215</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="commodity"> <widget class="QLabel" name="commodity">
@ -555,7 +549,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Show paied</string> <string>Show paid</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="shoprc.qrc"> <iconset resource="shoprc.qrc">
@ -600,8 +594,8 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="shoprc.qrc"/>
<include location="../core/rc.qrc"/> <include location="../core/rc.qrc"/>
<include location="shoprc.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

Loading…
Cancel
Save