Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add changes related to lot cancelled bug #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions reports/design/lib/bids.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ function check_award_for_bid(tender, bid) {
if (date === null) {
date = award.date;
}
checker = (['active', 'pending', 'cancelled'].indexOf(award.status) !== -1 && (date >= award.date));
if (award.date >= date) {
date = award.date;
checker = (['active', 'pending', 'cancelled'].indexOf(award.status) !== -1);
}
}
});
return ((checker) || (!is_awarded));
Expand All @@ -276,7 +279,10 @@ function check_award_for_bid_multilot(tender, bid, lot) {
if (date === null) {
date = award.date;
}
checker = (['active', 'pending', 'cancelled'].indexOf(award.status) !== -1 && (date >= award.date));
if (award.date >= date) {
date = award.date;
checker = (['active', 'pending', 'cancelled'].indexOf(award.status) !== -1);
}
}
});
// this check is unnecessary
Expand Down Expand Up @@ -319,7 +325,8 @@ function get_info_about_cancelled_lot(actual_tender, old_tender, bid, lot) {
});
} else {
if ("awards" in old_tender) {
return (check_qualification_for_bid(actual_tender, bid, lot) && check_award_for_bid_multilot(actual_tender, bid, lot));
return (check_qualification_for_bid(lot.status === 'cancelled' ? old_tender : actual_tender, bid, lot) &&
check_award_for_bid_multilot(actual_tender, bid, lot));
}
else {
return check_qualification_for_bid(actual_tender, bid, lot);
Expand Down
4 changes: 4 additions & 0 deletions reports/tests/views/bids_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@ describe("bids view tests", () => {
});

it("tender has valid award and no awards in status active or pending - should return false.", () => {
bid.date = '1970-01-01';
tender.awards[0].bid_id = bid.id;
tender.awards[0].date = bid.date;
assert.isFalse(bids.check_award_for_bid(tender, bid));
})

Expand Down Expand Up @@ -471,7 +473,9 @@ describe("bids view tests", () => {
});

it("tender has valid awards and awards in status active or pending - should return true.", () => {
bid.date = '1970-01-01';
tender.awards[0].status = "active";
tender.awards[0].date = bid.date;
assert.isTrue(bids.check_award_for_bid_multilot(tender, bid, lot));
});

Expand Down