--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hibernating Rhinos Ltd
Tal Weiss l Core Team Developer l Mobile:+972-54-802-4849
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
RavenDB paving the way to "Data Made Simple" http://ravendb.net/
var orderData = {
Id: documentId,
OrderLinesCount: this.Lines.length,
TotalCost: 0
};
for (var i = 0; i < this.Lines.length; i++) {
var line = this.Lines[i];
var lineCost = ((line.Quantity * line.PricePerUnit) * (1 - line.Discount));
orderData.TotalCost += lineCost;
replicateToOrderLines({
OrderId: documentId,
Qty: line.Quantity,
Product: line.Product,
Cost: lineCost
});
}
replicateToOrders(orderData);