|
|
@@ -98,7 +98,7 @@
|
|
|
msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
|
|
|
|
|
|
}
|
|
|
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil),NSLocalizedString(@"Add to new order", nil), nil];
|
|
|
+ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil),NSLocalizedString(@"Create new order", nil), nil];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -107,7 +107,7 @@
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
|
|
|
+ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil), nil];
|
|
|
|
|
|
// alert.
|
|
|
[alert show];
|
|
|
@@ -160,14 +160,14 @@
|
|
|
msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
|
|
|
|
|
|
}
|
|
|
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil),NSLocalizedString(@"Add to new order", nil), nil];
|
|
|
+ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil),NSLocalizedString(@"Create new order", nil), nil];
|
|
|
|
|
|
// alert.
|
|
|
[alert show];
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
|
|
|
+ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil), nil];
|
|
|
|
|
|
// alert.
|
|
|
[alert show];
|
|
|
@@ -549,6 +549,119 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+- (IBAction)onEditClick:(id)sender {
|
|
|
+ NSMutableArray* checked = [[NSMutableArray alloc] init];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ int count = [[self.content_data valueForKey:@"count"] intValue];
|
|
|
+ for(int i=0;i<count;i++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%d",i]] mutableCopy];
|
|
|
+ int check = [[item_json valueForKey:@"check"] intValue];
|
|
|
+ if(check==1)
|
|
|
+ {
|
|
|
+ [checked addObject:[NSNumber numberWithInt:[[item_json valueForKey:@"item_id"] intValue]]];
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // disable for debug
|
|
|
+ if(checked.count==0)
|
|
|
+ return;
|
|
|
+
|
|
|
+ // NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
|
|
|
+ NSString * ids = [checked componentsJoinedByString:@","];
|
|
|
+
|
|
|
+ {
|
|
|
+
|
|
|
+ NSLog(@"edit click");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ UIViewController* parentvc=self;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ PortfolioEditQTYViewController * vc =[ parentvc.storyboard instantiateViewControllerWithIdentifier:@"PortfolioEditQTYViewController"];
|
|
|
+
|
|
|
+
|
|
|
+// NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
|
|
|
+
|
|
|
+ vc.arr_fashion_ids = checked;
|
|
|
+
|
|
|
+ // vc.fashionid = [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
|
|
|
+// vc.qty = [[item_json valueForKey:@"available_qty"] intValue];
|
|
|
+//
|
|
|
+// vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
|
|
|
+// vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
|
|
|
+
|
|
|
+
|
|
|
+ // vc.delegate = parentvc.self;
|
|
|
+ // loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
|
|
|
+ vc.onSetValue = ^(int qty,double price, double discount , NSString* notes){
|
|
|
+
|
|
|
+
|
|
|
+ UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
+
|
|
|
+ NSDictionary* cart_json = nil;
|
|
|
+
|
|
|
+ cart_json= [iSalesNetwork portfolio_setPrice:ids price:price discount:discount QTY:qty notes:notes];
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
|
|
|
+
|
|
|
+
|
|
|
+ if([[cart_json valueForKey:@"result"] intValue]==2)
|
|
|
+ {
|
|
|
+ [self reload_data];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Edit QTY" controller:self] ;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // [self reload_data];//[main_vc checklogin:true];
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
|
|
|
+
|
|
|
+ navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
|
|
|
+ [parentvc presentViewController:navi animated:YES completion:^{
|
|
|
+
|
|
|
+ // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
|
|
|
+
|
|
|
+ NSLog(@"EditModelPriceViewController present.........");
|
|
|
+
|
|
|
+ // self.btop = false;
|
|
|
+ // <#code#>
|
|
|
+ }];
|
|
|
+
|
|
|
+ // [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
- (IBAction)onDeleteClick:(id)sender {
|
|
|
NSMutableArray* checked = [[NSMutableArray alloc] init];
|
|
|
|
|
|
@@ -1031,17 +1144,18 @@
|
|
|
|
|
|
NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
|
|
|
|
|
|
+ vc.arr_fashion_ids = [[NSArray arrayWithObject:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]]] mutableCopy];
|
|
|
|
|
|
- vc.fashionid = [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
|
|
|
+// vc.fashionid = [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
|
|
|
vc.qty = [[item_json valueForKey:@"available_qty"] intValue];
|
|
|
-
|
|
|
+ vc.linenotes=[item_json valueForKey:@"linenotes"] ;
|
|
|
vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
|
|
|
vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
|
|
|
|
|
|
|
|
|
// vc.delegate = parentvc.self;
|
|
|
// loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
|
|
|
- vc.onSetValue = ^(int qty,double price, double discount){
|
|
|
+ vc.onSetValue = ^(int qty,double price, double discount , NSString* notes){
|
|
|
|
|
|
|
|
|
UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
|
|
|
@@ -1050,7 +1164,7 @@
|
|
|
|
|
|
NSDictionary* cart_json = nil;
|
|
|
|
|
|
- cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount QTY:qty];
|
|
|
+ cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount QTY:qty notes:notes];
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
[waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
|