Skip to content
Snippets Groups Projects
Commit e753371b authored by wactbprot's avatar wactbprot
Browse files

sort by KS No.

parent b431c7f2
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,6 @@
## link
* [2016](http://a73434.berlin.ptb.de:5984/vl_db/_design/az/_list/sum/all?key=%222016%22)
* [2017](http://a73434.berlin.ptb.de:5984/vl_db/_design/az/_list/sum/all?key=%222017%22)
* [2018](http://a73434.berlin.ptb.de:5984/vl_db/_design/az/_list/sum/all?key=%222018%22)
* [2016](http://a73434.berlin.ptb.de:5984/vl_db/_design/az/_list/sum/all?startkey=%222016_75000%22&endkey=%222016_75999%22)
* [2017](http://a73434.berlin.ptb.de:5984/vl_db/_design/az/_list/sum/all?startkey=%222017_75000%22&endkey=%222017_75999%22)
* [2018](http://a73434.berlin.ptb.de:5984/vl_db/_design/az/_list/sum/all?startkey=%222018_75000%22&endkey=%222018_75999%22)
function(head, req) {
var mustache = require("lib/couchapp/mustache")
, share = require("lib/vaclab/share")
, year = req.query.key
, header = this.templates.header
, body = this.templates.body
, foot = this.templates.foot
, row, i= 1, all = {};
, share = require("lib/vaclab/share")
, startyear = req.query.startkey.split("_")[0]
, endyear = req.query.endkey.split("_")[0]
, header = this.templates.header
, body = this.templates.body
, foot = this.templates.foot
, row, i= 1, all = {};
start({headers: {"Content-type": "text/html; charset=utf-8"}});
send( mustache.to_html(header,
{"Title":"Übersicht Aktenzeichen " + year }));
var titleadd = startyear == endyear ? startyear : startyear + " bis " + endyear
send( mustache.to_html(header, {"Title":"Übersicht Aktenzeichen " + titleadd }));
while(row = getRow()) {
var rv = row.value,
ak = rv.Certificate + rv.Year
ak = rv.Certificate + rv.Year;
if(rv.CustomerSign){
rv.CustomerDocId = "cus-" + rv.CustomerSign.toLowerCase();
......
......@@ -59,11 +59,20 @@
<td class="no_{{Number}}" title="Datum Ks" data-row="{{Number}}">
{{DateCertificate}}
</td>
<td class="no_{{Number}}" title="Fakturaanforderung" data-row="{{Number}}">
{{Fakturaanforderung}}
</td>
<td class="no_{{Number}}" title="" data-row="{{Number}}">
{{Faktura}}
</td>
<td class="no_{{Number}}" title="Gerätename" data-row="{{Number}}">
{{DeviceName}}
<td class="no_{{Number}} {{DateTerminated}}" title="technisch abgeschlossen" data-row="{{Number}}">
{{DateTerminated}}
</td>
<td class="no_{{Number}}" title="Gerätetyp" data-row="{{Number}}">
<td class="no_{{Number}}" title="Gegenstand" data-row="{{Number}}">
{{DeviceType}}
</td>
<td class="no_{{Number}}" title="Kalibrierziel" data-row="{{Number}}">
......
......@@ -26,7 +26,8 @@
.missing { color:black; background-color: #EDE15C; }
.info { color:black;background-color: #CEED5C; }
.selected { color:black; background-color: #EBFAF3; }
.waiting {color:black;background-color: #ECE8FA; }
overflow: scroll; /* Scrollbar are always visible */
overflow: auto; /* Scrollbar is displayed as it's needed */
</style>
......@@ -60,9 +61,12 @@
<th>Solltermin</th>
<th>Start Messung</th>
<th>Datum KS</th>
<th>Fakturaanforderung </th>
<th>Faktura</th>
<th>tech. abgeschl.</th>
<th>Gerät</th>
<th>Gerätetyp</th>
<th>Gegenstand</th>
<th>Kalibrierziel</th>
<th>Standard</th>
<th>Messbeauftragter</th>
......
......@@ -5,64 +5,68 @@ function(doc) {
if(dc.Titlepage){
var dct = dc.Titlepage;
emit(dct.FullYear, {Certificate: dct.Certificate,
emit(dct.FullYear + "_" + dct.Certificate, {Certificate: dct.Certificate,
Year:dct.FullYear,
DateCertificate: dct.CertificateDate});
}
}
if(doc.Calibration && doc.Calibration.Type == "KK"){
var dc = doc.Calibration
, dct = dc.ToDo
, pcp = dc.Presettings
, pcm = dc.Measurement
, pca = dc.Analysis
, dcc = dc.Customer
, cdcuco = dc.CustomerObject
, PresDate = {}
, MeasDate = ""
, AnDate = ""
, missing = "missing"
, none = "none"
if(doc.Calibration && doc.Calibration.Type == "KK"){
var dc = doc.Calibration
, dct = dc.ToDo
, pcp = dc.Presettings
, pcm = dc.Measurement
, pca = dc.Analysis
, dcc = dc.Customer
, cdcuco = dc.CustomerObject
, PresDate = {}
, MeasDate = ""
, AnDate = ""
, missing = "missing"
, none = "none"
, waiting = "waiting"
if(pcp && pcp.Date){
for(var i = 0; i < pcp.Date.length; i++){
PresDate[pcp.Date[i].Type] = pcp.Date[i].Value
}
if(pcp && pcp.Date){
for(var i = 0; i < pcp.Date.length; i++){
PresDate[pcp.Date[i].Type] = pcp.Date[i].Value
}
}
if(pcm && pcm.Date){
for(var i = 0; i < pcm.Date.length; i++){
MeasDate = pcm.Date[i].Value[0] ? pcm.Date[i].Value[0] : pcm.Date[i].Value
}
if(pcm && pcm.Date){
for(var i = 0; i < pcm.Date.length; i++){
MeasDate = pcm.Date[i].Value[0] ? pcm.Date[i].Value[0] : pcm.Date[i].Value
}
}
emit(dc.Year, {id: doc._id,
Year:dc.Year,
Certificate:dc.Certificate,
CustomerName :dcc.Name,
CustomerSign :dcc.Sign,
CustomerComment: dcc.Comment,
DebitorenNr : dcc.DebitorenNr,
CustomerType: dcc.Type,
ContactName: dcc.Contact.Name,
ContactEmail: dcc.Contact.Email,
ContactPhone: dcc.Contact.Phone,
DateGen: PresDate["generated"] ? PresDate["generated"] : missing,
DateCust: PresDate["CustomerRef"] ? PresDate["CustomerRef"]: missing,
DateSchedule: PresDate["schedule"] ? PresDate["schedule"] : missing,
DateMeas: MeasDate ? MeasDate : "",
SAP: pcp.SAPNo ? pcp.SAPNo: missing,
ReferenceNo: pcp.ReferenceNo,
CustomerReference: pcp.CustomerSign.length < 2 ? none : pcp.CustomerSign,
DeviceName: cdcuco.Name,
DeviceType: cdcuco.Type,
ToDoName:dct.Name,
Standard:dct.Standard,
Fee: dct.Fee ,
MeasMaintainer:pcm.Maintainer
});
}
emit( dc.Year+ "_" + dc.Certificate,
{id: doc._id,
Year:dc.Year,
Certificate:dc.Certificate,
CustomerName :dcc.Name,
CustomerSign :dcc.Sign,
CustomerComment: dcc.Comment,
DebitorenNr : dcc.DebitorenNr,
CustomerType: dcc.Type,
ContactName: dcc.Contact.Name,
ContactEmail: dcc.Contact.Email,
ContactPhone: dcc.Contact.Phone,
DateGen: PresDate["generated"] ? PresDate["generated"].split(" ")[0] : missing,
DateCust: PresDate["CustomerRef"] ? PresDate["CustomerRef"]: missing,
DateSchedule: PresDate["schedule"] ? PresDate["schedule"] : missing,
DateTerminated: PresDate["terminated"] ? PresDate["terminated"] : waiting,
DateMeas: MeasDate ? MeasDate.split(" ")[0] : "",
SAP: pcp.SAPNo ? pcp.SAPNo: missing,
ReferenceNo: pcp.ReferenceNo,
Fakturaanforderung : pcp.Fakturaanforderung ,
Faktura: pcp.Faktura ,
CustomerReference: pcp.CustomerSign.length < 2 ? none : pcp.CustomerSign,
DeviceName: cdcuco.Name,
DeviceType: cdcuco.Type,
ToDoName:dct.Name,
Standard:dct.Standard,
Fee: dct.Fee ,
MeasMaintainer:pcm.Maintainer
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment