added improvements on set proces and minor other improvements

This commit is contained in:
Stefan
2026-07-13 22:40:08 +02:00
parent 5c0fdc6c1d
commit 5f85b75c22
55 changed files with 1170 additions and 357 deletions
@@ -222,6 +222,52 @@ public partial class IntranetController
: StatusCode(500, new { error = "not successful" });
}
case "man":
{
var pl = StdParamlist(
SQL_VarChar("@taID", Form("taID"), dbNull_IfEmpty: true),
SQL_Date("@ValueDate", Form("ValueDate")),
SQL_Decimal("@Amount", Form("Amount"), precision: 9, scale: 2),
SQL_NVarChar("@NameOfPayer", Form("NameOfPayer"), dbNull_IfEmpty: true),
SQL_VarChar("@SepaRemittanceInformation", Form("SepaRemittanceInformation"), dbNull_IfEmpty: true));
await getSQLDatatable_async(
"EXECUTE [dbo].[fds__setBankingtransaction_manual] @taID, @ValueDate, @Amount, @NameOfPayer, @SepaRemittanceInformation, @authuser;",
_intranet.Intranet__SQLConnectionString, pl,
Security: DbSec, options: SqlOpt(fn, id, code));
_logger.LogInformation(
"Manual banking transaction upserted taID={TaID} user={User}", Form("taID"), UserAccountID);
return await JSONAsync(new { ok = true });
}
case "mget":
{
if (!HasForm("taid")) return BadRequest400();
var pl = StdParamlist(SQL_VarChar("@taID", Form("taid"), dbNull_IfEmpty: true));
var res = await getSQLDatatable_async(
"EXECUTE [dbo].[fds__getBankingtransaction_manual] @taID, @authuser;",
_intranet.Intranet__SQLConnectionString, pl,
Security: DbSec, options: SqlOpt(fn, id, code));
return await JSONAsync(res.FirstRow.toObjectDictionary());
}
case "mdel":
{
if (!HasForm("taid")) return BadRequest400();
var pl = StdParamlist(
SQL_VarChar("@taID", Form("taid"), dbNull_IfEmpty: true),
SQL_Date("@ValueDate", (string?)null),
SQL_Decimal("@Amount", (string?)null, precision: 9, scale: 2),
SQL_NVarChar("@NameOfPayer", null, dbNull_IfEmpty: true),
SQL_VarChar("@SepaRemittanceInformation", null, dbNull_IfEmpty: true));
await getSQLDatatable_async(
"EXECUTE [dbo].[fds__setBankingtransaction_manual] @taID, @ValueDate, @Amount, @NameOfPayer, @SepaRemittanceInformation, @authuser;",
_intranet.Intranet__SQLConnectionString, pl,
Security: DbSec, options: SqlOpt(fn, id, code));
_logger.LogInformation(
"Manual banking transaction deleted taID={TaID} user={User}", Form("taid"), UserAccountID);
return await JSONAsync(new { ok = true });
}
case "vfi":
{
if (!HasForm("invid")) return BadRequest400();
@@ -78,9 +78,17 @@ public partial class IntranetController
var ldic = BuildInvoiceRequestList(sqldset);
var adminDic = sqldset.Table("admin").FirstRow.toObjectDictionary();
var invDic = sqldset.Table("inv").FirstRow.toObjectDictionary();
bool has13b = invDic.nz("InvoiceOptions", "").Split(',').Contains("§13b");
string invoiceOptions = invDic.nz("InvoiceOptions", "");
bool has13b = invoiceOptions.Split(',').Contains("§13b");
if (has13b)
adminDic["p13b"] = true;
// Carry the persisted set-pricing mode forward (see InvoiceSetPricing.cs / FdsInvoiceData.BuildInvoiceOptions):
// needed so the editor knows the invoice has already been explicitly switched to a set-display
// mode (including the default "setprice") and hides the "Set-Preisanzeige" menu entry accordingly.
string? setmodeToken = invoiceOptions.Split(',')
.FirstOrDefault(t => t.StartsWith("setmode:", StringComparison.OrdinalIgnoreCase));
if (setmodeToken != null)
adminDic["setmode"] = setmodeToken["setmode:".Length..].Trim().ToLowerInvariant();
_logger.LogDebug("HandleInvoiceGet invoiceId={InvoiceId} requestCount={ReqCount} has13b={Has13b} user={User}",
invoiceId, ldic.Count, has13b, UserAccountID);
return await JSONAsync(new { admin = adminDic, inv = invDic, req = ldic });