// // ScanListCell.m // HMLG Scan Order // // Created by Rui Zhang on 3/30/22. // Copyright © 2022 United Software Applications, Inc. All rights reserved. // #import "ScanListCell.h" #import "RASingleton.h" #import "OLDataProvider.h" #import "ActiveViewController.h" #import "RAConvertor.h" #import "RAUtils.h" #import "AppDelegate.h" #import "RADataProvider.h" @implementation ScanListCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } - (IBAction)onAddToCart:(id)sender { // DebugLog(@"shouldchangeedit %d_%d",indexPath.section,indexPath.row); if(RASingleton.sharedInstance.scan_cart ==nil) { // NSData* json =[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:URL_SO_CART ofType:@"json" ]]; NSMutableDictionary* cartTemplate=[OLDataProvider loadScanTemplate:@"scan_cart.json"]; RASingleton.sharedInstance.scan_cart=cartTemplate;//[[RAConvertor data2dict:json] mutableCopy]; } // 初始化为 FOB CTNR; if(RASingleton.sharedInstance.scan_cart[@"price_type"] ==nil) { RASingleton.sharedInstance.scan_cart[@"price_type"] = @1; RASingleton.sharedInstance.price_type = 1; } NSMutableDictionary* section =[RASingleton.sharedInstance.scan_cart[@"section_0"] mutableCopy]; int count =[section[@"count"] intValue]; NSMutableDictionary* jitem = nil; jitem = [self.modelJson mutableCopy]; int stockUom =[jitem[@"stockUom"] intValue]; if(stockUom==0) stockUom=1; bool newitem = true; AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; NSDictionary* price_group = [RADataProvider get_price_group:appDelegate.price_group]; for(int i=0;i