示例#1
0
 /**
  * Constructs a SheetBrief instance by an instance of PosSheet.
  *
  * @param sheet POS工作单.
  */
 public SheetBrief(PosSheet sheet) {
   if (sheet != null) {
     sale_len = sheet.getSaleLen();
     if (!sheet.isEmpty()) {
       value_total = sheet.getValue().getValueTotal();
       sheet_time = sheet.getSale(0).getSysTime();
     }
     // TODO  沧州富达 by fire  2005_5_11
     // getIndicators( sheet );
   }
 }
示例#2
0
  /**
   * 从PosSheet 中取出标志性商品(油品). 是否标志性商品,需要根据配置文件中的参数确定. NOTE: 无论在sheet 中是否存在标志性商品, indicators 都将得到初始化.
   * 如果sheet 为空,或是没有标志性商品,则数组 indicators 长度为0.
   *
   * @param sheet
   */
  private void getIndicators(PosSheet sheet) {
    PosConfig config = PosConfig.getInstance();
    int count = 0;
    if (!sheet.isEmpty())
      for (int i = 0; i < sheet.getSaleLen(); i++) {
        Sale sale = sheet.getSale(i);
        if (config.isIndicatorDept(sale.getGoods().getDeptid())) count++;
      }

    indicators = new Sale[count];
    for (int i = 0, j = 0; j < count && i < sheet.getSaleLen(); i++) {
      Sale sale = sheet.getSale(i);
      if (config.isIndicatorDept(sale.getGoods().getDeptid())) indicators[j++] = sale;
    }
  }