//
// SalesEntryRoom.m
// IvyMedia
//
// Created by haibara on 9/24/14.
//
//

#import "SalesEntryRoom.h"
#import "Lang.h"
#import "SDK.h"
#import "CocoaUtils.h"
#import "Vars.h"

@implementation SalesEntryRoom

- (instancetype)init {
	if (self = [super init]) {
		self.stocks = [NSMutableArray array];
	}
	return self;
}

#pragma mark - Property

- (NSInteger)nights {
	return [CocoaUtils dateIntervalForComponent:NSCalendarUnitDay fromDate:[[DateFormatUtils ISO_DATE_FORMAT] parse:self.check_in] toDate:[[DateFormatUtils ISO_DATE_FORMAT] parse:self.check_out]];
}

- (NSString *)shortDescription {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:IMLocalizedString(@"Room")];
	[string im_appendString:WORD_DIVIDER_SPACE];
	[string appendFormat:@"%d", self.room_no];
	return [NSString stringWithString:string];
}

@end
