
<div class="mgPostcalcCtrl">
  <!--(ng-controller="mgPostcalcCtrl"), no need, route in app.coffee sets controller-->
  <form role="form" class="form-horizontal">
    <div class="container">
      <!--.form-group or .row, row has less space around it-->
      <div class="row">
        <!-- first row and p is needed to get some space on top of whole screen (should use css rule)-->
        <p></p>
        <h3>Jälkilaskenta</h3>
      </div>
      <div class="row">
        <!-- mgPostcalcField.jade
        <Created>
          <Arto></Arto>
        </Created>
        <Date>
          <18 class="2 2013"></18>
        </Date>
        <Time>
          <17:47></17:47>
        </Time>
        -->
        <!--fieldset.row.fieldset-->
        <!--legend Main Section-->
        <div class="col-md-4">
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.wo_asProduction_Lot }}</div>
              <select ng-model="woHeaderPop" ng-change="woHeaderPopChanged()" ng-options="e.wo_asProduction_Lot+', '+e.wo_asWork_Order_ID+', '+e.pr_asName for e in wo_AllData.data" class="form-control"></select>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.wo_asDrawing_Number }}</div>
              <input disabled="disabled" type="text" ng-model="fld.wo_asDrawing_Number" class="form-control"/>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.pr_asName }}</div>
              <input disabled="disabled" type="text" ng-model="fld.pr_asName" class="form-control"/>
            </div>
          </div>
        </div>
        <div class="col-md-4">
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.pr_alType_ }}</div>
              <input disabled="disabled" type="text" ng-model="fld.pr_alType_" class="form-control"/>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.pr_alProduction_Control_Type }}</div>
              <input disabled="disabled" type="text" ng-model="fld.pr_alProduction_Control_Type" class="form-control"/>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.wo_asState }}</div>
              <input disabled="disabled" type="text" ng-model="fld.wo_asState" class="form-control"/>
            </div>
          </div>
        </div>
        <div class="col-md-4">
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.wo_alPricing_State }}</div>
              <select id="woPricingStatePop" ng-model="woPricingStatePop" ng-options="elem.text for elem in woPricingArr" ng-change="woPricingStatePopChanged()" class="form-control">
                <!-- span  Valittu: {{ popNum.value }}-->
              </select>
            </div>
            <div class="input-group">
              <!--.input-group-btn
              <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-star">{{ hdr.wo_arSales_Price__unit }}</span></button>
              -->
              <!--.input-group-addon {{ hdr.wo_arSales_Price__unit }}--><span class="input-group-btn">
                <button type="button" ng-click="Callback(&quot;wo_pca_SalesPriceCheck&quot;)" class="btn btn-default btn-xs">{{ hdr.wo_arSales_Price__unit }}
                  <!--span.glyphicon.glyphicon-star.pull-right-->
                </button></span>
              <input id="wo_arSales_Price__unit" disabled="disabled" type="text" ng-model="fld.wo_arSales_Price__unit" ma-focus="fldFocus == 'wo_arSales_Price__unit'" class="form-control"/>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ hdr.wo_arAssemblySalesPrice }}</div>
              <input disabled="disabled" type="text" ng-model="fld.wo_arAssemblySalesPrice" class="form-control"/>
            </div>
          </div>
        </div>
      </div>
      <div class="form-group">
        <ma-grid id="woGrid" ng-model="gridWoData" style="width:99%; height:54px;"/>
      </div>
      <div class="form-group"><strong>Materiaalit</strong>
        <div class="btn-group btn-group-sm pull-right">
          <button type="button" class="btn-sm glyphicon glyphicon-minus"></button>
          <button type="button" class="btn-sm glyphicon glyphicon-plus"></button>
          <button type="button" class="btn-sm glyphicon glyphicon-import"></button>
        </div>
        <ma-grid id="wmaGrid" ng-model="gridWmaData" style="width:99%; height:180px;"/>
      </div>
      <div class="row">
        <!-- mgPostcalcField2.jade
        <Created>
          <Arto></Arto>
        </Created>
        <Date>
          <18 class="2 2013"></18>
        </Date>
        <Time>
          <17:47></17:47>
        </Time>
        -->
        <div class="col-md-4 col-md-offset-4">
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon">{{ lang("Self cost/unit") }}</div>
              <input disabled="disabled" type="text" ng-model="wo_mat_rActCostPrice_UnitSum" class="form-control"/>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ lang("Sales price/unit") }}</div>
              <input disabled="disabled" type="text" ng-model="wo_mat_rActSalesPrice_UnitSum" class="form-control"/>
            </div>
          </div>
        </div>
        <div class="col-md-4">
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon">{{ lang("Self cost") }}</div>
              <input disabled="disabled" type="text" ng-model="wo_mat_rActCostPriceSum" class="form-control"/>
            </div>
            <div class="input-group">
              <div class="input-group-addon">{{ lang("Sales price") }}</div>
              <input disabled="disabled" type="text" ng-model="wo_mat_rActSalesPriceSum" class="form-control"/>
            </div>
          </div>
        </div>
      </div>
      <div class="form-group">
        <div class="button-group">
          <button ng-click="LoadData(false)" class="btn btn-default col-md-2">{{ lang("Load data") }}</button>
          <button ng-click="LoadData(true)" class="btn btn-default col-md-2">{{ lang("Load demodata") }}</button>
        </div>
        <div class="button-group pull-right">
          <button ng-click="Callback(&quot;cancel&quot;)" class="btn btn-default col-md-2">{{ lang("Cancel") }}</button>
          <button ng-click="Callback(&quot;ok&quot;)" class="btn btn-default col-md-2">{{ lang("OK") }}</button>
          <!-- first pull-right goes to most right, rest to the left of it-->
        </div>
      </div>
      <!--.row
      <p></p>
      -->
    </div>
  </form>
</div>
<!--
<div class="row">
  <div class="col-md-3">
    <div id="dropzone" class="recycle-bin">Recycle Bin</div>
  </div>
  <div class="col-md-3">
    <button ng-click="loadData(false)">Load 4D data</button>
  </div>
  <div class="col-md-3">
    <button ng-click="loadData(true)">Load demodata</button>
  </div>
</div>
<p></p>
-->