Просмотр исходного кода

1.修改NPD离线PaymentType,通过Id获取显示Value。

Pen Li 8 лет назад
Родитель
Сommit
4fe986b1a2
1 измененных файлов с 13 добавлено и 1 удалено
  1. 13 1
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

+ 13 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -8194,6 +8194,18 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             orderinfo = [self replaceHtml:orderinfo String:@"InternalNotes_or_nbsp" withString:nsinternal_notes];
             orderinfo = [self replaceHtml:orderinfo String:@"InternalNotes_or_nbsp" withString:nsinternal_notes];
             
             
             NSString *payment = nil;
             NSString *payment = nil;
+            
+            // id -> show
+            __block NSString *show_pay_type = nspayment_type;
+            [iSalesDB jk_query:[NSString stringWithFormat:@"select pay_type from payment_type where type_id = '%@';",nspayment_type] db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
+                
+                char *show_typ_ch = (char*)sqlite3_column_text(stmt, 0);
+                if (show_typ_ch != NULL) {
+                    show_pay_type = [NSString stringWithUTF8String:show_typ_ch];
+                }
+                
+            }];
+            
             if([nspayment_type isEqualToString:@"Credit Card"] || [nspayment_type isEqualToString:@"Visa/Master"])
             if([nspayment_type isEqualToString:@"Credit Card"] || [nspayment_type isEqualToString:@"Visa/Master"])
             {
             {
                 payment = [self textFileName:@"creditcardpayment.html"];
                 payment = [self textFileName:@"creditcardpayment.html"];
@@ -8227,7 +8239,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                 NSString *card_city = [self textAtColumn:46 statement:statement];
                 NSString *card_city = [self textAtColumn:46 statement:statement];
                 NSString *card_state = [self textAtColumn:47 statement:statement];
                 NSString *card_state = [self textAtColumn:47 statement:statement];
                 
                 
-                payment = [self replaceHtml:payment String:@"Payment_Type" withString:nspayment_type];
+                payment = [self replaceHtml:payment String:@"Payment_Type" withString:show_pay_type];
                 payment = [self replaceHtml:payment String:@"CardNumber_or_nbsp" withString:card_number];
                 payment = [self replaceHtml:payment String:@"CardNumber_or_nbsp" withString:card_number];
                 payment = [self replaceHtml:payment String:@"CardType_or_nbsp" withString:card_type];
                 payment = [self replaceHtml:payment String:@"CardType_or_nbsp" withString:card_type];
                 payment = [self replaceHtml:payment String:@"CardExpireDate_or_nbsp" withString:card_expiration];
                 payment = [self replaceHtml:payment String:@"CardExpireDate_or_nbsp" withString:card_expiration];