Compare commits

...

20 Commits

Author SHA1 Message Date
83536bee88 Fix BTG rate provider 2023-07-29 10:00:34 +02:00
abfd6ea1dc update changelog and version 2023-07-29 09:48:47 +02:00
688e873f7a fixes #5203 2023-07-29 09:15:12 +02:00
c88df08350 fixes #5208 2023-07-29 09:15:11 +02:00
82586590a7 potentially fixes #5203 2023-07-29 09:15:11 +02:00
88c66f30f2 fixes #5204 2023-07-29 09:15:10 +02:00
9132592717 fixes #5205 2023-07-29 09:15:10 +02:00
c0ffab768a fix ident 2023-07-29 09:15:10 +02:00
69190081c8 ui+checkout: fix language cutoff bug (#5210) 2023-07-28 21:24:30 +02:00
093206cf1e add changelog 2023-07-27 15:19:48 +02:00
a0110b7570 Merge remote-tracking branch 'origin/feat/changelog-1.11' 2023-07-27 15:14:53 +02:00
6d65feca4c update changelog 2023-07-27 08:39:58 +02:00
95be0242b6 add opensats and update strike logo (#5202)
Co-authored-by: pavlenex <pavle@pavle.org>
2023-07-27 08:39:40 +02:00
79e121c3af Disabling playing of the invoice sound for existing stores 2023-07-26 10:42:00 -05:00
676ac2fe46 Changelog 1.11.0 2023-07-26 09:11:26 -05:00
8eabdab53a Preventing entering of negative tips and discounts in POS 2023-07-26 07:26:53 -05:00
957fb09ffc Reverting logic of how paid amount is displayed on the receipt 2023-07-26 07:26:32 -05:00
4bffe117a9 Do not show cheatmode in release, fix warnigns 2023-07-25 10:50:34 +09:00
05b01a13c8 Fix NRE error in PoS report 2023-07-24 23:20:17 +09:00
08e21c1a5d Fix report view 2023-07-24 23:13:11 +09:00
22 changed files with 143 additions and 52 deletions

View File

@ -1,3 +1,4 @@
using System.Web;
using Ganss.XSS;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
@ -21,6 +22,10 @@ namespace BTCPayServer.Abstractions.Services
{
return _htmlHelper.Raw(_htmlSanitizer.Sanitize(value));
}
public IHtmlContent RawEncode(string value)
{
return _htmlHelper.Raw(HttpUtility.HtmlEncode(_htmlSanitizer.Sanitize(value)));
}
public IHtmlContent Json(object model)
{

View File

@ -16,7 +16,7 @@ namespace BTCPayServer
DefaultRateRules = new[]
{
"BTG_X = BTG_BTC * BTC_X",
"BTG_BTC = exmo(BTG_BTC)",
"BTG_BTC = gate(BTG_BTC)",
},
CryptoImagePath = "imlegacy/btg.svg",
LightningImagePath = "imlegacy/btg-lightning.svg",

View File

@ -137,7 +137,6 @@
<ItemGroup>
<Watch Include="Views\**\*.*"></Watch>
<Content Remove="Views\UIReports\StoreReports.cshtml" />
<Watch Remove="Views\UIAccount\CheatPermissions.cshtml" />
<Watch Remove="Views\UIReports\StoreReports.cshtml" />
<Content Update="Views\UIApps\_ViewImports.cshtml">

View File

@ -53,7 +53,7 @@ namespace BTCPayServer.Controllers.Greenfield
private static LightningAutomatedPayoutSettings ToModel(PayoutProcessorData data)
{
var blob = data.HasTypedBlob<LightningAutomatedPayoutBlob>().GetBlob();
var blob = data.HasTypedBlob<LightningAutomatedPayoutBlob>().GetBlob() ?? new LightningAutomatedPayoutBlob();
return new LightningAutomatedPayoutSettings()
{
PaymentMethod = data.PaymentMethod,

View File

@ -227,14 +227,18 @@ namespace BTCPayServer.Controllers
string txId = paymentData.GetPaymentId();
string? link = GetTransactionLink(paymentMethodId, txId);
var paymentMethod = i.GetPaymentMethod(paymentMethodId);
var amount = paymentData.GetValue();
var rate = paymentMethod.Rate;
var paid = (amount - paymentEntity.NetworkFee) * rate;
return new ViewPaymentRequestViewModel.PaymentRequestInvoicePayment
{
Amount = paymentEntity.PaidAmount.Gross,
Paid = paymentEntity.PaidAmount.Net,
Amount = amount,
Paid = paid,
ReceivedDate = paymentEntity.ReceivedTime.DateTime,
PaidFormatted = _displayFormatter.Currency(paymentEntity.PaidAmount.Net, i.Currency, DisplayFormatter.CurrencyFormat.Symbol),
RateFormatted = _displayFormatter.Currency(paymentEntity.Rate, i.Currency, DisplayFormatter.CurrencyFormat.Symbol),
PaidFormatted = _displayFormatter.Currency(paid, i.Currency, DisplayFormatter.CurrencyFormat.Symbol),
RateFormatted = _displayFormatter.Currency(rate, i.Currency, DisplayFormatter.CurrencyFormat.Symbol),
PaymentMethod = paymentMethodId.ToPrettyString(),
Link = link,
Id = txId,

View File

@ -238,7 +238,7 @@ namespace BTCPayServer.Data
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
public bool CelebratePayment { get; set; } = true;
[DefaultValue(true)]
[DefaultValue(false)]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
public bool PlaySoundOnPayment { get; set; } = false;

View File

@ -203,6 +203,9 @@ public class UIFormsController : Controller
if (store is null)
return NotFound();
try
{
var request = _formDataService.GenerateInvoiceParametersFromForm(form);
var inv = await invoiceController.CreateInvoiceCoreRaw(request, store, Request.GetAbsoluteRoot());
if (inv.Price == 0 && inv.Type == InvoiceType.Standard && inv.ReceiptOptions?.Enabled is not false)
@ -210,5 +213,15 @@ public class UIFormsController : Controller
return RedirectToAction("InvoiceReceipt", "UIInvoice", new { invoiceId = inv.Id });
}
return RedirectToAction("Checkout", "UIInvoice", new { invoiceId = inv.Id });
}
catch (Exception e)
{
TempData.SetStatusMessageModel(new StatusMessageModel()
{
Severity = StatusMessageModel.StatusSeverity.Error,
Message = "Could not generate invoice: "+ e.Message
});
return await GetFormView(formData, form);
}
}
}

View File

@ -147,12 +147,17 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
CancellationToken cancellationToken = default)
{
var app = await _appService.GetApp(appId, PointOfSaleAppType.AppType);
if (string.IsNullOrEmpty(choiceKey) && amount <= 0)
{
// not allowing negative tips or discounts
if (tip < 0 || discount < 0)
return RedirectToAction(nameof(ViewPointOfSale), new { appId });
}
if (string.IsNullOrEmpty(choiceKey) && amount <= 0)
return RedirectToAction(nameof(ViewPointOfSale), new { appId });
if (app == null)
return NotFound();
var settings = app.GetSettings<PointOfSaleSettings>();
settings.DefaultView = settings.EnableShoppingCart ? PosViewType.Cart : settings.DefaultView;
var currentView = viewType ?? settings.DefaultView;

View File

@ -106,13 +106,13 @@ public class OnChainWalletReportProvider : ReportProvider
}
var objects = await WalletRepository.GetWalletObjects(new GetWalletObjectsQuery()
{
Ids = queryContext.Data.Select(d => (string)d[2]).ToArray(),
Ids = queryContext.Data.Select(d => (string)d[2]!).ToArray(),
WalletId = walletId,
Type = "tx"
});
foreach (var row in queryContext.Data)
{
if (!objects.TryGetValue(new WalletObjectId(walletId, "tx", (string)row[2]), out var txObject))
if (!objects.TryGetValue(new WalletObjectId(walletId, "tx", (string)row[2]!), out var txObject))
continue;
var invoiceId = txObject.GetLinks().Where(t => t.type == "invoice").Select(t => t.id).FirstOrDefault();
row[3] = invoiceId;

View File

@ -78,8 +78,8 @@ public class ProductsReportProvider : ReportProvider
}
else
{
var posData = i.Metadata.PosData?.ToObject<PosAppData>();
if (posData.Cart is { } cart)
var posData = i.Metadata?.PosData?.ToObject<PosAppData>();
if (posData?.Cart is { } cart)
{
foreach (var item in cart)
{

View File

@ -1,3 +1,4 @@
#nullable enable
using System;
using System.Collections;
using System.Collections.Generic;
@ -17,18 +18,20 @@ namespace BTCPayServer.Services.Reporting
public DateTimeOffset To { get; }
public ViewDefinition? ViewDefinition { get; set; }
public IList<object> AddData()
public IList<object?> AddData()
{
var l = CreateData();
Data.Add(l);
return l;
}
public IList<object> CreateData()
public IList<object?> CreateData()
{
return new List<object>(ViewDefinition.Fields.Count);
if (ViewDefinition is null)
throw new InvalidOperationException("You need to initialize ViewDefinition first");
return new List<object?>(ViewDefinition.Fields.Count);
}
public IList<IList<object>> Data { get; set; } = new List<IList<object>>();
public IList<IList<object?>> Data { get; set; } = new List<IList<object?>>();
}
}

View File

@ -1,26 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.TagHelpers;
using System.Xml.Linq;
using BTCPayServer.Configuration;
namespace BTCPayServer.TagHelpers;
[HtmlTargetElement(Attributes = "[cheat-mode]")]
public class CheatModeTagHelper
[HtmlTargetElement(Attributes = "cheat-mode")]
public class CheatModeTagHelper : TagHelper
{
public CheatModeTagHelper(BTCPayServerOptions env)
{
Env = env;
}
public BTCPayServerOptions Env { get; }
BTCPayServerOptions Env { get; }
public bool CheatMode { get; set; }
public void Process(TagHelperContext context, TagHelperOutput output)
public override void Process(TagHelperContext context, TagHelperOutput output)
{
if (Env.CheatMode != CheatMode)
{

View File

@ -1,6 +1,8 @@
@using BTCPayServer.Plugins.PointOfSale.Models
@using BTCPayServer.Services
@using Newtonsoft.Json.Linq;
@using BTCPayServer.Abstractions.TagHelpers
@using Microsoft.AspNetCore.Mvc.TagHelpers
@inject DisplayFormatter DisplayFormatter
@inject BTCPayServer.Security.ContentSecurityPolicies Csp
@model BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel
@ -56,25 +58,22 @@
@for (var index = 0; index < Model.Items.Length; index++)
{
var item = Model.Items[index];
if (item.PriceType == ViewPointOfSaleViewModel.ItemPriceType.Topup)
{
continue;
}
var formatted = GetItemPriceFormatted(item);
var inStock = item.Inventory is null or > 0;
var buttonText = string.IsNullOrEmpty(item.BuyButtonText)
? item.PriceType == ViewPointOfSaleViewModel.ItemPriceType.Topup ? Model.CustomButtonText : Model.ButtonText
: item.BuyButtonText;
buttonText = buttonText.Replace("{0}", formatted).Replace("{Price}", formatted);
<div class="col posItem" :class="{ 'posItem--inStock': inStock(@index) }" data-index="@index" data-search="@Safe.Raw(item.Title) @Safe.Raw(item.Description)" data-categories="@(new JArray(item.Categories).ToString())">
var categories = new JArray(item.Categories ?? Array.Empty<string>());
<div class="col posItem" :class="{ 'posItem--inStock': inStock(@index) }" data-index="@index" data-search="@Safe.RawEncode(item.Title + " " + item.Description)" data-categories="@Safe.Json(categories)">
<div class="card h-100 px-0" v-on:click="addToCart(@index)">
@if (!string.IsNullOrWhiteSpace(item.Image))
{
<img class="card-img-top" src="@item.Image" alt="@Safe.Raw(item.Title)" asp-append-version="true">
<img class="card-img-top" src="@item.Image" alt="@item.Title" asp-append-version="true">
}
<div class="card-body p-3 d-flex flex-column gap-2">
<h5 class="card-title m-0">@Safe.Raw(item.Title)</h5>
<h5 class="card-title m-0">@Safe.RawEncode(item.Title)</h5>
<div class="d-flex gap-2 align-items-center">
@if (item.PriceType == ViewPointOfSaleViewModel.ItemPriceType.Topup || item.Price == 0)
{
@ -93,14 +92,14 @@
</div>
@if (!string.IsNullOrWhiteSpace(item.Description))
{
<p class="card-text">@Safe.Raw(item.Description)</p>
<p class="card-text">@Safe.RawEncode(item.Description)</p>
}
</div>
@if (inStock)
{
<div class="card-footer bg-transparent border-0 pt-0 pb-3">
<button type="button" class="btn btn-primary w-100" :disabled="!inStock(@index)">
@Safe.Raw(buttonText)
@Safe.RawEncode(buttonText)
</button>
</div>
<div class="posItem-added"><vc:icon symbol="checkmark" /></div>
@ -159,7 +158,7 @@
</div>
</td>
<td class="align-middle text-end">
{{ formatCurrency(item.price, true) }}
{{ formatCurrency(item.price||0, true) }}
</td>
</tr>
</tbody>

View File

@ -234,7 +234,7 @@ document.addEventListener("DOMContentLoaded", () => {
this.setEditingItem(null, { id: '', title: '', price: 0, image: '', description: '', categories: [], priceType: 'Fixed', inventory: null, disabled: false });
},
editItem(index) {
this.setEditingItem(index, Object.assign({}, this.config[index]));
this.setEditingItem(index, Object.assign({ id: '', title: '', price: 0, image: '', description: '', categories: [], priceType: 'Fixed', inventory: null, disabled: false }, this.config[index]));
},
saveItem() {
// set id from title if not set

File diff suppressed because one or more lines are too long

View File

@ -158,7 +158,7 @@ section dl > div dd {
color: var(--btcpay-body-text-muted);
}
#DefaultLang {
width: calc(var(--text-width, 110px) + 3rem);
width: calc(var(--text-width, 110px) + 3.5rem);
color: var(--btcpay-body-text-muted);
background-color: var(--btcpay-body-bg);
box-shadow: none;

View File

@ -0,0 +1,13 @@
<svg width="150" height="100" viewBox="0 0 5220 720" xmlns="http://www.w3.org/2000/svg">
<rect width="5220" height="720" fill="white"/>
<path d="M0 435.197L229.609 291.597V288.121L0 144.259V29.0508L334.901 245.894V333.824L0 550.798V435.197Z" fill="#FF3300"/>
<path d="M486.969 623.844H902.627V719.643H486.969V623.844Z" fill="#FF3300"/>
<path d="M993.879 291.2C993.879 106.422 1084.61 0 1214.37 0C1344.13 0 1434.86 106.422 1434.86 291.2C1434.86 479.061 1344.13 587.581 1214.37 587.581C1084.61 587.581 993.879 479.061 993.879 291.2ZM1345.12 291.2C1345.12 155.01 1293.16 75.9967 1214.37 75.9967C1135.58 75.9967 1083.62 155.01 1083.62 291.2C1083.62 430.473 1135.58 511.584 1214.37 511.584C1293.16 511.584 1344.85 430.473 1344.85 291.2H1345.12Z" fill="#FF3300"/>
<path d="M1593.29 154.29H1663.81L1670.37 205.37H1673.13C1711.31 169.634 1764.71 144.258 1814.44 144.258C1925.96 144.258 1988.02 228.713 1988.02 359.855C1988.02 504.111 1897.95 587.911 1797.77 587.911C1759.13 587.911 1713.54 568.829 1677.39 535.454H1675.29L1679.43 612.237V749.936H1593.29V154.29ZM1899.65 359.855C1899.65 271.269 1867.44 215.599 1791.21 215.599C1756.57 215.599 1717.93 232.713 1679.69 272.121V472.112C1714.79 503.914 1754.61 515.455 1781.57 515.455C1848.75 515.717 1899.65 459.851 1899.65 359.855Z" fill="#FF3300"/>
<path d="M2118.96 365.035C2118.96 227.336 2222.75 143.93 2335.98 143.93C2460.16 143.93 2530.82 225.434 2530.82 343.527C2530.67 359.209 2529.35 374.858 2526.88 390.345H2178.73V327.2H2473.22L2454.52 348.249C2454.52 256.449 2410.17 210.55 2338.47 210.55C2264.41 210.55 2203.66 265.17 2203.66 364.904C2203.66 468.833 2268.8 520.044 2359.79 520.044C2407.09 520.044 2445.08 505.75 2483.39 482.8L2513.56 537.29C2464.7 569.886 2407.32 587.378 2348.57 587.582C2220.39 587.582 2118.96 505.947 2118.96 365.035Z" fill="#FF3300"/>
<path d="M2658.41 154.29H2729.07L2735.63 221.697H2739.04C2781.55 178.289 2829.83 144.258 2895.17 144.258C2994.1 144.258 3039.17 205.042 3039.17 315.201V577.026H2952.9V326.152C2952.9 252.319 2928.11 218.222 2865.39 218.222C2819.47 218.222 2788.31 240.844 2744.68 285.563V577.026H2658.41V154.29Z" fill="#FF3300"/>
<path d="M3208.36 504.308L3259.46 444.376C3303 486.486 3360.93 510.468 3421.5 511.455C3493.27 511.455 3533.03 478.669 3533.03 432.77C3533.03 377.362 3491.63 361.953 3435.41 338.217L3355.57 303.333C3297.64 280.514 3234.21 238.614 3234.21 155.143C3234.21 66.8186 3313.65 0.001814 3425.64 0.001814C3492.01 -0.442962 3555.93 25.0654 3603.75 71.0807L3558.87 126.554C3521.22 93.051 3472.3 74.9951 3421.9 75.9985C3362.2 75.9985 3322.11 103.604 3322.11 150.028C3322.11 199.206 3371.05 217.173 3420.98 236.516L3497.93 270.416C3569.04 298.087 3622.18 339.528 3622.18 422.344C3622.18 513.356 3545.36 587.583 3416.78 587.583C3339.11 587.998 3264.34 558.123 3208.36 504.308V504.308Z" fill="black"/>
<path d="M3762.96 465.557C3762.96 370.741 3849.04 324.055 4062.7 308.186C4059.62 255.73 4031.54 213.896 3956.3 213.896C3905.13 213.896 3854.68 237.304 3813.28 261.5L3780.48 203.994C3827.98 174.684 3898.57 144.062 3971.78 144.062C4088.42 144.062 4148.91 210.945 4148.91 322.678V577.027H4077.73L4070.84 522.144H4068.08C4022.82 557.553 3963.97 587.715 3906.04 587.715C3825.16 587.584 3762.96 540.045 3762.96 465.557ZM4062.7 462.278V363.266C3896.79 375.134 3847.26 408.576 3847.26 459C3847.26 501.489 3885.38 519.063 3930.65 519.063C3975.91 519.063 4018.88 497.883 4062.7 462.278Z" fill="black"/>
<path d="M4388.81 409.884V222.941H4272.17V158.813L4392.16 154.289L4403.44 20.2617H4475.02V154.289H4674.64V222.941H4475.02V410.146C4475.02 482.864 4500.73 518.076 4577.29 518.076C4610.27 517.981 4642.96 511.847 4673.73 499.979L4691.24 562.992C4648.39 578.951 4603.07 587.274 4557.35 587.581C4430.86 587.581 4388.81 516.043 4388.81 409.884Z" fill="black"/>
<path d="M4818.71 521.815L4857.09 466.014C4909.9 502.948 4972.98 522.353 5037.43 521.487C5102.31 521.487 5133.34 495.259 5133.34 463.85C5133.34 433.95 5115.76 415 5009.22 393.034C4897.7 369.887 4845.21 331.2 4845.21 267.203C4845.21 196.518 4908.85 143.93 5025.95 143.93C5093.26 143.93 5157.55 170.158 5199.93 198.878L5159.45 252.646C5117.79 224.668 5068.79 209.592 5018.6 209.304C4955.62 209.304 4931.28 234.155 4931.28 263.138C4931.28 295.923 4965.07 309.037 5048.12 326.938C5185.89 357.101 5220.33 392.509 5220.33 458.736C5220.33 529.487 5151.71 587.582 5026.8 587.582C4952.47 586.641 4880.07 563.76 4818.71 521.815V521.815Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -1 +1 @@
<svg width="150" height="100" style="clip-rule:evenodd;fill-rule:evenodd;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision" version="1.1" id="svg587" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><style id="style324">.st2{fill:#ffc214}.st3{fill:#f9f185}.st0{fill:#222221}.st1{fill:#272425}</style><g id="g931" transform="matrix(.375 0 0 .375 -306.863 -123.51)"><path style="clip-rule:evenodd;fill:#fff;fill-rule:evenodd;stroke-width:3.14727;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision" id="rect875" d="M818.302 329.361h400v266.667h-400z"/><path d="M968.714 501.725c11.808 0 20.536-7.017 20.536-16.68 0-4.373-1.848-8.34-5.134-10.984-2.566-1.934-7.188-4.27-12.834-6.304-3.594-1.323-5.031-2.544-5.031-3.967 0-1.425 1.334-2.44 3.182-2.44 1.232 0 2.978.406 4.415 1.015l1.334.51 2.669 1.219c1.44.51 2.671.815 3.697.916 3.288.203 6.47-3.154 6.47-6.814 0-5.9-7.599-10.374-17.456-10.374-11.294 0-19.611 7.017-19.611 16.578 0 4.373 1.437 7.933 4.21 10.374 2.361 1.934 7.187 4.17 14.478 6.61 3.183 1.12 4.414 2.135 4.414 3.66 0 1.935-1.437 3.051-4.005 3.051-1.64 0-3.697-.507-5.235-1.322l-2.465-1.22-1.335-.71c-1.745-.917-3.285-1.321-4.725-1.321-3.489 0-6.774 3.354-6.774 6.914 0 5.695 9.445 11.287 19.2 11.287zm38.61-.612c4.72 0 7.7-3.254 7.7-8.44V463.79h3.697c5.44 0 8.418-2.44 8.418-7.12 0-4.882-2.772-7.222-8.42-7.222h-3.697v-9.456c0-5.188-2.977-8.442-7.7-8.442-4.823 0-7.7 3.256-7.7 8.442v9.458h-1.131c-5.544 0-8.318 2.338-8.318 7.22 0 4.78 2.774 7.12 8.318 7.12h1.13v28.883c0 5.186 2.978 8.44 7.7 8.44zm30.189.103c4.617 0 7.597-3.257 7.597-8.442v-19.73c0-1.524.306-3.153.923-4.475.72-1.728 1.848-2.644 4.826-3.66 10.268-3.966 7.6-2.95 8.214-3.153 2.774-1.222 3.903-3.154 3.903-6.305 0-3.966-3.595-7.426-7.6-7.426-3.592 0-6.88 1.729-10.78 5.798-1.643-4.07-3.492-5.492-7.086-5.492-4.826 0-7.803 3.154-7.803 8.442v36c0 5.189 2.977 8.443 7.803 8.443zm35.628-56.445c5.337 0 9.034-3.66 9.034-8.848 0-5.186-3.797-8.949-8.931-8.949-5.24 0-9.035 3.763-9.035 8.849 0 5.185 3.795 8.948 8.932 8.948zm.103 56.24c4.62 0 7.597-3.252 7.597-8.44v-35.697c0-5.186-2.977-8.442-7.597-8.442-4.826 0-7.805 3.153-7.805 8.442v35.697c0 5.288 2.876 8.442 7.805 8.442zm51.844.102c4.211 0 7.494-3.151 7.494-7.22 0-2.644-.614-3.763-5.134-9.255l-.923-1.119-9.96-12.509 7.189-7.32c4.928-5.19 3.591-3.766 4.106-4.375 1.437-1.629 1.745-2.441 1.745-3.967 0-3.863-3.183-7.423-6.777-7.423-2.874 0-5.031 1.22-8.831 5.288l-2.052 2.238-9.757 10.168V435.11c0-5.188-2.977-8.442-7.7-8.442-2.874 0-5.442 1.425-6.777 3.66-.717 1.323-.923 2.238-.923 4.782v57.561c0 5.288 2.875 8.442 7.7 8.442 4.826 0 7.7-3.254 7.7-8.44v-15.865l9.963 12.815 1.846 2.438c5.442 7.223 7.6 9.052 11.09 9.052zm32.98.51c5.85 0 11.5-1.423 16.53-4.17 4.109-2.338 6.163-4.983 6.163-7.933 0-3.56-2.877-6.713-6.265-6.713-1.029 0-2.566.408-4.003 1.119l-1.131.509-1.026.51-1.129.61-1.337.611c-2.874 1.117-4.517 1.523-7.083 1.523-5.648 0-9.345-2.745-10.68-7.83h27.211c4.62 0 6.366-1.831 6.366-6.51 0-4.676-1.334-9.458-3.697-13.525-4.62-7.73-11.911-11.899-21.048-11.899-15.303 0-25.774 11.39-25.774 28.068 0 15.156 11.09 25.63 26.902 25.63zM884.183 402.31l43.453 15.816c.174.064.343.134.507.213.39.122.776.255 1.166.397 13.845 5.038 21.031 20.213 16.053 33.895-4.98 13.679-20.24 20.683-34.086 15.645l-45.123-16.424c-2.769-1.009-4.209-4.045-3.212-6.782.996-2.735 4.047-4.135 6.816-3.126l25.071 9.125a26.09 26.09 0 0 1-.906-11.552l-51.476-18.735c-2.77-1.008-4.207-4.044-3.21-6.782.994-2.732 4.047-4.132 6.816-3.124l51.474 18.73a26.09 26.09 0 0 1 8.12-8.265l-25.07-9.123c-2.766-1.006-4.206-4.042-3.21-6.78.997-2.734 4.048-4.135 6.817-3.129zm272.96 58.124c5.134 0 8.317 2.95 9.24 8.848h-19.097c1.54-5.798 4.929-8.848 9.857-8.848zM905.38 438.068c-3.001 8.243 1.315 17.38 9.637 20.41 8.325 3.028 17.501-1.198 20.503-9.442 2.999-8.243-1.315-17.38-9.637-20.41-8.325-3.028-17.503 1.198-20.503 9.442z" fill="currentColor" id="path420" style="stroke-width:2.44837"/></g></svg>
<svg width="155" height="120" viewBox="0 0 155 120" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" class="chakra-icon css-13xqvrm"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.06565 43.2477C1.90963 41.2685 -0.665684 35.4843 1.31353 30.3283C3.29274 25.1722 9.07699 22.5969 14.233 24.5761L51.4526 38.8634C51.4937 38.8798 51.535 38.896 51.5765 38.9119L70.2481 46.0792C75.4041 48.0584 81.1883 45.4831 83.1675 40.3271C85.1468 35.1711 82.5714 29.3868 77.4154 27.4076L77.4132 27.4068C77.4139 27.4064 77.4145 27.406 77.4151 27.4056L58.7436 20.2383C53.5876 18.2591 51.0123 12.4749 52.9915 7.31885C54.9707 2.16283 60.755 -0.412485 65.911 1.56673L120.828 22.6473C120.959 22.6977 121.089 22.7506 121.217 22.8059C121.453 22.8928 121.69 22.9815 121.926 23.0721C147.706 32.9681 160.583 61.8894 150.686 87.6695C140.79 113.45 111.869 126.326 86.089 116.43C85.5927 116.24 85.1011 116.042 84.6144 115.838C84.3783 115.766 84.1431 115.686 83.9091 115.596L30.0742 94.9308C24.9182 92.9516 22.3428 87.1673 24.3221 82.0113C26.3013 76.8553 32.0855 74.2799 37.2415 76.2592L55.9106 83.4256C55.9103 83.4242 55.9099 83.4229 55.9095 83.4215L55.9133 83.423C61.0694 85.4022 66.8536 82.8269 68.8328 77.6709C70.812 72.5148 68.2367 66.7306 63.0807 64.7514L54.6786 61.5261C54.6787 61.5257 54.6788 61.5252 54.6789 61.5247L7.06565 43.2477Z" fill="currentColor"></path></svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -52,7 +52,7 @@ document.addEventListener("DOMContentLoaded",function () {
return this.cart.reduce((res, item) => res + (parseInt(item.count) || 0), 0)
},
amountNumeric () {
return parseFloat(this.cart.reduce((res, item) => res + item.price * item.count, 0).toFixed(this.currencyInfo.divisibility))
return parseFloat(this.cart.reduce((res, item) => res + (item.price||0) * item.count, 0).toFixed(this.currencyInfo.divisibility))
},
posdata () {
const data = {
@ -70,7 +70,7 @@ document.addEventListener("DOMContentLoaded",function () {
searchTerm(term) {
const t = term.toLowerCase();
this.forEachItem(item => {
const terms = item.dataset.search.toLowerCase()
const terms = decodeURIComponent(item.dataset.search.toLowerCase());
const included = terms.indexOf(t) !== -1
item.classList[included ? 'remove' : 'add']("d-none")
})
@ -160,7 +160,10 @@ document.addEventListener("DOMContentLoaded",function () {
}
},
mounted() {
this.$cart = new bootstrap.Offcanvas(this.$refs.cart, {backdrop: false})
const self =this;
nextTick(() => {
self.$cart = new bootstrap.Offcanvas("#cart", {backdrop: false})
})
window.addEventListener('pagehide', () => {
if (this.payButtonLoading) {
this.unsetPayButtonLoading();

View File

@ -31,6 +31,9 @@ const posCommon = {
if (this.tipPercent) {
return parseFloat((this.amountMinusDiscountNumeric * (this.tipPercent / 100)).toFixed(this.currencyInfo.divisibility))
} else {
if (this.tip < 0) {
this.tip = 0
}
const value = parseFloat(this.tip)
return isNaN(value) ? 0.0 : parseFloat(value.toFixed(this.currencyInfo.divisibility))
}
@ -64,6 +67,7 @@ const posCommon = {
discountPercent (val) {
const value = parseFloat(val)
if (isNaN(value)) this.discountPercent = null
else if (value < 0) this.discountPercent = '0'
else if (value > 100) this.discountPercent = '100'
else this.discountPercent = value.toString()
},

View File

@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.11.0</Version>
<Version>1.11.1</Version>
</PropertyGroup>
</Project>

View File

@ -1,5 +1,44 @@
# Changelog
## 1.11.1
## Bug fixes
* Language Select box cut off on checkout (#5210) @dstrukt
* POS Cart view malformed when special characters are in items (#5203 #5211) @Kukks
* Errors creating invoice from public form were not shown in the UI (#5208 #5211) @Kukks
* Cart view doesn't show item when the amount field is custom (#5204 #5211) @Kukks
* Can't save the item when adding a new category in POS (#5205 #5211) @Kukks
## 1.11.0
### New Features
* Complete overhaul of Invoice Reporting (#5095 #5155) @NicolasDorier
* POS Cart redesign (#5109 #5171) @dennisreimann @dstrukt
* Add product categories to POS apps (#5088 #5078) @NicolasDorier
* Checkout v2: Play sound when invoice is paid (#5085 #5113) @dennisreimann @webwworthy
* Add support for ExchangeRateHost and FreeCurrencyRates rate providers (#5166) @Kukks
### Bug fixes
* Support NFC on modal (#4251 #5033) @Kukks @dennisreimann
* Fixed setting of minimum or custom price for LNURL POS items (#5170 #5172) @Kukks
* Preventing entering of negative tips and discounts in POS (#5192 #5198) @rockstardev
* Fixing display of amount paid on Receipt page (#5195 #5197) @rockstardev
* Form invoice amount adjusters, useful for shipping and other addon amounts to the invoice (#5087 #5158) @Kukks @dennisreimann
### Improvements
* Improved Payment Requests List View (#3872 #5065) @TChukwuleta
* Improve create first store view (#5008 #5181) @dennisreimann
* Invoice lists: Show icons for payment methods (#5084 #5137) @dennisreimann
* Apps: Add direct file upload in item editor (#5086 #5140) @dennisreimann
* Add OpenSats supporters logo (#5202) @Kukks @Pavlenex
* Add recommended rate providers for UGX and RSD (#5166) @Kukks
## 1.10.3
### New Features