Fixing status bug in Supplier page
This commit is contained in:
parent
b02af975ac
commit
67a501f4fc
@ -57,7 +57,7 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass
|
||||
public long CanvassDetailId { get; set; }
|
||||
public long CanvassId { get; set; }
|
||||
public decimal QtyRequest { get; set; }
|
||||
//public byte IsApproved { get; set; }
|
||||
public bool IsInternational { get; set; }
|
||||
public long RRDetailId { get; set; }
|
||||
public long PRDetailId { get; set; }
|
||||
public decimal Quantity { get; set; }
|
||||
@ -75,6 +75,7 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass
|
||||
public bool IsDenied { get; set; } = false;
|
||||
public string? FullName { get; set; }
|
||||
public string? Specification { get; set; }
|
||||
|
||||
public byte CurrencyId { get; set; } = 1;
|
||||
public bool VatInc { get; set; }=false;
|
||||
public string? TinNo { get; set; }
|
||||
|
||||
17
CPRNIMS.Infrastructure/Dto/Canvass/CanvassItemDto.cs
Normal file
17
CPRNIMS.Infrastructure/Dto/Canvass/CanvassItemDto.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPRNIMS.Infrastructure.Dto.Canvass
|
||||
{
|
||||
public class CanvassItemDto
|
||||
{
|
||||
public long PRDetailsId { get; set; }
|
||||
public long PRNo { get; set; }
|
||||
public long ItemNo { get; set; }
|
||||
public string ItemDescription { get; set; } = string.Empty;
|
||||
public string ItemName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
22
CPRNIMS.Infrastructure/Dto/Canvass/ForCanvassDto.cs
Normal file
22
CPRNIMS.Infrastructure/Dto/Canvass/ForCanvassDto.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPRNIMS.Infrastructure.Dto.Canvass
|
||||
{
|
||||
public class ForCanvassDto
|
||||
{
|
||||
public short Status {get;set;}
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
public int SupplierId { get; set; }
|
||||
public long PRNo { get; set; }
|
||||
public long ItemNo { get; set; }
|
||||
public int CanvassNo { get; set; }
|
||||
public long PRDetailsId { get; set; }
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
public string? Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPRNIMS.Infrastructure.Dto.Canvass.Request
|
||||
{
|
||||
public class ForCanvassRequest
|
||||
{
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
public int SupplierId { get; set; }
|
||||
public long PRNo { get; set; }
|
||||
public long ItemNo { get; set; }
|
||||
public int CanvassNo { get; set; }
|
||||
public long PRDetailsId { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPRNIMS.Infrastructure.Dto.Canvass.Request
|
||||
{
|
||||
public class StartCanvassRequest
|
||||
{
|
||||
[JsonPropertyName("isInternational")]
|
||||
public bool IsInternational { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public List<CanvassItemDto> Items { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@ -21,5 +21,6 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass.Request
|
||||
public string Address { get; set; } = string.Empty;
|
||||
public long ItemNo { get; set; } = 0;
|
||||
public string Website { get; set; } = string.Empty;
|
||||
public int SupplierId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPRNIMS.Infrastructure.Dto.Canvass.Response
|
||||
{
|
||||
public class StartCanvassResponse
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public bool IsInternational { get; set; }
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
public List<CanvassItemDto> Items { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@ -10,18 +10,19 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass.Response
|
||||
{
|
||||
public int SupplierId { get; set; }
|
||||
public string SupplierName { get; set; } = string.Empty;
|
||||
public string EmailAddress { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public string ContactNo { get; set; } = string.Empty;
|
||||
public string ContactPerson { get; set; } = string.Empty;
|
||||
public string LeadTime { get; set; } = string.Empty;
|
||||
public bool VatInc { get; set; } = false;
|
||||
public string? EmailAddress { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string? ContactNo { get; set; }
|
||||
public string? ContactPerson { get; set; }
|
||||
public string? LeadTime { get; set; }
|
||||
public bool? IsVatable { get; set; }
|
||||
public byte? PaymentTermsId { get; set; }
|
||||
public byte? CurrencyId { get; set; }
|
||||
public string? TinNo { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Website { get; set; }
|
||||
public bool VatInc { get; set; }
|
||||
public string Currency { get; set; }=string.Empty;
|
||||
public string PaymentTerms { get; set; } = string.Empty;
|
||||
public byte PaymentTermsId { get; set; } = 1;
|
||||
public byte CurrencyId { get; set; } = 1;
|
||||
public string TinNo { get; set; } = string.Empty;
|
||||
public string Address { get; set; } = string.Empty;
|
||||
public string Website { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,5 +22,6 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass.Response
|
||||
public byte PaymentTermsId { get; set; }
|
||||
public byte CurrencyId { get; set; }
|
||||
public string? TinNo { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPRNIMS.Infrastructure.Dto.Canvass.Result
|
||||
@ -28,12 +30,43 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass.Result
|
||||
[JsonPropertyName("source")]
|
||||
public string? Source { get; set; }
|
||||
|
||||
[JsonPropertyName("estimated_price_usd")]
|
||||
[JsonConverter(typeof(FlexibleDecimalConverter))]
|
||||
public decimal? EstimatedPriceUsd { get; set; }
|
||||
|
||||
[JsonPropertyName("item_specifications")]
|
||||
public JsonElement? ItemSpecifications { get; set; }
|
||||
}
|
||||
public class FlexibleDecimalConverter : JsonConverter<decimal?>
|
||||
{
|
||||
public override decimal? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
switch (reader.TokenType)
|
||||
{
|
||||
case JsonTokenType.Number:
|
||||
return reader.TryGetDecimal(out var num) ? num : null;
|
||||
|
||||
case JsonTokenType.String:
|
||||
var str = reader.GetString()?.Trim();
|
||||
if (string.IsNullOrWhiteSpace(str)) return null;
|
||||
|
||||
// Strip currency symbols and commas e.g. "$1,200.00" → 1200.00
|
||||
str = Regex.Replace(str, @"[^\d.]", "");
|
||||
return decimal.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out var parsed)
|
||||
? parsed
|
||||
: null; // "contact for pricing", "varies", etc. → null
|
||||
|
||||
case JsonTokenType.Null:
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, decimal? value, JsonSerializerOptions options)
|
||||
{
|
||||
if (value.HasValue) writer.WriteNumberValue(value.Value);
|
||||
else writer.WriteNullValue();
|
||||
}
|
||||
}
|
||||
public class TavilySearchResult
|
||||
{
|
||||
public List<TavilyResult> Results { get; set; } = new();
|
||||
@ -46,7 +79,11 @@ namespace CPRNIMS.Infrastructure.Dto.Canvass.Result
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public double Score { get; set; }
|
||||
}
|
||||
|
||||
public class GroqMatchResult
|
||||
{
|
||||
public bool Matched { get; set; }
|
||||
public int? SupplierId { get; set; }
|
||||
}
|
||||
public class GroqResponse
|
||||
{
|
||||
public List<GroqChoice> Choices { get; set; } = new();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1056,15 +1056,6 @@
|
||||
searchable: false
|
||||
},
|
||||
{data: 'supplierName'}],
|
||||
rowCallback: function (row, data) {
|
||||
var statusCell = $('td:eq(9)', row);
|
||||
var myStatus = statusCell.text().trim();
|
||||
if (myStatus === 'Yes' || myStatus === 'true' || myStatus === true) {
|
||||
statusCell.text('Yes').addClass('status-active');
|
||||
} else {
|
||||
statusCell.text('No').addClass('status-partial');
|
||||
}
|
||||
},
|
||||
error: errorHandler
|
||||
});
|
||||
}
|
||||
|
||||
@ -15,9 +15,9 @@
|
||||
<script src="~/jsfunctions/common/IndexCard.js"></script>
|
||||
<script src="~/jsfunctions/common/ColumnCommonV2.js"></script>
|
||||
|
||||
<script src="~/jsfunctions/canvass/CanvassViewV7.js"></script>
|
||||
<script src="~/jsfunctions/canvass/CanvassView.js"></script>
|
||||
<script src="~/jsfunctions/common/termsV2.js"></script>
|
||||
<script src="~/jsfunctions/canvass/PostPutV9.js"></script>
|
||||
<script src="~/jsfunctions/canvass/PostPut.js"></script>
|
||||
<script src="~/jsfunctions/common/PostPutV2.js"></script>
|
||||
<script src="~/jsfunctions/canvass/buttonsV5.js"></script>
|
||||
<script src="~/jsfunctions/canvass/rowCallBackV2.js"></script>
|
||||
|
||||
@ -1,52 +1,391 @@
|
||||
<!-- Modal addNewEditSupplier -->
|
||||
<div class="modal fade custom-modal-backdrop" id="addNewEditSupplier"
|
||||
data-bs-backdrop="static" tabindex="-1" aria-labelledby="ModalLabel">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" style="text-align: center; margin-left: auto; margin-right: auto;"
|
||||
id="headerNew">
|
||||
Add new supplier
|
||||
</h5>
|
||||
<h5 class="modal-title" style="text-align: center; margin-left: auto; margin-right: auto;"
|
||||
id="headerUpdate">
|
||||
Update supplier
|
||||
</h5>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="supplierName">Supplier Name:</label>
|
||||
<input type="text" id="supplierName" class="form-control" style="margin-bottom:10px;" name="supplierName" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="emailAddress">Email Address:</label>
|
||||
<textarea type="text" id="emailAddress" name="emailAddress" style="width: 100%; height: 100px;"
|
||||
placeholder="input here..."></textarea>
|
||||
<style>
|
||||
:root {
|
||||
--brand: #0f6e56;
|
||||
--brand-light: #e1f5ee;
|
||||
--brand-mid: #1d9e75;
|
||||
--surface: #f7f8fa;
|
||||
--card-bg: #ffffff;
|
||||
--border: #e2e6ea;
|
||||
--border-focus: #1d9e75;
|
||||
--text-primary: #1a1f2b;
|
||||
--text-muted: #6c757d;
|
||||
--radius-card: 14px;
|
||||
--radius-input: 8px;
|
||||
--shadow-card: 0 2px 12px rgba(0,0,0,.07);
|
||||
--shadow-modal: 0 8px 40px rgba(0,0,0,.16);
|
||||
}
|
||||
|
||||
#btnAddNewSupplier {
|
||||
width: auto !important;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #dde3ec;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
}
|
||||
|
||||
/* ── Modal shell ── */
|
||||
.modal-backdrop-card {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(15,30,50,.45);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
.modal-shell {
|
||||
background: var(--surface);
|
||||
border-radius: 20px;
|
||||
box-shadow: var(--shadow-modal);
|
||||
width: 100%;
|
||||
max-width: 860px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── Header ── */
|
||||
.modal-hdr {
|
||||
background: var(--brand);
|
||||
padding: 1.1rem 1.75rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.modal-hdr h5 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
letter-spacing: .3px;
|
||||
}
|
||||
|
||||
.modal-hdr .badge-mode {
|
||||
font-size: .7rem;
|
||||
font-weight: 500;
|
||||
background: rgba(255,255,255,.18);
|
||||
color: #fff;
|
||||
padding: .25rem .65rem;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/* ── Body ── */
|
||||
.modal-body-wrap {
|
||||
padding: 1.5rem 1.75rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
/* ── Card ── */
|
||||
.m-card {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-card);
|
||||
padding: 1.25rem 1.4rem;
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.m-card-title {
|
||||
font-size: .68rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .8px;
|
||||
color: var(--brand);
|
||||
margin-bottom: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .45rem;
|
||||
}
|
||||
|
||||
.m-card-title::before {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
background: var(--brand);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* ── Grid layouts ── */
|
||||
.grid-2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: .9rem 1.25rem;
|
||||
}
|
||||
|
||||
.grid-3 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: .9rem 1.25rem;
|
||||
}
|
||||
|
||||
.grid-4 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
gap: .9rem 1.25rem;
|
||||
}
|
||||
|
||||
.span-2 {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.span-full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
/* ── Form controls ── */
|
||||
.f-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: .3rem;
|
||||
}
|
||||
|
||||
.f-label {
|
||||
font-size: .78rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.f-control {
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
font-size: .875rem;
|
||||
color: var(--text-primary);
|
||||
background: #fff;
|
||||
border: 1.5px solid var(--border);
|
||||
border-radius: var(--radius-input);
|
||||
padding: .45rem .7rem;
|
||||
width: 100%;
|
||||
outline: none;
|
||||
transition: border-color .18s, box-shadow .18s;
|
||||
}
|
||||
|
||||
.f-control:focus {
|
||||
border-color: var(--border-focus);
|
||||
box-shadow: 0 0 0 3px rgba(29,158,117,.12);
|
||||
}
|
||||
|
||||
textarea.f-control {
|
||||
resize: vertical;
|
||||
min-height: 72px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
select.f-control {
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c757d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right .75rem center;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
/* ── Toggle switch ── */
|
||||
.toggle-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .65rem;
|
||||
padding: .55rem 0;
|
||||
}
|
||||
|
||||
.toggle-label {
|
||||
font-size: .78rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.toggle-status {
|
||||
font-size: .78rem;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
min-width: 28px;
|
||||
}
|
||||
|
||||
.sw {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sw input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.sw-track {
|
||||
width: 40px;
|
||||
height: 22px;
|
||||
background: #d1d5db;
|
||||
border-radius: 11px;
|
||||
cursor: pointer;
|
||||
transition: background .2s;
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sw input:checked + .sw-track {
|
||||
background: var(--brand-mid);
|
||||
}
|
||||
|
||||
.sw-thumb {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 3px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
transition: transform .2s;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.2);
|
||||
}
|
||||
|
||||
.sw input:checked ~ .sw-thumb {
|
||||
transform: translateX(18px);
|
||||
}
|
||||
|
||||
/* ── Footer ── */
|
||||
.modal-ftr {
|
||||
border-top: 1px solid var(--border);
|
||||
padding: .9rem 1.75rem;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: .6rem;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.btn-back {
|
||||
font-family: 'DM Sans',sans-serif;
|
||||
font-size: .85rem;
|
||||
font-weight: 600;
|
||||
padding: .5rem 1.2rem;
|
||||
border-radius: 8px;
|
||||
border: 1.5px solid var(--border);
|
||||
background: #fff;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: background .15s;
|
||||
}
|
||||
|
||||
.btn-back:hover {
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.btn-save {
|
||||
font-family: 'DM Sans',sans-serif;
|
||||
font-size: .85rem;
|
||||
font-weight: 600;
|
||||
padding: .5rem 1.4rem;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
background: var(--brand);
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
transition: background .15s;
|
||||
}
|
||||
|
||||
.btn-save:hover {
|
||||
background: #0d5e48;
|
||||
}
|
||||
|
||||
.btn-update {
|
||||
font-family: 'DM Sans',sans-serif;
|
||||
font-size: .85rem;
|
||||
font-weight: 600;
|
||||
padding: .5rem 1.4rem;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
background: #e9a820;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
transition: background .15s;
|
||||
}
|
||||
|
||||
.btn-update:hover {
|
||||
background: #c98d10;
|
||||
}
|
||||
/* Kill Bootstrap's appended backdrop globally */
|
||||
.modal-backdrop {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#addNewEditSupplier::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: all;
|
||||
z-index: 1060; /* ← add this — confirmation modal at 1080 sits above it */
|
||||
}
|
||||
|
||||
#addNewEditSupplier .modal-dialog {
|
||||
pointer-events: all;
|
||||
position: relative;
|
||||
z-index: 1061; /* ← just above ::before so card is clickable */
|
||||
}
|
||||
</style>
|
||||
<!-- Modal addNewEditSupplier -->
|
||||
<div class="modal fade" id="addNewEditSupplier" tabindex="-1" aria-hidden="true" data-bs-backdrop="static">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered" style="max-width:860px;">
|
||||
<div class="modal-shell">
|
||||
|
||||
<!-- Header -->
|
||||
<div class="modal-hdr">
|
||||
<h5 id="headerNew">Add new supplier</h5>
|
||||
<h5 id="headerUpdate" style="display:none;">Update supplier</h5>
|
||||
<span class="badge-mode" id="modeBadge">New</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="contactPerson">Contact Person:</label>
|
||||
<textarea type="text" id="contactPerson" name="contactPerson" style="width: 100%; height: 50px;margin-bottom:10px;"
|
||||
placeholder="input here..."></textarea>
|
||||
<!-- Body -->
|
||||
<div class="modal-body-wrap">
|
||||
|
||||
<!-- Card 1: Basic Info -->
|
||||
<div class="m-card">
|
||||
<div class="m-card-title">Basic Information</div>
|
||||
<div class="grid-2">
|
||||
<div class="f-group span-full">
|
||||
<label class="f-label" for="supplierName">Supplier Name</label>
|
||||
<input type="text" id="supplierName" name="supplierName" class="f-control" placeholder="Enter supplier name" />
|
||||
</div>
|
||||
<div class="f-group span-full">
|
||||
<label class="f-label" for="address">Address</label>
|
||||
<textarea id="address" name="address" class="f-control" placeholder="Enter full address" style="min-height:80px;"></textarea>
|
||||
</div>
|
||||
<div class="f-group span-full">
|
||||
<label class="f-label" for="emailAddress">Email Address</label>
|
||||
<input type="email" id="emailAddress" name="emailAddress" class="f-control" placeholder="supplier@example.com" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="contactNo">Contact No:</label>
|
||||
<input type="text" id="contactNo" class="form-control" style="margin-bottom:10px;" name="contactNo" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="address">Address:</label>
|
||||
<textarea type="text" id="address" name="address" style="width: 100%; height: 100px;margin-bottom:10px;"
|
||||
placeholder="input here..."></textarea>
|
||||
|
||||
<!-- Card 2: Contact & Financial -->
|
||||
<div class="grid-2" style="gap:1rem;">
|
||||
|
||||
<!-- Contact -->
|
||||
<div class="m-card">
|
||||
<div class="m-card-title">Contact Details</div>
|
||||
<div class="f-group" style="margin-bottom:.85rem;">
|
||||
<label class="f-label" for="contactNo">Contact No.</label>
|
||||
<input type="text" id="contactNo" name="contactNo" class="f-control" placeholder="63 9XX XXX XXXX" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
<label for="currencyId">Currency:</label>
|
||||
<div class="f-group">
|
||||
<label class="f-label" for="contactPerson">Contact Person</label>
|
||||
<input type="text" id="contactPerson" name="contactPerson" class="f-control" placeholder="e.g. MS. IVY" />
|
||||
</div>
|
||||
@* <div class="f-group">
|
||||
<label class="f-label" for="whatsappNo">WhatsApp No.</label>
|
||||
<input type="text" id="whatsappNo" name="whatsappNo" class="f-control" placeholder="63 9XX XXX XXXX" />
|
||||
</div> *@
|
||||
</div>
|
||||
|
||||
<!-- Financial -->
|
||||
<div class="m-card">
|
||||
<div class="m-card-title">Financial Settings</div>
|
||||
<div class="grid-2" style="margin-bottom:.85rem;">
|
||||
<div class="f-group">
|
||||
<label class="f-label" for="currencyCode">Currency</label>
|
||||
<select class="form-control" id="currencyId" style="margin-bottom:10px;">
|
||||
<option value="" disabled selected>-Select Currency-</option>
|
||||
<option value="1">PHP</option>
|
||||
@ -60,49 +399,49 @@ data-bs-backdrop="static" tabindex="-1" aria-labelledby="ModalLabel">
|
||||
<option value="9">EUR</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
<label for="vatInc">VatInc:</label>
|
||||
<input type="checkbox" id="vatInc" style="margin-bottom:10px;" name="vatInc" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="tinNo">Tin No:</label>
|
||||
<input type="text" id="tinNo" class="form-control" style="margin-bottom:10px;" name="tinNo" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="leadTime">LeadTime:</label>
|
||||
<input type="text" id="leadTime" class="form-control" style="margin-bottom:10px;" name="leadTime" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="C-paymentTerms">Payment Terms:</label>
|
||||
<input type="search" name="C-paymentTerms" id="C-paymentTerms" class="form-control" style="margin-bottom:5px;">
|
||||
<div class="f-group">
|
||||
<label class="C-paymentTerms" for="creditTermName">Payment Termsm</label>
|
||||
<input type="search" id="C-paymentTerms" name="C-paymentTerms" class="f-control" placeholder="Search term..." />
|
||||
<input type="hidden" id="C-paymentTermsId" name="C-paymentTermsId" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="isActive">Status</label>
|
||||
<select class="form-control" id="isActive" style="margin-bottom:10px;">
|
||||
<option value="" disabled selected>-Select Status-</option>
|
||||
<option value="true">Active</option>
|
||||
<option value="false">Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="refreshSupplierTable();" data-bs-dismiss="modal">back</button>
|
||||
<button type="button" id="btnaddNewSupplier" onclick="postPutMySupplier(1);" class="btn btn-success"> Save</button>
|
||||
<button type="button" id="btnUpdateSupplier" onclick="postPutMySupplier(0);" class="btn btn-warning">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toggles -->
|
||||
<div style="border-top:1px solid var(--border); padding-top:.85rem; display:flex; flex-direction:column; gap:.1rem;">
|
||||
<label class="toggle-label" style="margin-bottom:.35rem; font-size:.72rem; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted);">Settings</label>
|
||||
|
||||
<div class="toggle-row">
|
||||
<div class="sw">
|
||||
<input type="checkbox" id="vatInc" name="vatInc">
|
||||
<label for="vatInc" class="sw-track"></label>
|
||||
<span class="sw-thumb"></span>
|
||||
</div>
|
||||
<span class="toggle-label">Vat Inc.</span>
|
||||
<span class="toggle-status" id="vatIncText">Yes</span>
|
||||
</div>
|
||||
|
||||
<div class="toggle-row">
|
||||
<div class="sw">
|
||||
<input type="checkbox" id="isActive" name="isActive">
|
||||
<label for="isActive" class="sw-track"></label>
|
||||
<span class="sw-thumb"></span>
|
||||
</div>
|
||||
<span class="toggle-label">Status</span>
|
||||
<span class="toggle-status" id="statusText">Active</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /grid-2 -->
|
||||
</div><!-- /modal-body-wrap -->
|
||||
<!-- Footer -->
|
||||
<div class="modal-ftr">
|
||||
<button class="btn-back" type="button" onclick="refreshSupplierTable()" data-bs-dismiss="modal">Back</button>
|
||||
<button class="btn-save" type="button" id="btnaddNewSupplier" onclick="postPutMySupplier(1)">Save</button>
|
||||
<button class="btn-update" type="button" id="btnUpdateSupplier" onclick="postPutMySupplier(0)" style="display:none;">Update</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -125,18 +125,10 @@ function viewItemDetail(data) {
|
||||
error: errorHandler
|
||||
}, beforeComplete(loader)));
|
||||
}
|
||||
function viewSupplierById(data) {
|
||||
function viewSupplierById(item) {
|
||||
loader = $('#overlay, #loader').css('z-index', 1070);
|
||||
|
||||
SupplierId = data.supplierId;
|
||||
|
||||
$.ajax($.extend({
|
||||
url: endpoint.GetSupplierById,
|
||||
type: 'POST',
|
||||
data: { SupplierId },
|
||||
success: function (data) {
|
||||
if (data && data.data && data.data.length > 0) {
|
||||
var item = data.data[0];
|
||||
SupplierId = item.supplierId;
|
||||
|
||||
$('#supplierId').val(item.supplierId);
|
||||
$('#supplierName').val(item.supplierName);
|
||||
@ -158,14 +150,6 @@ function viewSupplierById(data) {
|
||||
showHideLabelButtons(0);
|
||||
$('#addNewEditSupplier').modal('show');
|
||||
$('#addNewEditSupplier').css('z-index', 1070);
|
||||
|
||||
} else {
|
||||
console.log('Data is null or undefined');
|
||||
// window.location.href = '/Home/Logout';
|
||||
}
|
||||
},
|
||||
error: errorHandler
|
||||
}, beforeComplete(loader)));
|
||||
}
|
||||
function viewItemWOEmail(data) {
|
||||
var loader = $('#overlay, #loader');
|
||||
@ -378,6 +378,7 @@ function postPutMySupplier(isNew) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
showConfirmation({
|
||||
title: 'Item Tagging',
|
||||
message: 'Are you sure you want to tag this item? This action cannot be undone.',
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user