|
|
|
@ -222,7 +222,7 @@ return str;
|
|
|
|
|
|
|
|
|
|
TQString posConv( TQString str, int zeros )
|
|
|
|
|
{
|
|
|
|
|
int point=str.tqfind(".",0);
|
|
|
|
|
int point=str.find(".",0);
|
|
|
|
|
TQString dec= TQString("%1").tqarg(str.mid(point+1,1));
|
|
|
|
|
str = str.mid(0,point);
|
|
|
|
|
str = TQString("%1%2").tqarg(str).tqarg(dec);
|
|
|
|
@ -439,7 +439,7 @@ temp = TQString(buf);
|
|
|
|
|
// LF = = 10
|
|
|
|
|
// CR = \r = 13
|
|
|
|
|
|
|
|
|
|
if (temp.tqfind(TQString("\r"),0,1)==-1) result+= temp;
|
|
|
|
|
if (temp.find(TQString("\r"),0,1)==-1) result+= temp;
|
|
|
|
|
else {
|
|
|
|
|
result+= temp;
|
|
|
|
|
exit=0;
|
|
|
|
@ -489,138 +489,138 @@ TQString getData(const TQString &etext, const TQString &art, const TQString &gro
|
|
|
|
|
TQString temp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (etext.tqcontains("[serial_watch]") ) etext.tqreplace( "[serial_watch]" , serialWatch() );
|
|
|
|
|
if (etext.tqcontains("[customer_no]") ) etext.tqreplace( "[customer_no]" , id );
|
|
|
|
|
if (etext.tqcontains("[customer_name]") ) etext.tqreplace( "[customer_name]" , name );
|
|
|
|
|
if (etext.tqcontains("[group]") ) etext.tqreplace( "[group]" , group );
|
|
|
|
|
if (etext.tqcontains("[article_no]") ) etext.tqreplace( "[article_no]" , art );
|
|
|
|
|
if (etext.tqcontains("[line1]") ) {
|
|
|
|
|
if (etext.contains("[serial_watch]") ) etext.replace( "[serial_watch]" , serialWatch() );
|
|
|
|
|
if (etext.contains("[customer_no]") ) etext.replace( "[customer_no]" , id );
|
|
|
|
|
if (etext.contains("[customer_name]") ) etext.replace( "[customer_name]" , name );
|
|
|
|
|
if (etext.contains("[group]") ) etext.replace( "[group]" , group );
|
|
|
|
|
if (etext.contains("[article_no]") ) etext.replace( "[article_no]" , art );
|
|
|
|
|
if (etext.contains("[line1]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line1 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line1]" , temp );
|
|
|
|
|
etext.replace( "[line1]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line0]") ) {
|
|
|
|
|
if (etext.contains("[line0]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line0 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line0]" , temp );
|
|
|
|
|
etext.replace( "[line0]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line2]") ) {
|
|
|
|
|
if (etext.contains("[line2]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line2 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line2]" , temp );
|
|
|
|
|
etext.replace( "[line2]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line3]") ) {
|
|
|
|
|
if (etext.contains("[line3]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line3 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line3]" , temp );
|
|
|
|
|
etext.replace( "[line3]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line4]") ) {
|
|
|
|
|
if (etext.contains("[line4]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line4 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line4]" , temp );
|
|
|
|
|
etext.replace( "[line4]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line5]") ) {
|
|
|
|
|
if (etext.contains("[line5]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line5 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line5]" , temp );
|
|
|
|
|
etext.replace( "[line5]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line6]") ) {
|
|
|
|
|
if (etext.contains("[line6]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line6 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line6]" , temp );
|
|
|
|
|
etext.replace( "[line6]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line7]") ) {
|
|
|
|
|
if (etext.contains("[line7]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line7 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line7]" , temp );
|
|
|
|
|
etext.replace( "[line7]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line8]") ) {
|
|
|
|
|
if (etext.contains("[line8]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line8 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line8]" , temp );
|
|
|
|
|
etext.replace( "[line8]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[line9]") ) {
|
|
|
|
|
if (etext.contains("[line9]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT line9 FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[line9]" , temp );
|
|
|
|
|
etext.replace( "[line9]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field0]") ) {
|
|
|
|
|
if (etext.contains("[field0]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field0 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field0]" , temp );
|
|
|
|
|
etext.replace( "[field0]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field1]") ) {
|
|
|
|
|
if (etext.contains("[field1]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field1 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field1]" , temp );
|
|
|
|
|
etext.replace( "[field1]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field2]") ) {
|
|
|
|
|
if (etext.contains("[field2]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field2 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field2]" , temp );
|
|
|
|
|
etext.replace( "[field2]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field3]") ) {
|
|
|
|
|
if (etext.contains("[field3]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field3 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field3]" , temp );
|
|
|
|
|
etext.replace( "[field3]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field4]") ) {
|
|
|
|
|
if (etext.contains("[field4]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field4 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field4]" , temp );
|
|
|
|
|
etext.replace( "[field4]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field5]") ) {
|
|
|
|
|
if (etext.contains("[field5]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field5 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field5]" , temp );
|
|
|
|
|
etext.replace( "[field5]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field6]") ) {
|
|
|
|
|
if (etext.contains("[field6]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field6 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field6]" , temp );
|
|
|
|
|
etext.replace( "[field6]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field7]") ) {
|
|
|
|
|
if (etext.contains("[field7]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field7 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field7]" , temp );
|
|
|
|
|
etext.replace( "[field7]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field8]") ) {
|
|
|
|
|
if (etext.contains("[field8]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field8 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field8]" , temp );
|
|
|
|
|
etext.replace( "[field8]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field9]") ) {
|
|
|
|
|
if (etext.contains("[field9]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field9]" , temp );
|
|
|
|
|
etext.replace( "[field9]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[article_desc]") ) {
|
|
|
|
|
if (etext.contains("[article_desc]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT article_desc FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[article_desc]" , temp );
|
|
|
|
|
etext.replace( "[article_desc]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[barcode_no]") ) {
|
|
|
|
|
if (etext.contains("[barcode_no]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT barcode_no FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[barcode_no]" , temp );
|
|
|
|
|
etext.replace( "[barcode_no]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[field9]") ) {
|
|
|
|
|
if (etext.contains("[field9]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[field9]" , temp );
|
|
|
|
|
etext.replace( "[field9]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[article_no_customer]") ) {
|
|
|
|
|
if (etext.contains("[article_no_customer]") ) {
|
|
|
|
|
TQSqlQuery query("SELECT article_no_customer FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace( "[article_no_customer]" , temp );
|
|
|
|
|
etext.replace( "[article_no_customer]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[barcode_no_customer]") ){
|
|
|
|
|
if (etext.contains("[barcode_no_customer]") ){
|
|
|
|
|
TQSqlQuery query("SELECT barcode_no FROM customer_text where customer_no='" + id + "'" );
|
|
|
|
|
while( query.next() ) temp = TQString (query.value( 0 ).toString());
|
|
|
|
|
etext.tqreplace("[barcode_no_customer]" , temp );
|
|
|
|
|
etext.replace("[barcode_no_customer]" , temp );
|
|
|
|
|
}
|
|
|
|
|
if (etext.tqcontains("[date]") ) etext.tqreplace( "[date]" ,TQDateTime::tqcurrentDateTime().toString( KBarcodeSettings::getDateFormat() ));
|
|
|
|
|
if (etext.tqcontains("[time]") ) etext.tqreplace( "[time]" ,TQTime::currentTime().toString());
|
|
|
|
|
if (etext.contains("[date]") ) etext.replace( "[date]" ,TQDateTime::tqcurrentDateTime().toString( KBarcodeSettings::getDateFormat() ));
|
|
|
|
|
if (etext.contains("[time]") ) etext.replace( "[time]" ,TQTime::currentTime().toString());
|
|
|
|
|
|
|
|
|
|
return etext;*/
|
|
|
|
|
}
|
|
|
|
|