Explorar o código

库存明细的详情里加入占库

姜永辉 hai 1 ano
pai
achega
df892ecd00

+ 26 - 1
res/layout/activity_inventory.xml

@@ -352,11 +352,36 @@
                     android:layout_marginLeft="5dp"
                     android:textColor="@color/black" />
             </LinearLayout>
+            
+            <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical" 
+                    android:orientation="horizontal" >
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="5dp"
+                        android:gravity="center"
+                        android:text="@string/xml_activity_goods_detail_occupy_quantity"
+                        android:textColor="@color/black"
+                        android:textSize="@dimen/textsize_14" />
+
+                    <TextView
+                        android:id="@+id/tv_OccupyQuantity"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/tv_layout_marginLeft_5"
+                        android:gravity="center"
+                        android:textColor="@color/black"
+                        android:textSize="@dimen/textsize_14" />
+                </LinearLayout>
 
             <LinearLayout
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
+                android:layout_marginTop="6dp"
                 android:orientation="horizontal" >
 
                 <TextView

+ 5 - 1
src/com/dongkesoft/ibossmini/activity/report/InventoryDetailActivity.java

@@ -115,6 +115,8 @@ public class InventoryDetailActivity extends IBossBaseActivity implements OnClic
 	private TextView tvBox;
 
 	private TextView tvPiece;
+	private TextView tvOccupyQuantity;
+
 	private TextView tvPackage;
 
 	private List<ImagePath> imageList;
@@ -161,7 +163,7 @@ public class InventoryDetailActivity extends IBossBaseActivity implements OnClic
 		llPiece = (LinearLayout) findViewById(R.id.ll_piece);
 		tvBox = (TextView) findViewById(R.id.tv_box);
 		tvPiece = (TextView) findViewById(R.id.tv_piece);
-
+		tvOccupyQuantity = (TextView) findViewById(R.id.tv_OccupyQuantity);
 		llPrice = (LinearLayout) findViewById(R.id.ll_price);
 	}
 
@@ -230,6 +232,7 @@ public class InventoryDetailActivity extends IBossBaseActivity implements OnClic
 									// 修复textView赋值异常
 									tvPackage.setText(jsonObj.optInt("Package") + "");
 									tvBrand.setText(jsonObj.optString("BrandName"));
+									tvOccupyQuantity.setText(jsonObj.optString("OccupyQuantity"));
 
 									int decimalPlaces = jsonObj.optInt("DecimalPlaces");
 
@@ -418,6 +421,7 @@ public class InventoryDetailActivity extends IBossBaseActivity implements OnClic
 			tvPositionNumber.setText(bean.getPositionNumber());
 			tvGradeName.setText(bean.getGrade());
 			tvVariety.setText(bean.getVariety());
+			tvOccupyQuantity.setText(bean.getOccupyQuantity());
 		} catch (Exception e) {
 
 		}

+ 17 - 1
src/com/dongkesoft/ibossmini/activity/report/InventoryListActivity.java

@@ -955,7 +955,23 @@ public class InventoryListActivity extends IBossBaseActivity implements
 								} else {
 									info.setKcprice("");
 								}
-
+								String occupyQuantity = jsonObjectTwo
+										.optString("OccupyQuantity");
+								if (occupyQuantity != null
+										&& occupyQuantity.length() > 0) {
+									if (decimalPlaces == 0) {
+										info.setOccupyQuantity(String
+												.valueOf(new Double(
+														occupyQuantity)
+														.intValue()));
+									} else {
+										occupyQuantity = String.format("%."
+												+ decimalPlaces + "f", Double
+												.parseDouble(occupyQuantity));
+										info.setOccupyQuantity(occupyQuantity);
+									}
+								}
+								 
 								mSearchInfoList.add(info);
 
 							}