Skip to content

Commit 20a97db

Browse files
author
Markus Falk
committed
PfdService 7 and OrderProcService AssignRewardPoints fix, Ressource string update
1 parent 2d21d84 commit 20a97db

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/Libraries/Nop.Services/Common/PdfService7.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,10 @@ public virtual void PrintOrdersToPdf(Stream stream, IList<Order> orders, int lan
566566
//empty Line
567567
tabPage.AddHeaderCell(new Cell(1, col).Add("\n").AddStyle(styleCell));
568568
//Invoice
569-
paraPdf = new Paragraph(new Text(_localizationService.GetResource(order.InvoiceId != null? "PDFInvoice.Invoice" :"PDFInvoice.Order", lang.Id)).AddStyle(styleTitle));
570-
if (order.InvoiceId != null)
571-
paraPdf.Add(new Text(" " + order.InvoiceId).AddStyle(styleTitle));
569+
var invoiceID = (order.InvoiceId != null && order.InvoiceId != "ToBeAssigned") ? order.InvoiceId : null;
570+
paraPdf = new Paragraph(new Text(_localizationService.GetResource(invoiceID != null? "PDFInvoice.Invoice" :"PDFInvoice.Order", lang.Id)).AddStyle(styleTitle));
571+
if (invoiceID != null)
572+
paraPdf.Add(new Text(" " + invoiceID).AddStyle(styleTitle));
572573
tabPage.AddHeaderCell(new Cell(1, col - 3).Add(paraPdf).AddStyle(styleCell));
573574
paraPdf = new Paragraph();
574575
if (order.InvoiceDateUtc.HasValue)
@@ -852,7 +853,7 @@ public virtual void PrintOrdersToPdf(Stream stream, IList<Order> orders, int lan
852853
}
853854
//order total incl.
854855
lstSummary.Add(new Tuple<string, decimal, bool, bool, bool, bool>("PDFInvoice.OrderAmountIncl", order.OrderAmountIncl, true, true, false, false));
855-
856+
856857
//shipping non taxable
857858
var shippTuple = Tuple.Create("PDFInvoice.Shipping", order.OrderShippingNonTaxable, false, false, order.ShippingStatus != ShippingStatus.ShippingNotRequired, false);
858859
lstSummary.Add(shippTuple);

src/Libraries/Nop.Services/Orders/OrderProcessingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ protected virtual void AwardRewardPoints(Order order)
835835
var points = new RewardPoints(_rewardPointService);
836836

837837
//earned points
838-
decimal usedPurchasedRewardPointsAmount = order.RedeemedRewardPointsEntry.UsedAmountPurchased;
838+
decimal usedPurchasedRewardPointsAmount = order.RedeemedRewardPointsEntry != null ? order.RedeemedRewardPointsEntry.UsedAmountPurchased : decimal.Zero;
839839

840840
bool includingTax = order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax;
841841
decimal amount = _rewardPointService.GetRewardPointsBaseAmount(includingTax ? order.EarnedRewardPointsBaseAmountIncl : order.EarnedRewardPointsBaseAmountExcl, usedPurchasedRewardPointsAmount);

src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6787,7 +6787,7 @@
67876787
<Value>Assign Invoice ID from Task</Value>
67886788
</LocaleResource>
67896789
<LocaleResource Name="Admin.Configuration.Settings.Order.AssignInvoiceIdentFromTask.Hint">
6790-
<Value>Assign invoice id using background task. This assures that the same invoice id isn't used more than ones and that there are no wholes in the number series.</Value>
6790+
<Value>Assign invoice id using background task. This assures that the same invoice id isn't used more than ones and that there are no wholes in the number series. Please note: Activate the task manually in System/Schedule tasks.</Value>
67916791
</LocaleResource>
67926792
<LocaleResource Name="Admin.Configuration.Settings.Order.AutoUpdateOrderTotalsOnEditingOrder">
67936793
<Value>Auto update order totals</Value>

0 commit comments

Comments
 (0)