Explorar el Código

Recommend -> Recommened
Newest -> Last
Oldest -> First
修复Portfolio编辑出错。

Pen Li hace 9 años
padre
commit
2051801b23

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 30 - 23
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m

@@ -35,7 +35,7 @@
     }
     [self requestqty];
     
-    
+    NSLog(@"price:%f",self.price);
     self.editPrice.text = [NSString stringWithFormat:@"%.2f", self.price ];
     
     
@@ -51,11 +51,18 @@
         
     self.label_multiItems.text = [NSString stringWithFormat:@"%d items selected",self.ids_count ? self.ids_count :  self.arr_fashion_ids.count];//ids_count多选情况有值,而self.arr_fashion_ids在单选情况才不为空
 
-        self.label_multiItems.hidden = false;
+    
         self.editPrice.enabled = false;
-        self.editPrice.text = nil;
+//        self.editPrice.text = nil;
+    if (self.arr_fashion_ids.count != 1) {
         self.buttonRefresh.hidden = true;
         self.labelQueryQTY.hidden = true;
+        self.label_multiItems.hidden = false;
+    } else {
+        self.buttonRefresh.hidden = false;
+        self.labelQueryQTY.hidden = false;
+        self.label_multiItems.hidden = true;
+    }
         
         self.labelNewPrice.hidden = true;
         self.labelpriceafter.hidden = true;
@@ -153,6 +160,9 @@
 
 - (IBAction)onSaveClick:(id)sender {
     
+    for (id view in self.view.subviews) {
+        [view resignFirstResponder];
+    }
     
 //    if([self.editDiscount.text floatValue]>100.0)
 //    {
@@ -208,17 +218,13 @@
     {
         self.qty=-INT32_MAX;
         self.qty_p=-MAXFLOAT;
-    }
-    else
-        if(qtypercentage)
-        {
+    } else if(qtypercentage) {
+        
             self.qty_p=[self.editQTY.text floatValue];
             self.qty=-INT32_MAX;
-        }
-    else
-    {
-        self.qty=[self.editQTY.text intValue];
-        self.qty_p=-MAXFLOAT;
+    } else {
+            self.qty=[self.editQTY.text intValue];
+            self.qty_p=-MAXFLOAT;
     }
     
     if (!self.qtyCheckButton.selected) {
@@ -237,13 +243,14 @@
     if (!self.lineNoteCheckButton.selected) {
         self.linenotes = nil;
     }
+
+
+    
     
     [self dismissViewControllerAnimated:NO
                              completion:^{
                                  if(self.onSetValue)
-                                     
-                                     self.onSetValue( self.qty, self.qty_p,self.price,self.discount, self.linenotes);
-                                 
+                                     self.onSetValue(self.qty, self.qty_p,self.price,self.discount, self.linenotes);
                              }];
 }
 - (IBAction)onCloseClicked:(id)sender {
@@ -355,16 +362,16 @@
 -(void) update_newprice
 {
     
-    if (!self.priceCheckButton.selected) {
-        self.price = -MAXFLOAT;
-    }
-    else
+//    if (!self.priceCheckButton.selected) {
+//        self.price = -MAXFLOAT;
+//    }
+//    else
         self.price = [self.editPrice.text doubleValue];
     
-    if (!self.discountCheckButton.selected) {
-        self.discount = -MAXFLOAT;
-    }
-    else
+//    if (!self.discountCheckButton.selected) {
+//        self.discount = -MAXFLOAT;
+//    }
+//    else
         self.discount = [self.editDiscount.text doubleValue];
     
     

+ 60 - 11
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -653,6 +653,39 @@
                             self.content_data[[NSString stringWithFormat:@"item_%d",single_idx]]=item_json;
                             // item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
                             [self.itemListTable reloadData];
+                            
+                            
+                            if (qty != -INT32_MAX) {
+                                if(qty>=0)
+                                    item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
+                                else
+                                    [item_json removeObjectForKey:@"available_qty"];
+                            }
+                            
+                            if (qty_p != -MAXFLOAT) {
+                                if(qty_p>=0)
+                                    item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
+                                else
+                                    [item_json removeObjectForKey:@"available_percent"];
+                            }
+                            
+                            if (notes) {
+                                item_json[@"linenotes"]=notes;
+                            }
+                            
+                            if (discount != -MAXFLOAT) {
+                                item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
+                            }
+                            
+                            if (price != -MAXFLOAT) {
+                                item_json[@"tear_sheet_price"]=[NSString stringWithFormat:@"%.2f",price];
+                            }
+                            
+                            self.content_data[[NSString stringWithFormat:@"item_%d",single_idx]]=item_json;
+                            // item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
+                            
+                            [self.itemListTable reloadData];
+                            
                         }
                         else
                         {
@@ -731,6 +764,7 @@
         //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
         vc.onSetValue = ^(int qty,double qty_p,double price, double discount , NSString* notes){
             
+            NSLog(@"price:%f,discount:%f",price,discount);
             
             UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
             
@@ -1324,17 +1358,32 @@
                     if([[cart_json valueForKey:@"result"] intValue]==2)
                     {
                         self.editedRow = indexPath.row;
-                        if(qty>=0)
-                        item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
-                        else
-                            [item_json removeObjectForKey:@"available_qty"];
-                        if(qty_p>=0)
-                        item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
-                        else
-                            [item_json removeObjectForKey:@"available_percent"];
-                        item_json[@"linenotes"]=notes;
-                        item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
-                        item_json[@"tear_sheet_price"]=[NSString stringWithFormat:@"%.2f",price];
+                        if (qty != -INT32_MAX) {
+                            if(qty>=0)
+                                item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
+                            else
+                                [item_json removeObjectForKey:@"available_qty"];
+                        }
+                        
+                        if (qty_p != -MAXFLOAT) {
+                            if(qty_p>=0)
+                                item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
+                            else
+                                [item_json removeObjectForKey:@"available_percent"];
+                        }
+                        
+                        if (notes) {
+                            item_json[@"linenotes"]=notes;
+                        }
+                        
+                        if (discount != -MAXFLOAT) {
+                            item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
+                        }
+                        
+                        if (price != -MAXFLOAT) {
+                            item_json[@"tear_sheet_price"]=[NSString stringWithFormat:@"%.2f",price];
+                        }
+                        
                         self.content_data[[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]]=item_json;
                        // item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
                         self.indexPath=indexPath;

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m

@@ -303,7 +303,7 @@
                         //block代码块取代了delegate
                         
                         
-                        UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Yes(Recommend)" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                        UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Yes(Recommended)" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                             
                             
                             

+ 2 - 2
RedAnt ERP Mobile/iSales-NPD/SortItemViewController.m

@@ -87,11 +87,11 @@
     
     switch (indexPath.row) {
         case 0:{
-            cell.sortTitle = @"Newest";
+            cell.sortTitle = @"Last";
         }
             break;
         case 1:{
-            cell.sortTitle = @"Oldest";
+            cell.sortTitle = @"First";
         }
             break;
         case 2:{

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -10,7 +10,7 @@
 #define RedAnt_ERP_Mobile_config_h
 #define BUILD_NPD
 
-//#define test_server
+#define test_server
 
 //#define ENCRYPT_OFF