<ol class="breadcrumb">
	<li><a href="#/">Dashboard</a></li>
	<li>Settings</li>
	<li class="active">Quickbooks</li>
</ol>

<div class="container-fluid">
	<div class="row">
		<div class="col-md-12">
			<form name="form" id="form" class="form-horizontal" ng-submit="vm._save(vm.setting)" novalidate>
				<div class="panel panel-midnightblue">
					<div class="panel-heading">
						<h2>Quickbooks</h2>
					</div>
					<div class="panel-body">
						<alert type="warning" ng-if="vm._hasQuickbooks">
							<b>Warning!</b> Your account is already connected to Quickbooks!
						</alert>
						<p ng-if="vm._hasQuickbooks">Fields with <span style="color: #cc0000;">*</span> are required.</p>
						<div class="form-group" ng-if="!vm._hasQuickbooks">
							<div class="col-sm-10">
								<div quickbooks></div>
							</div>
						</div>
						<div class="form-group" ng-if="vm._hasQuickbooks">
							<label for="active" class="col-sm-2 control-label">Active <span style="color: #cc0000;">*</span></label>
							<div class="col-sm-8">
								<select class="form-control" name="active" id="active" ng-model="vm.setting.active" ng-required="true">
									<option value="">-- Select --</option>
									<option value="1">Yes</option>
									<option value="0">No</option>
								</select>
							</div>
						</div>
						<div class="form-group" ng-if="vm._hasQuickbooks">
							<label for="service_income_account" class="col-sm-2 control-label">Service Income Account <span style="color: #cc0000;">*</span></label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="service_income_account" id="service_income_account" ng-model="vm.setting.service_income_account" ng-required="true">
							</div>
						</div>
						<div class="form-group" ng-if="vm._hasQuickbooks">
							<label for="product_income_account" class="col-sm-2 control-label">Product Income Account <span style="color: #cc0000;">*</span></label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="product_income_account" id="product_income_account" ng-model="vm.setting.product_income_account" ng-required="true">
							</div>
						</div>
						<div class="form-group" ng-if="vm._hasQuickbooks">
							<label for="product_expense_account" class="col-sm-2 control-label">Product Expense Account <span style="color: #cc0000;">*</span></label>
							<div class="col-sm-8">
								<input type="text" class="form-control" name="product_expense_account" id="product_expense_account" ng-model="vm.setting.product_expense_account" ng-required="true">
							</div>
						</div>
					</div>
					<div class="panel-footer" ng-if="vm._hasQuickbooks">
						<div class="row">
							<div class="col-sm-8 col-sm-offset-2">
								<button type="submit" ng-disabled="!form.$valid" class="btn-primary btn">Save</button>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
