<ion-header class="nav_header theme_primary">
        <button class="nav_btn floatLeft fm_menu" *ngIf="from_push" ion-button menuToggle>
       </button>   
       <button class="nav_btn floatLeft" *ngIf="!from_push" ion-button (click)="back()">
         <ion-icon name="ios-arrow-back"></ion-icon>
       </button>
       <div class="nav_header_title floatLeft">
           Provide Quote
       </div>
   </ion-header>
<ion-content padding class="page_background">
    <div class="fm_vehicle_detail" *ngIf="request_val" >
      <div class="fm_vehicle_banner">
        <div class="fm_vehicle_photo"><img *ngIf="request_val.profile_pic" [src]="request_val.profile_pic" ></div>
        <div class="fm_vehicle_detail">
          <h4>{{request_val.first_name}} {{request_val.last_name}}</h4>
        </div>
        <div class="clear"></div>
      </div>
      <div class="fm_vehicle_bottom">
		<form [formGroup]="quoteForm" (ngSubmit)="save_quote(quoteForm.value)">
        <p>Repair Type:</p>
        <h4>{{request_val.work_name}}</h4>
        <p>Service Charges:</p>
        <div class="add_parts_head">
            <h5 class="floatLeft">Add Parts</h5>
            <div class="add_btn floatRight" (click)="addParts()" >+ Parts</div>
            <div class="clear"></div>
        </div>
		<div formArrayName="parts" >
			<ion-row *ngFor="let child of quoteForm.controls.parts.controls; let i = index"  [formGroupName]="i" >
			
			  <ion-col col-6 class="p0">
				  <ion-input placeholder="Name of Parts" formControlName="name" ></ion-input>
			  </ion-col>
			  <ion-col col-6 class="p0 textRight">
				  <ion-input placeholder="Price" type="number"  formControlName="price" #memSearch (keyup)="get_price(memSearch.value,i)" (onblur)="get_total()"></ion-input>
						 <div class="s_validation" *ngIf="child.hasError('minlength')">{{vs.errorList.minLength}} 1</div>
						<div class="s_validation" *ngIf="child.hasError('maxlength')">{{vs.errorList.maxLength}} 6</div>
			  </ion-col>
			  
			</ion-row>
		</div>    

		<div class="add_parts_head">
            <h5 class="floatLeft">Add Labour</h5>
            <div class="add_btn floatRight" (click)="addlabour()" >+ Labour</div>
            <div class="clear"></div>
        </div>
		<div formArrayName="labour" >
			<ion-row *ngFor="let child of quoteForm.controls.labour.controls; let i = index"  [formGroupName]="i" >
			
			  <ion-col col-6 class="p0">
				  <ion-input placeholder="Name of Labour" formControlName="name" ></ion-input>
			  </ion-col>
			  <ion-col col-6 class="p0 textRight">
				  <ion-input placeholder="Price" type="number"  formControlName="price" #laborSearch (keyup)="get_labor(laborSearch.value,i)" (onblur)="get_total()"></ion-input>
						 <div class="s_validation" *ngIf="child.hasError('minlength')">{{vs.errorList.minLength}} 1</div>
						<div class="s_validation" *ngIf="child.hasError('maxlength')">{{vs.errorList.maxLength}} 6</div>
			  </ion-col>
			  
			</ion-row>
		</div>
         
        <!---<ion-row>
            <ion-col col-6 class="p0">
                <h6>Labour</h6>
            </ion-col>
            <ion-col col-6 class="p0 textRight">
                <ion-input placeholder="Labour Charge" type="number" formControlName="labour" #laborSearch   (keyup)="get_labor(laborSearch.value)" ></ion-input>
						 <div class="s_validation" *ngIf="quoteForm.controls['labour'].hasError('minlength')">{{vs.errorList.minLength}} 1</div>
                    <div class="s_validation" *ngIf="quoteForm.controls['labour'].hasError('maxlength')">{{vs.errorList.maxLength}} 6</div>
            </ion-col>
        </ion-row> -->
        <ion-row>
            <ion-col col-6 class="p0">
                <h6>Mwst</h6>
            </ion-col>
            <ion-col col-6 class="p0 textRight">
               
				 <div class="s_validation" >20%</div>
                  
            </ion-col>
        </ion-row>
        <hr>
        <ion-row>
            <ion-col col-6 class="p0">
                <h6 class="textGreen"><strong>Total amount(incl.Mwst):</strong></h6>
            </ion-col>
            <ion-col col-6 class="p0 textRight">
                <h6 class="textGreen"><strong>€{{price_val}}</strong></h6>
            </ion-col>
        </ion-row>
        <p class="textCenter m0">Please add some information for customer</p>
        <br>
      <textarea class="customer_textarea" rows="4" formControlName="description"  placeholder="what are you going to do? How long would Service last?, Are some services or parts not included?, Would you like to borrow car?, Are there special things the customer should care about?, Do you offer free car wash?" ></textarea>
			<div class="textCenter">
				<button id="quote_button" [disabled]="!quoteForm.valid" class="login_btn widthFull theme_lblue" ion-button>Send Quote</button>
			</div>
		  </form>
        </div>
    </div>
  </ion-content>
 