merge
This commit is contained in:
commit
05d9c97645
|
|
@ -120,13 +120,29 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add order items
|
// Add order items
|
||||||
var orderItems = await _orderService.GetOrderItemsAsync(order.Id);
|
//var orderItems = await _orderService.GetOrderItemsAsync(order.Id);
|
||||||
|
var orderItems = await _dbContext.OrderItemDtos.GetAllByOrderId(order.Id, true).ToListAsync();
|
||||||
|
Console.WriteLine($"Order Items Count: {orderItems.Count}");
|
||||||
foreach (var item in orderItems)
|
foreach (var item in orderItems)
|
||||||
{
|
{
|
||||||
//var productDTO = await _productService.GetProductByIdAsync(item.ProductId);
|
//var productDTO = await _productService.GetProductByIdAsync(item.ProductId);
|
||||||
var product = _dbContext.ProductDtos.GetById(item.ProductId);
|
var product = _dbContext.ProductDtos.GetById(item.ProductId);
|
||||||
//string unit = product != null && product.IsMeasurable ? "kg" : "kt";
|
//string unit = product != null && product.IsMeasurable ? "kg" : "kt";
|
||||||
|
if(item.IsMeasurable) { // in case of measurable products, quantity is in fact weight stored in item.EnteredQuantity
|
||||||
|
orderRequest.AddItem(new InnVoiceOrderItem
|
||||||
|
{
|
||||||
|
TetelNev = product?.Name ?? "Product",
|
||||||
|
AfaSzoveg = "27%", // Configure VAT rate as needed
|
||||||
|
Brutto = true,
|
||||||
|
EgysegAr = item.UnitPriceInclTax,
|
||||||
|
Mennyiseg = Convert.ToDecimal(item.NetWeight),
|
||||||
|
MennyisegEgyseg = "kg",
|
||||||
|
CikkSzam = ""
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
orderRequest.AddItem(new InnVoiceOrderItem
|
orderRequest.AddItem(new InnVoiceOrderItem
|
||||||
{
|
{
|
||||||
TetelNev = product?.Name ?? "Product",
|
TetelNev = product?.Name ?? "Product",
|
||||||
|
|
@ -139,6 +155,8 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Create order via API
|
// Create order via API
|
||||||
var response = await _innVoiceOrderService.CreateOrderAsync(orderRequest);
|
var response = await _innVoiceOrderService.CreateOrderAsync(orderRequest);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,10 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-md-12" style="overflow-x: auto;">
|
<div class="col-md-12" style="overflow-x: auto;">
|
||||||
@foreach (var item in Model.ItemExtendeds)
|
@{
|
||||||
|
if (Model.ItemExtendeds != null)
|
||||||
|
{
|
||||||
|
foreach (var item in Model.ItemExtendeds)
|
||||||
{
|
{
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
@ -102,7 +105,8 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
<table class="table table-hover table-bordered">
|
<table class="table table-hover table-bordered">
|
||||||
<col />
|
<col />
|
||||||
<col />
|
<col />
|
||||||
|
|
@ -120,7 +124,7 @@
|
||||||
}
|
}
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@* <th>
|
@* <th>
|
||||||
@T("Admin.Orders.Products.Picture")
|
@T("Admin.Orders.Products.Picture")
|
||||||
</th>
|
</th>
|
||||||
*@ <th>
|
*@ <th>
|
||||||
|
|
@ -162,10 +166,13 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach (var item in Model.ItemExtendeds)
|
@{
|
||||||
|
if (Model.ItemExtendeds != null)
|
||||||
|
{
|
||||||
|
foreach (var item in Model.ItemExtendeds)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
@* <td class="text-center preview">
|
@* <td class="text-center preview">
|
||||||
<img src="@item.PictureThumbnailUrl" alt="" title="" />
|
<img src="@item.PictureThumbnailUrl" alt="" title="" />
|
||||||
</td>
|
</td>
|
||||||
*@ <td style="width: 25%;" class="text-left">
|
*@ <td style="width: 25%;" class="text-left">
|
||||||
|
|
@ -303,7 +310,7 @@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td style="width: 80px;" class="text-center">
|
<td style="width: 80px;" class="text-center">
|
||||||
@if(item.IsMeasurable)
|
@if (item.IsMeasurable)
|
||||||
{
|
{
|
||||||
<span class="badge badge-warning" disabled>Yes</span>
|
<span class="badge badge-warning" disabled>Yes</span>
|
||||||
}
|
}
|
||||||
|
|
@ -429,6 +436,9 @@
|
||||||
}
|
}
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -219,8 +219,8 @@
|
||||||
UrlRead = new DataUrl("ProductList", "CustomProduct", null),
|
UrlRead = new DataUrl("ProductList", "CustomProduct", null),
|
||||||
SearchButtonId = "search-products",
|
SearchButtonId = "search-products",
|
||||||
Length = Model.PageSize,
|
Length = Model.PageSize,
|
||||||
Ordering = true,
|
// Ordering = true,
|
||||||
ServerSide = false,
|
// ServerSide = false,
|
||||||
LengthMenu = Model.AvailablePageSizes,
|
LengthMenu = Model.AvailablePageSizes,
|
||||||
Filters = new List<FilterParameter>
|
Filters = new List<FilterParameter>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue