mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-13 22:21:14 +02:00
2022-03-04 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'RDCart::setSchedCodesList()' so as to normalize the case of scheduler codes. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -20853,3 +20853,6 @@
|
|||||||
* Fixed a bug in rdimport(1) that could create duplicate
|
* Fixed a bug in rdimport(1) that could create duplicate
|
||||||
Scheduler Code entries when using the '--to-cart' and
|
Scheduler Code entries when using the '--to-cart' and
|
||||||
'--add-scheduler-code' switches simultaneously.
|
'--add-scheduler-code' switches simultaneously.
|
||||||
|
2022-03-04 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Modified the 'RDCart::setSchedCodesList()' so as to normalize
|
||||||
|
the case of scheduler codes.
|
||||||
|
@@ -309,12 +309,27 @@ QStringList RDCart::schedCodesList() const
|
|||||||
void RDCart::setSchedCodesList(QStringList codes) const
|
void RDCart::setSchedCodesList(QStringList codes) const
|
||||||
{
|
{
|
||||||
QString sql;
|
QString sql;
|
||||||
|
RDSqlQuery *q=NULL;
|
||||||
QString sched_codes="";
|
QString sched_codes="";
|
||||||
|
|
||||||
sql=QString().sprintf("delete from CART_SCHED_CODES where CART_NUMBER=%u",cart_number);
|
sql=QString().sprintf("delete from CART_SCHED_CODES where CART_NUMBER=%u",cart_number);
|
||||||
RDSqlQuery::apply(sql);
|
RDSqlQuery::apply(sql);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize Codes
|
||||||
|
//
|
||||||
|
sql=QString("select `CODE` from `SCHED_CODES`");
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
while(q->next()) {
|
||||||
|
for(int i=0;i<codes.size();i++) {
|
||||||
|
if(codes.at(i).toLower()==q->value(0).toString().toLower()) {
|
||||||
|
codes[i]=q->value(0).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete q;
|
||||||
codes.removeDuplicates();
|
codes.removeDuplicates();
|
||||||
|
|
||||||
for(int i=0;i<codes.size();i++) {
|
for(int i=0;i<codes.size();i++) {
|
||||||
sql=QString().sprintf("insert into CART_SCHED_CODES set CART_NUMBER=%u,SCHED_CODE='%s'",cart_number,(const char *)codes.at(i));
|
sql=QString().sprintf("insert into CART_SCHED_CODES set CART_NUMBER=%u,SCHED_CODE='%s'",cart_number,(const char *)codes.at(i));
|
||||||
RDSqlQuery::apply(sql);
|
RDSqlQuery::apply(sql);
|
||||||
|
Reference in New Issue
Block a user