|
|
@@ -46,39 +46,73 @@
|
|
|
_labelOrigin.text=_modelJson[@"origin"];
|
|
|
_labelPort.text=_modelJson[@"port"];
|
|
|
|
|
|
- NSString * cell_price;
|
|
|
- if(RASingleton.sharedInstance.price_type==1)
|
|
|
+// NSString * cell_price;
|
|
|
+// if(RASingleton.sharedInstance.price_type==1)
|
|
|
+// {
|
|
|
+//// if(_modelJson [@"net_price"])
|
|
|
+// cell_price=_modelJson[@"price3"];
|
|
|
+//// jitem[@"unit_price"] =jitem[@"price3"];
|
|
|
+//// jitem[@"erp_unit_price"] =jitem[@"price3"];
|
|
|
+//// else if(_modelJson [@"special_price"])
|
|
|
+//// {
|
|
|
+//// unit_price= _modelJson[@"price2"];
|
|
|
+//// }
|
|
|
+//// else
|
|
|
+//// {
|
|
|
+//// unit_price= _modelJson[@"price1"];
|
|
|
+//// }
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// cell_price=_modelJson[@"price0"];
|
|
|
+//// jitem[@"unit_price"] =jitem[@"price0"];
|
|
|
+//// jitem[@"erp_unit_price"] =jitem[@"price0"];
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ NSString* price0=_modelJson[@"price0"]; //DDP
|
|
|
+ NSString* price1=_modelJson[@"price1"]; //WHSE
|
|
|
+ NSString* price2=_modelJson[@"price2"]; //SHOW
|
|
|
+ NSString* price3=_modelJson[@"price3"]; //%25
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(![price0 isEqualToString: @"N/A"])
|
|
|
+ price0 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price0"] doubleValue]];
|
|
|
+ if(![price1 isEqualToString: @"N/A"])
|
|
|
+ price1 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price1"] doubleValue]];
|
|
|
+ if(![price2 isEqualToString: @"N/A"])
|
|
|
{
|
|
|
-// if(_modelJson [@"net_price"])
|
|
|
- cell_price=_modelJson[@"price3"];
|
|
|
-// jitem[@"unit_price"] =jitem[@"price3"];
|
|
|
-// jitem[@"erp_unit_price"] =jitem[@"price3"];
|
|
|
-// else if(_modelJson [@"special_price"])
|
|
|
-// {
|
|
|
-// unit_price= _modelJson[@"price2"];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// unit_price= _modelJson[@"price1"];
|
|
|
-// }
|
|
|
+ price2 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price2"] doubleValue]];
|
|
|
+// if(RASingleton.sharedInstance.price_type==1)
|
|
|
+ _modelJson [@"special_price"] = @true;
|
|
|
}
|
|
|
- else
|
|
|
+ if(![price3 isEqualToString: @"N/A"])
|
|
|
+ price3 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price3"] doubleValue]];
|
|
|
+
|
|
|
+ if(![_modelJson [@"special_price"] boolValue]&& ![price1 isEqualToString: @"N/A"] && [price1 isEqual:price3])
|
|
|
{
|
|
|
- cell_price=_modelJson[@"price0"];
|
|
|
-// jitem[@"unit_price"] =jitem[@"price0"];
|
|
|
-// jitem[@"erp_unit_price"] =jitem[@"price0"];
|
|
|
+// if(RASingleton.sharedInstance.price_type==1)
|
|
|
+ _modelJson [@"net_price"] = @true;
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
if([_modelJson[@"price0"] isEqualToString:@"N/A"])
|
|
|
_labelPriceCTNR.text=_modelJson[@"price0"];
|
|
|
else
|
|
|
_labelPriceCTNR.text=[RAConvertor currencyNumber:[_modelJson[@"price0"] floatValue]];
|
|
|
|
|
|
- if([cell_price isEqualToString:@"N/A"])
|
|
|
- _labelPriceNCA.text=cell_price;//_modelJson[@"unit_price"];
|
|
|
+ if([price3 isEqualToString:@"N/A"])
|
|
|
+ _labelPriceNCA.text= price3;
|
|
|
else
|
|
|
- _labelPriceNCA.text=[RAConvertor currencyNumber:[cell_price floatValue]];
|
|
|
+ _labelPriceNCA.text=[RAConvertor currencyNumber:[price3 floatValue]];
|
|
|
+
|
|
|
+//
|
|
|
+// if([cell_price isEqualToString:@"N/A"])
|
|
|
+// _labelPriceNCA.text=cell_price;//_modelJson[@"unit_price"];
|
|
|
+// else
|
|
|
+// _labelPriceNCA.text=[RAConvertor currencyNumber:[cell_price floatValue]];
|
|
|
_labelPrice25p.text=_modelJson[@"price2"];
|
|
|
_labelAvailable.text=_modelJson[@"available"];
|
|
|
_editQTY.text=[_modelJson[@"count"] stringValue];
|