Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vl Az.old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vaclab
Vl Az.old
Commits
5e60a4e7
Commit
5e60a4e7
authored
5 years ago
by
Thomas Bock
Browse files
Options
Downloads
Patches
Plain Diff
data table views
parent
9d1c2050
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
views/all/map.js
+9
-4
9 additions, 4 deletions
views/all/map.js
views/alldt/map.js
+228
-0
228 additions, 0 deletions
views/alldt/map.js
views/cert/map.js
+16
-0
16 additions, 0 deletions
views/cert/map.js
with
253 additions
and
4 deletions
views/all/map.js
+
9
−
4
View file @
5e60a4e7
...
...
@@ -52,7 +52,9 @@ function(doc) {
}
emit
(
db
.
Year
+
"
_
"
+
sortOrderNumber
,
{
Certificate
:
db
.
Certificate
[
i
],
{
OrderNumber
:
sortOrderNumber
,
DocType
:
"
bur
"
,
Certificate
:
db
.
Certificate
[
i
],
Year
:
db
.
Year
,
CommonReferenceNo
:
db
.
CommonReferenceNo
,
CustomerReference
:
db
.
CustomerSign
||
none
,
...
...
@@ -175,8 +177,9 @@ function(doc) {
emit
(
dc
.
Year
+
"
_
"
+
sortOrderNumber
,
{
id
:
doc
.
_id
,
Year
:
dc
.
Year
,
OrderNumber
:
OrderNumber
,
DocType
:
"
cal
"
,
Year
:
dc
.
Year
,
OrderNumber
:
sortOrderNumber
,
Certificate
:
dc
.
Certificate
,
DateGen
:
DateGen
,
DateCust
:
DateCust
,
...
...
@@ -216,7 +219,9 @@ function(doc) {
}
emit
(
dct
.
FullYear
+
"
_
"
+
sortOrderNumber
,
{
Certificate
:
dct
.
Certificate
{
OrderNumber
:
sortOrderNumber
,
DocType
:
"
cer
"
,
Certificate
:
dct
.
Certificate
,
Year
:
dct
.
FullYear
,
DateCertificate
:
dct
.
CertificateDate
,
CertAttachments
:
att
...
...
This diff is collapsed.
Click to expand it.
views/alldt/map.js
0 → 100644
+
228
−
0
View file @
5e60a4e7
function
(
doc
)
{
var
missing
=
"
missing
"
,
none
=
"
none
"
,
waiting
=
"
waiting
"
,
pad
=
"
0000
"
;
if
(
doc
.
Bureaucracy
){
var
db
=
doc
.
Bureaucracy
,
cust
=
db
.
Customer
,
burDate
=
{}
,
invAmo
=
{}
,
confAmo
=
{}
// --- Date
if
(
db
.
Date
){
for
(
var
i
=
0
;
i
<
db
.
Date
.
length
;
i
++
){
burDate
[
db
.
Date
[
i
].
Type
]
=
db
.
Date
[
i
].
Value
}
}
// --- inv Amount
if
(
db
.
Invoice
&&
db
.
Invoice
.
Amount
){
var
dbia
=
db
.
Invoice
.
Amount
;
for
(
var
i
=
0
;
i
<
dbia
.
length
;
i
++
){
invAmo
[
dbia
[
i
].
Type
]
=
dbia
[
i
].
Value
}
}
// --- conv Amount
if
(
db
.
Confirmation
&&
db
.
Confirmation
.
Amount
){
var
dbca
=
db
.
Confirmation
.
Amount
for
(
var
i
=
0
;
i
<
dbca
.
length
;
i
++
){
confAmo
[
dbca
[
i
].
Type
]
=
dbca
[
i
].
Value
}
}
var
sap
=
db
.
SAPNo
?
db
.
SAPNo
:
missing
,
fa
=
db
.
Fakturaanforderung
?
db
.
Fakturaanforderung
:
waiting
,
f
=
db
.
Faktura
?
db
.
Faktura
:
waiting
,
spltRefNo
=
db
.
CommonReferenceNo
.
split
(
"
-
"
)
,
OrderNumber
=
spltRefNo
[
3
]
,
att
=
[]
,
sortOrderNumber
=
pad
.
substring
(
0
,
pad
.
length
-
OrderNumber
.
length
)
+
OrderNumber
;
if
(
doc
.
_attachments
){
for
(
var
a
in
doc
.
_attachments
){
att
.
push
(
a
);
}
}
emit
(
db
.
Year
+
"
_
"
+
sortOrderNumber
,
{
OrderNumber
:
sortOrderNumber
,
DocType
:
"
bur
"
,
Sort
:
"
c
"
,
Year
:
db
.
Year
,
CommonReferenceNo
:
db
.
CommonReferenceNo
,
CustomerReference
:
db
.
CustomerSign
||
none
,
CustomerName
:
cust
.
Name
,
CustomerSign
:
cust
.
Sign
,
CustomerComment
:
cust
.
Comment
||
none
,
DebitorenNr
:
cust
.
DebitorenNr
||
missing
,
CustomerType
:
cust
.
Type
,
ContactName
:
cust
.
Contact
.
Name
,
ContactEmail
:
cust
.
Contact
.
Email
,
ContactPhone
:
cust
.
Contact
.
Phone
,
DocId
:
doc
.
_id
,
Attachments
:
att
,
BurComment
:
db
.
Comment
||
none
,
DateInvoice
:
burDate
[
"
invoice
"
]
||
missing
,
DateGen
:
burDate
[
"
generated
"
]
||
missing
,
DateCust
:
burDate
[
"
CustomerRef
"
]
||
missing
,
DateTerm
:
burDate
[
"
terminated
"
]
||
waiting
,
DateShipping
:
burDate
[
"
shipping
"
]
||
waiting
,
ConfirmationAmount
:
typeof
confAmo
[
"
manual
"
]
==
'
number
'
?
confAmo
[
"
manual
"
]
:
missing
,
InvoiceAmount
:
typeof
invAmo
[
"
manual
"
]
==
'
number
'
?
invAmo
[
"
manual
"
]
:
missing
,
Faktura
:
f
,
Fakturaanforderung
:
fa
,
SAP
:
sap
})
}
// Bur
if
(
doc
.
Calibration
&&
doc
.
Calibration
.
Type
==
"
KK
"
){
var
dc
=
doc
.
Calibration
,
dct
=
dc
.
ToDo
,
pcp
=
dc
.
Presettings
,
pcm
=
dc
.
Measurement
,
cdcuco
=
dc
.
CustomerObject
,
PresDate
=
{}
,
MeasDate
=
""
;
// --- Date
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
}
}
var
DateGen
=
PresDate
[
"
generated
"
]
?
PresDate
[
"
generated
"
].
split
(
"
"
)[
0
]
:
missing
,
DateSchedule
=
PresDate
[
"
schedule
"
]
?
PresDate
[
"
schedule
"
]
:
missing
,
DateMeas
=
MeasDate
?
MeasDate
.
split
(
"
"
)[
0
]
:
""
;
// --- Presettings
var
ReferenceNo
=
missing
;
if
(
pcp
)
{
ReferenceNo
=
pcp
.
ReferenceNo
;
}
var
spltRefNo
=
ReferenceNo
.
split
(
"
-
"
)
,
OrderNumber
=
spltRefNo
[
4
]
,
sortOrderNumber
=
pad
.
substring
(
0
,
pad
.
length
-
OrderNumber
.
length
)
+
OrderNumber
;
// --- ToDo
if
(
dct
)
{
ToDoName
=
dct
.
Name
?
dct
.
Name
:
missing
;
ToDoType
=
dct
.
Type
?
dct
.
Type
:
missing
;
Standard
=
dct
.
Standard
?
dct
.
Standard
:
missing
;
if
(
dct
.
Fees
)
{
var
OrderFees
=
[],
SAPMaterialNumbers
=
[],
OrderFee
;
for
(
var
i
=
0
;
i
<
dct
.
Fees
.
length
;
i
++
){
var
feeObject
=
dct
.
Fees
[
i
]
if
(
feeObject
.
Type
==
"
total
"
){
OrderFee
=
feeObject
.
Fee
;
if
(
feeObject
.
AllStandard
===
undefined
)
{
AllStandard
=
"
fee calculation before 20.5.19
"
;
}
else
{
AllStandard
=
feeObject
.
AllStandard
?
"
standard calib. points
"
:
"
additional calib. points
"
;
}
}
else
{
if
(
dct
.
TimeBasedFee
){
OrderFees
.
push
(
feeObject
.
Description
);
SAPMaterialNumbers
.
push
(
"
time based
"
);
}
else
{
if
(
feeObject
.
SAPMaterialNumber
)
{
SAPMaterialNumbers
.
push
(
feeObject
.
SAPMaterialNumber
)
};
OrderFees
.
push
(
feeObject
.
Fee
);
}
}
}
// for fee
OrderFees
=
OrderFees
.
join
(
"
,
"
);
SAPMaterialNumbers
=
SAPMaterialNumbers
.
join
(
"
,
"
);
}
else
{
//fees
OrderFees
=
missing
;
SAPMaterialNumbers
=
missing
;
OrderFee
=
missing
;
AllStandard
=
"
fee calculation before 20.5.19
"
;
}
}
var
DeviceName
=
missing
,
DeviceType
=
missing
;
if
(
cdcuco
)
{
DeviceName
=
cdcuco
.
Name
?
cdcuco
.
Name
:
missing
;
DeviceType
=
cdcuco
.
Type
?
cdcuco
.
Type
:
missing
;
}
// --- Measurement
var
MeasMaintainer
=
missing
;
if
(
pcm
)
{
MeasMaintainer
=
pcm
.
Maintainer
?
pcm
.
Maintainer
:
missing
;
}
emit
(
dc
.
Year
+
"
_
"
+
sortOrderNumber
,
{
DocId
:
doc
.
_id
,
DocType
:
"
cal
"
,
Sort
:
"
b
"
,
Year
:
dc
.
Year
,
OrderNumber
:
sortOrderNumber
,
Certificate
:
dc
.
Certificate
,
DateSchedule
:
DateSchedule
,
DateMeas
:
DateMeas
,
ReferenceNo
:
ReferenceNo
,
ToDoName
:
ToDoName
,
ToDoType
:
ToDoType
,
Standard
:
[
Standard
],
DeviceName
:
DeviceName
,
DeviceType
:
DeviceType
,
MeasMaintainer
:
MeasMaintainer
,
OrderFees
:
OrderFees
,
OrderFee
:
OrderFee
,
AllStandard
:
AllStandard
,
SAPMaterialNumbers
:
SAPMaterialNumbers
});
}
if
(
doc
.
Certificate
){
var
dc
=
doc
.
Certificate
if
(
dc
.
Titlepage
){
var
dct
=
dc
.
Titlepage
,
att
=
[]
,
pat
=
new
RegExp
(
'
(7.5)-([0-9]?
\
.[0-9]?)-([0-9]{2})-([0-9]{1,3})-([0-9]{1,3})
'
)
,
mtch
=
dct
.
ReferenceNo
.
match
(
pat
)
if
(
mtch
){
var
OrderNumber
=
mtch
[
5
]
,
sortOrderNumber
=
pad
.
substring
(
0
,
pad
.
length
-
OrderNumber
.
length
)
+
OrderNumber
;
if
(
doc
.
_attachments
){
for
(
var
a
in
doc
.
_attachments
){
att
.
push
(
a
);
}
}
emit
(
dct
.
FullYear
+
"
_
"
+
sortOrderNumber
,
{
Standard
:
dc
.
Meta
.
std
,
OrderNumber
:
sortOrderNumber
,
DocType
:
"
cer
"
,
Sort
:
"
a
"
,
Certificate
:
dct
.
Certificate
,
Year
:
dct
.
FullYear
,
DateCertificate
:
dct
.
CertificateDate
,
Attachments
:
att
,
DocId
:
doc
.
_id
}
);
}
}
}
}
This diff is collapsed.
Click to expand it.
views/cert/map.js
0 → 100644
+
16
−
0
View file @
5e60a4e7
function
(
doc
)
{
if
(
doc
.
Certificate
&&
doc
.
Certificate
.
Titlepage
){
var
title
=
doc
.
Certificate
.
Titlepage
;
var
meta
=
doc
.
Certificate
.
Meta
;
var
std
=
meta
.
std
.
join
(
"
"
)
var
dd
=
title
.
CertificateDate
;
var
cus
=
title
.
Customer
.
Name
;
var
ks
=
title
.
Certificate
;
var
y
=
title
.
FullYear
;
var
az
=
title
.
ReferenceNo
.
split
(
"
|
"
)[
0
].
replace
(
/
\[
/g
,
""
);
var
md
=
title
.
MeasurementDate
;
emit
(
y
+
"
_
"
+
ks
,
[
ks
,
y
,
std
,
cus
,
dd
,
az
,
dd
]);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment