Inhalte aufrufen

Profilbild

Not all order fields found

details print purchase order number

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
5 Antworten zu diesem Thema

#1 profnimrod

profnimrod

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 39 Beiträge

Geschrieben: 26 June 2018 - 00:41

I recently pushed out an upgrade to 3.15.  Previously the purchase order number was populated on the PDF Order details if the PO had a value.  Now it is not showing.

 

I checked the database for my orders and confirmed that the PurchaseOrderNumber field was populated.  I then downloaded the latest version of SmartStore.Net from GitHub and ran it in debug mode in Visual Studio 2017 (with the appropriate App_Data files copied over from my production instance).  I put a debug point on line 73 of the Details.Print.cshtml page and found that although PurchaseOrderNumber is *not* null in the database, it is showing as null in the paused code.

 

Any ideas on why this is happening?

 

Thanks, Kurt


  • GalenKa und Brantot gefällt das

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 26 June 2018 - 08:54

It is displayed in the PDF if the selected payment method for this order is Purchase order. Order.PaymentMethodSystemName is set to SmartStore.PurchaseOrderNumber in this case.


Marcus Gesing

Smartstore AG


#3 profnimrod

profnimrod

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 39 Beiträge

Geschrieben: 26 June 2018 - 17:46

Two things:

 

1. The relevant code is:

 

@if (order.PurchaseOrderNumber.HasValue())
<tr>
<td class="label">@T("Order.PurchaseOrderNumber"):</td>
<td class="value">@order.PurchaseOrderNumber</td>
</tr>
}
 
This doesn't seem to agree with what you're saying
 
2. The instance of 'order' that I see when the code is paused at this point, does not have the PurchaseOrderNumber populated, whereas in the database the value is indeed populated.
 
One last thing - the payment method for the order I'm trying to print is indeed "SmartStore.PurchaseOrderNumber".
 
This worked fine before I upgraded to 3.15, so I'm wondering if I missed/broke something during the upgrade.  I simply deleted everything except the App_Data folder (and its contents), and pushed the relevant files.


#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 26 June 2018 - 20:28

Here's the code. It's working for me.

Marcus Gesing

Smartstore AG


#5 profnimrod

profnimrod

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 39 Beiträge

Geschrieben: 26 June 2018 - 23:19

Thanks for the guidance - the comment:

 

// Purchase order number (we have to find a better to inject this information because it's related to a certain plugin).

 

proved to be useful.  I hadn't noticed that after the upgrade the plugin "Offline Payment Methods" was no longer installed.  Once it was installed, the PurchaseOrderNumber was shown again.



#6 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 27 June 2018 - 10:26

I have improved the code at this point. For an order, the display of purchase order number should not depend on whether a payment type is still active or not.


Marcus Gesing

Smartstore AG