//
//  MyBillsTableViewCell.m
//  ALand
//
//  Created by Z on 16/5/16.
//  Copyright © 2016年 Z. All rights reserved.
//

#import "MyBillsTableViewCell.h"

@interface MyBillsTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgIcon;
@property (weak, nonatomic) IBOutlet UILabel *labelAmount;
@property (weak, nonatomic) IBOutlet UILabel *labelDescription;
@property (weak, nonatomic) IBOutlet UILabel *labelDate;

@end
@implementation MyBillsTableViewCell

- (void)awakeFromNib {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.imgIcon.layer.masksToBounds = YES;
    self.imgIcon.layer.cornerRadius = self.imgIcon.width/2;
    // Initialization code
}

- (void)cellWithModel:(JavenBillModel *)model
{
    NSString *strAmount = [NSString stringWithFormat:@"%.2f", model.income.amount];
    self.labelAmount.text = [strAmount hasPrefix:@"-"] ? strAmount : [NSString stringWithFormat:@"+%@", strAmount];
    self.labelDate.text = [model.createInfo.time substringWithRange:NSMakeRange(0, 10)];
    self.labelDescription.text = model.remark;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
