mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
fixed a bug
This commit is contained in:
@ -159,8 +159,6 @@ function buildReport(spans, week) {
|
|||||||
function generateSummary(spans, workordersById, usersById, timesheetsByUser) {
|
function generateSummary(spans, workordersById, usersById, timesheetsByUser) {
|
||||||
var results = {};
|
var results = {};
|
||||||
|
|
||||||
console.log(spans);
|
|
||||||
|
|
||||||
function fetchOrCreateUserRecord(userId) {
|
function fetchOrCreateUserRecord(userId) {
|
||||||
var record = results[userId];
|
var record = results[userId];
|
||||||
if (!record) {
|
if (!record) {
|
||||||
@ -216,6 +214,11 @@ function generateSummary(spans, workordersById, usersById, timesheetsByUser) {
|
|||||||
delete user.spans[span._id].__v;
|
delete user.spans[span._id].__v;
|
||||||
delete user.spans[span._id].user;
|
delete user.spans[span._id].user;
|
||||||
|
|
||||||
|
if (span.type === 'workorder') {
|
||||||
|
var workorder = workordersById[span.workorder];
|
||||||
|
addWorkorder(user, workorder);
|
||||||
|
}
|
||||||
|
|
||||||
if (span.status !== 'closed') {
|
if (span.status !== 'closed') {
|
||||||
user.hasOpenSpans = true;
|
user.hasOpenSpans = true;
|
||||||
return;
|
return;
|
||||||
@ -235,8 +238,6 @@ function generateSummary(spans, workordersById, usersById, timesheetsByUser) {
|
|||||||
if (NON_BILLABLE_WORKORDER_TYPES.indexOf(workorderType) > -1) {
|
if (NON_BILLABLE_WORKORDER_TYPES.indexOf(workorderType) > -1) {
|
||||||
logTime(user.accountingByNonBillable, workorderType, span.duration);
|
logTime(user.accountingByNonBillable, workorderType, span.duration);
|
||||||
} else {
|
} else {
|
||||||
addWorkorder(user, workorder);
|
|
||||||
|
|
||||||
logTime(user.accountingByWorkorderType, workorderType, span.duration);
|
logTime(user.accountingByWorkorderType, workorderType, span.duration);
|
||||||
logTime(user.accountingByPayroll, PAYROLL_WORKORDER_TYPE_MAP[workorderType], span.duration);
|
logTime(user.accountingByPayroll, PAYROLL_WORKORDER_TYPE_MAP[workorderType], span.duration);
|
||||||
logTime(user.accountingByWorkorder, span.workorder, span.duration);
|
logTime(user.accountingByWorkorder, span.workorder, span.duration);
|
||||||
|
Reference in New Issue
Block a user