stock-orderable-group

Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
OLMIS-7458: Add new lots in receive and physical inventory screens
OLMIS-7458: Add new lots in receive and physical inventory screens
OLMIS-7458: Add new lots in receive and physical inventory screens

    • -24
    • +60
    ./orderable-group.service.spec.js
  1. … 29 more files in changeset.
OLMIS-7397: Revert changes made in tests
OLMIS-7397: Revert changes made in tests
OLMIS-7397: Revert changes made in tests

This reverts commit cb5aef05f80737da454315a7a5ecde342e0ef1a9.

  1. … 41 more files in changeset.
OLMIS-7314: Fix tests after karma upgrade
OLMIS-7314: Fix tests after karma upgrade
OLMIS-7314: Fix tests after karma upgrade

  1. … 40 more files in changeset.
toDate function from dateUtils transforms dates from array/string to Date object, which is passed to the openlmisDate filter then. openlmisDate filter prepares date to be displayed in the proper fo...

toDate function from dateUtils transforms dates from array/string to Date object, which is passed to the openlmisDate filter then. openlmisDate filter prepares date to be displayed in the proper format and it's still used in the HTML (also for occurredDate or expirationDate).

So, in general, will openlmisDate filter be of any use now and in the future?

So, in general, will openlmisDate filter be of any use now and in the future?

OLMIS-6511: Fixed displaying lot expiration date and stock card occurred date on stockmanagement...
OLMIS-6511: Fixed displaying lot expiration date and stock card occurred date on stockmanagement...
OLMIS-6511: Fixed displaying lot expiration date and stock card occurred date on stockmanagement screens

    • -57
    • +57
    ./orderable-group.service.spec.js
  1. … 7 more files in changeset.
OLMIS-6669: Added lots sorting on the SOH page and to dropdown on 'Receive' and 'Physical inventory' screen

  1. … 2 more files in changeset.
Added LotResource to fix splitting long requests
Added LotResource to fix splitting long requests
Refactored usages of LotRepositoryImpl to use LotResource because the second one implements splitting long requests

  1. … 4 more files in changeset.
I would prefer the original way

I would prefer the original way

I see. I would stick with the original approach then so we don't introduce any compatibility issues. However, we could use _.flatten instead. I'll leave it up to you.

I see. I would stick with the original approach then so we don't introduce any compatibility issues. However, we could use _.flatten instead. I'll leave it up to you.

Nikodem Graczewski There is something tricky here. Array.prototype.flatMap() works on chrome version >=69 Unfortunately my virtual machine Chrome version is 66. And flatMap is not supported. That...

Nikodem Graczewski There is something tricky here.

Array.prototype.flatMap() works on chrome version >=69

Unfortunately my virtual machine Chrome version is 66. And flatMap is not supported. That was the reason i was saying its not working.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap

So changing to flatMap won't that create a problem?

// Real lineItem JSON objectvar lineItems =[{"$errors":{"quantityInvalid":false,"occurredDateInvalid":false},"$previewSOH":99,"stockCard":{"id":"e4cd8e1a-8f3c-48d4-891c-fa5160832005","href":"https:...
// Real lineItem JSON object
var lineItems =[{"$errors":{"quantityInvalid":false,"occurredDateInvalid":false},"$previewSOH":99,"stockCard":{"id":"e4cd8e1a-8f3c-48d4-891c-fa5160832005","href":"https://uat.openlmis.org/api/stockCards/e4cd8e1a-8f3c-48d4-891c-fa5160832005"},"orderable":{"productCode":"C118","dispensable":{"dispensingUnit":"10 tab strip","displayUnit":"10 tab strip"},"fullProductName":"Stomachica","description":"Product description goes here.","netContent":1,"packRoundingThreshold":0,"roundToZero":false,"programs":[{"programId":"dce17f2e-af3e-40ad-8e00-3496adef44c3","orderableDisplayCategoryId":"15b8ef1f-a5d6-42dd-95bf-bb68a4504e82","orderableCategoryDisplayName":"Oral contraceptive","orderableCategoryDisplayOrder":6,"active":true,"fullSupply":true,"displayOrder":3,"dosesPerPatient":1,"pricePerPack":5.1}],"children":[{"orderable":{"id":"25665e10-cca7-44c0-b508-e95600d8fb99"},"quantity":10},{"orderable":{"id":"d4dbd20e-8ce2-480e-a019-4a90d115719c"},"quantity":20}],"identifiers":{},"extraData":{},"meta":{"lastUpdated":"2019-04-15T00:55:18.564Z[GMT]","versionId":"2"},"id":"0dc9c1ad-2266-4fb3-ad74-993c38b8c28a"},"lot":null,"stockOnHand":99,"processedDate":"2019-04-15T00:57:46.158Z","occurredDate":"2019-04-15","displayLotMessage":"Product has no lots","reason":{"name":"Unpack Kit","description":null,"reasonType":"DEBIT","reasonCategory":"AGGREGATION","isFreeTextAllowed":false,"tags":["consumed"],"id":"9b4b653a-f319-4a1b-bb80-8d6b4dd6cc12","creditReasonType":false,"debitReasonType":true,"adjustmentReasonCategory":false},"reasonFreeText":null,"quantity":2}];

lineItems.flatMap(function(lineItem) {
    return lineItem.orderable.children.map(function(constituent) {
        return _.extend({}, constituent, {
            reason: creditReason,
            occurredDate: lineItem.occurredDate,
            quantity: lineItem.quantity * constituent.quantity
        });
    })
});
OLMIS-6113 : Create UI for kit unpacking in stock management
OLMIS-6113 : Create UI for kit unpacking in stock management