mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-07 01:13:50 +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:
parent
5afcd7e7af
commit
9123bf420a
@ -20853,3 +20853,6 @@
|
||||
* Fixed a bug in rdimport(1) that could create duplicate
|
||||
Scheduler Code entries when using the '--to-cart' and
|
||||
'--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
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q=NULL;
|
||||
QString sched_codes="";
|
||||
|
||||
sql=QString().sprintf("delete from CART_SCHED_CODES where CART_NUMBER=%u",cart_number);
|
||||
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();
|
||||
|
||||
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));
|
||||
RDSqlQuery::apply(sql);
|
||||
|
Loading…
x
Reference in New Issue
Block a user