Compare commits

..

2 Commits

2 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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));