diff --git a/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/InnVoiceOrderController.cs b/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/InnVoiceOrderController.cs index d69fa4f..a06a250 100644 --- a/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/InnVoiceOrderController.cs +++ b/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/InnVoiceOrderController.cs @@ -105,6 +105,8 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers var shippingCountry = await _countryService.GetCountryByAddressAsync(shippingAddress); var shippingCountryCode = shippingCountry?.TwoLetterIsoCode ?? billingCountryCode; + string megjegyzes = string.Empty; + // Create order request var orderRequest = new OrderCreateRequest { @@ -123,7 +125,8 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers //Email = customer.Email ?? string.Empty, Email = billingAddress.Email ?? customer.Email ?? string.Empty, Telefon = billingAddress.PhoneNumber ?? string.Empty, - MegrendelesSzamStr = orderDto.Id.ToString() + MegrendelesSzamStr = orderDto.Id.ToString(), + Megjegyzes = $"" }; // Add shipping address details @@ -174,8 +177,16 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers CikkSzam = string.Empty }); } + + if(item.UnitPriceInclTax != product.Price) + { + megjegyzes += $"{productName} egységár módosítva: {Math.Round(product.Price, 2)} Ft -> {Math.Round(item.UnitPriceInclTax, 2)} Ft; \n"; + megjegyzes += $"Kedvezmény: { ((1 - (item.UnitPriceInclTax / product.Price)) * 100).ToString() }%; \n"; + } } + orderRequest.Megjegyzes = megjegyzes; + // Create order via API var response = await _innVoiceOrderService.CreateOrderAsync(orderRequest); @@ -370,7 +381,8 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers FizetesiMod = order.PaymentMethodSystemName, Email = billingAddress.Email, Telefon = billingAddress.PhoneNumber, - MegrendelesSzamStr = order.Id.ToString() + MegrendelesSzamStr = order.Id.ToString(), + Megjegyzes = $"" }; // Add order items diff --git a/Nop.Plugin.Misc.AIPlugin/Services/InnVoiceOrderService.cs b/Nop.Plugin.Misc.AIPlugin/Services/InnVoiceOrderService.cs index 46014ac..bab8943 100644 --- a/Nop.Plugin.Misc.AIPlugin/Services/InnVoiceOrderService.cs +++ b/Nop.Plugin.Misc.AIPlugin/Services/InnVoiceOrderService.cs @@ -18,6 +18,7 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Services private readonly string _password; private readonly string _baseUrl; + //public InnVoiceOrderService(string companyName = "apiteszt", string username = "apiteszt", string password = "dsjfluio4324hjhjfdhkjskjh213kjgsd", string baseUrl = "https://api.innvoice.hu") public InnVoiceOrderService(string companyName = "fruitbank", string username = "fruitbank", string password = "YkKzM1dwJax0HTlPWlMABSqdSA", string baseUrl = "https://api.innvoice.hu") { _companyName = companyName ?? throw new ArgumentNullException(nameof(companyName));