feat: view store details

feature/issue-1/view-store-detail
Frédérik Benoist 2023-11-21 00:34:30 +01:00
parent e6e5c787ae
commit a1cb0cb4a2
7 changed files with 9396 additions and 425 deletions

View File

@ -1,17 +1,16 @@
<!DOCTYPE html>
<!--
Author: Frédérik Benoist
Product Name: HDPos
Product Name: HDwPos
Product Version: 1.0.0
Contact: frederik.benoist@inetum.com
-->
<html lang="fr">
<!--begin::Head-->
<head>
<title>HDPos - HelpDesk POS - XSTORE</title>
<title>HDwPos - HelpDesk Web POS - XSTORE</title>
<meta charset="utf-8" />
<meta name="description" content="HDPos - HelpDesk POS - XSTORE" />
<meta name="description" content="HDwPos - HelpDesk Web POS - XSTORE" />
<meta name="keywords" content="helpdesk, XSTORE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:locale" content="fr_FR" />
@ -57,7 +56,7 @@ Contact: frederik.benoist@inetum.com
<!--end::Header mobile toggle-->
<!--begin::Logo-->
<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0 me-lg-15">
<a href="index.html">
<a href="dashboard.html">
<img alt="Logo" src="assets/media/logos/demo30-small.svg" class="h-25px d-lg-none" />
<img alt="Logo" src="assets/media/logos/demo30.svg" class="h-25px d-none d-lg-inline app-sidebar-logo-default theme-light-show" />
<img alt="Logo" src="assets/media/logos/demo30-dark.png" class="h-25px d-none d-lg-inline app-sidebar-logo-default theme-dark-show" />
@ -180,7 +179,7 @@ Contact: frederik.benoist@inetum.com
<ul class="breadcrumb breadcrumb-separatorless fw-semibold">
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">
<a href="index.html" class="text-white text-hover-primary">
<a href="dashboard.html" class="text-white text-hover-primary">
<i class="ki-outline ki-home text-white fs-3"></i>
</a>
</li>
@ -191,7 +190,7 @@ Contact: frederik.benoist@inetum.com
</li>
<!--end::Item-->
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">Dashboards</li>
<li class="breadcrumb-item text-white fw-bold lh-1">Dashboard</li>
<!--end::Item-->
</ul>
<!--end::Breadcrumb-->
@ -233,7 +232,7 @@ Contact: frederik.benoist@inetum.com
<div class="app-content-menu menu menu-rounded menu-gray-800 menu-state-bg flex-wrap fs-5 fw-semibold border-bottom mt-n7 pt-5 pb-6 px-10 mb-10">
<!--begin::Menu item-->
<div class="menu-item pe-2">
<a class="menu-link px-5 active" href="index.html">
<a class="menu-link px-5 active" href="dashboard.html">
<span class="menu-title text-gray-800">Général</span>
</a>
</div>
@ -269,7 +268,7 @@ Contact: frederik.benoist@inetum.com
</div>
<!--end::Heading-->
<!--begin::Description-->
<span class="fs-6 fw-semibold text-gray-500">Nombre de tickets</span>
<span class="fs-6 fw-semibold text-gray-500">Nombre de transactions</span>
<!--end::Description-->
</div>
<!--end::Statistics-->

View File

@ -56,7 +56,7 @@ Contact: frederik.benoist@inetum.com
<!--end::Header mobile toggle-->
<!--begin::Logo-->
<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0 me-lg-15">
<a href="index.html">
<a href="dashboard.html">
<img alt="Logo" src="assets/media/logos/demo30-small.svg" class="h-25px d-lg-none" />
<img alt="Logo" src="assets/media/logos/demo30.svg" class="h-25px d-none d-lg-inline app-sidebar-logo-default theme-light-show" />
<img alt="Logo" src="assets/media/logos/demo30-dark.png" class="h-25px d-none d-lg-inline app-sidebar-logo-default theme-dark-show" />
@ -179,18 +179,18 @@ Contact: frederik.benoist@inetum.com
<ul class="breadcrumb breadcrumb-separatorless fw-semibold">
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">
<a href="index.html" class="text-white text-hover-primary">
<i class="ki-outline ki-home text-white fs-3"></i>
<a href="dashboard.html" class="text-white text-hover-primary">
<i class="ki-outline ki-home text-white fs-6"></i>
</a>
</li>
<!--end::Item-->
<!--begin::Item-->
<li class="breadcrumb-item">
<i class="ki-outline ki-right fs-4 text-white mx-n1"></i>
<i class="ki-outline ki-right fs-7 text-white mx-n1"></i>
</li>
<!--end::Item-->
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">Dashboards</li>
<li class="breadcrumb-item text-white fw-bold lh-1">Store</li>
<!--end::Item-->
</ul>
<!--end::Breadcrumb-->

View File

@ -64,7 +64,7 @@ var KTUsersList = function () {
{ data: "nom", name: "nom",
fnCreatedCell: function (nTd, sData, oData, iRow, iCol) {
if(oData.nom) {
$(nTd).html("<a href='store/view/view-store.html?id_structure=" +oData.id_structure+"'>"+oData.nom+"</a>");
$(nTd).html("<a href='store/view/view-store.html?storeId=" + oData.id_structure + "&ip=" + oData.ip +"'>"+oData.nom+"</a>");
}
}
},

4476
store/view/sauvegarde.html Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
Author: Frédérik Benoist
Product Name: HDPos
Product Name: HDwPos
Product Version: 1.0.0
Contact: frederik.benoist@inetum.com
-->
@ -9,9 +9,9 @@ Contact: frederik.benoist@inetum.com
<!--begin::Head-->
<head>
<base href="../../" />
<title>HDPos - HelpDesk POS - XSTORE</title>
<title>HDwPos - HelpDesk Web POS - XSTORE</title>
<meta charset="utf-8" />
<meta name="description" content="HDPos - HelpDesk POS - XSTORE" />
<meta name="description" content="HDwPos - HelpDesk Web POS - XSTORE" />
<meta name="keywords" content="helpdesk, XSTORE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:locale" content="fr_FR" />
@ -56,7 +56,7 @@ Contact: frederik.benoist@inetum.com
<!--end::Header mobile toggle-->
<!--begin::Logo-->
<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0 me-lg-15">
<a href="index.html">
<a href="dashboard.html">
<img alt="Logo" src="assets/media/logos/demo30-small.svg" class="h-25px d-lg-none" />
<img alt="Logo" src="assets/media/logos/demo30.svg" class="h-25px d-none d-lg-inline app-sidebar-logo-default theme-light-show" />
<img alt="Logo" src="assets/media/logos/demo30-dark.png" class="h-25px d-none d-lg-inline app-sidebar-logo-default theme-dark-show" />
@ -179,7 +179,7 @@ Contact: frederik.benoist@inetum.com
<ul class="breadcrumb breadcrumb-separatorless fw-semibold">
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">
<a href="index.html" class="text-white text-hover-primary">
<a href="dashboard.html" class="text-white text-hover-primary">
<i class="ki-outline ki-home text-white fs-3"></i>
</a>
</li>
@ -190,7 +190,17 @@ Contact: frederik.benoist@inetum.com
</li>
<!--end::Item-->
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">Dashboards</li>
<li class="breadcrumb-item text-white fw-bold lh-1">
<a href="store/list/list.html" class="text-white text-hover-primary">Store</a>
</li>
<!--end::Item-->
<!--begin::Item-->
<li class="breadcrumb-item">
<i class="ki-outline ki-right fs-7 text-white mx-n1"></i>
</li>
<!--end::Item-->
<!--begin::Item-->
<li class="breadcrumb-item text-white fw-bold lh-1">View Store</li>
<!--end::Item-->
</ul>
<!--end::Breadcrumb-->
@ -228,8 +238,8 @@ Contact: frederik.benoist@inetum.com
<div class="d-flex flex-column flex-column-fluid">
<!--begin::Content-->
<div id="kt_app_content" class="app-content">
<!--begin::Form-->
<form id="kt_ecommerce_add_product_form" class="form d-flex flex-column flex-lg-row" data-kt-redirect="apps/ecommerce/catalog/products.html">
<!--begin::Tabs-->
<div class="form d-flex flex-column flex-lg-row">
<!--begin::Aside column-->
<div class="d-flex flex-column gap-7 gap-lg-10 w-100 w-lg-300px mb-7 me-lg-10">
<!--begin::Thumbnail settings-->
@ -238,7 +248,7 @@ Contact: frederik.benoist@inetum.com
<div class="card-header">
<!--begin::Card title-->
<div class="card-title">
<h2>Thumbnail</h2>
<h2 id="hb_storeTitle">...</h2>
</div>
<!--end::Card title-->
</div>
@ -248,159 +258,113 @@ Contact: frederik.benoist@inetum.com
<!--begin::Image input-->
<div class="image-input image-input-empty image-input-outline image-input-placeholder mb-3" data-kt-image-input="true">
<!--begin::Preview existing avatar-->
<div class="image-input-wrapper w-150px h-150px" style="background-image: url(assets/media//stock/ecommerce/78.png)"></div>
<div class="image-input-wrapper w-150px h-150px" style="background-image: url('https://mp4.ikksgroup.com/photos/1/6/5/7/3/16573-large.JPG')"></div>
<!--end::Preview existing avatar-->
<!--begin::Label-->
<label class="btn btn-icon btn-circle btn-active-color-primary w-25px h-25px bg-body shadow" data-kt-image-input-action="change" data-bs-toggle="tooltip" title="Change avatar">
<i class="ki-outline ki-pencil fs-7"></i>
<!--begin::Inputs-->
<input type="file" name="avatar" accept=".png, .jpg, .jpeg" />
<input type="hidden" name="avatar_remove" />
<!--end::Inputs-->
</label>
<!--end::Label-->
<!--begin::Cancel-->
<span class="btn btn-icon btn-circle btn-active-color-primary w-25px h-25px bg-body shadow" data-kt-image-input-action="cancel" data-bs-toggle="tooltip" title="Cancel avatar">
<i class="ki-outline ki-cross fs-2"></i>
</span>
<!--end::Cancel-->
<!--begin::Remove-->
<span class="btn btn-icon btn-circle btn-active-color-primary w-25px h-25px bg-body shadow" data-kt-image-input-action="remove" data-bs-toggle="tooltip" title="Remove avatar">
<i class="ki-outline ki-cross fs-2"></i>
</span>
<!--end::Remove-->
</div>
<!--end::Image input-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the product thumbnail image. Only *.png, *.jpg and *.jpeg image files are accepted</div>
<!--end::Description-->
</div>
<!--end::Card body-->
<!--begin::Card body-->
<div class="card-body pt-0">
<!--begin::Label-->
<label class="form-label">IP Address</label>
<!--end::Label-->
<!--begin::Display-->
<div id="hb_storeIpAddress" class="form-control mb-2">--</div>
<!--end::Display-->
<!--begin::Label-->
<label class="form-label">Phone Number</label>
<!--end::Label-->
<!--begin::Display-->
<div id="hb_storePhoneNumber" class="form-control mb-2">--</div>
<!--end::Display-->
</div>
<!--end::Card body-->
</div>
<!--end::Thumbnail settings-->
<!--begin::Status-->
<!--begin::Back_office stats-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<!--begin::Card title-->
<div class="card-title">
<h2>Status</h2>
<h2>Tickets DOTSOFT</h2>
</div>
<!--end::Card title-->
<!--begin::Card toolbar-->
<div class="card-toolbar">
<div class="rounded-circle bg-success w-15px h-15px" id="kt_ecommerce_add_product_status"></div>
<div class="rounded-circle w-15px h-15px" id="hb_backOfficeTransactionOk"></div>
</div>
<!--begin::Card toolbar-->
</div>
<!--end::Card header-->
<!--begin::Card body-->
<div class="card-body pt-0">
<!--begin::Select2-->
<select class="form-select mb-2" data-control="select2" data-hide-search="true" data-placeholder="Select an option" id="kt_ecommerce_add_product_status_select">
<option></option>
<option value="published" selected="selected">Published</option>
<option value="draft">Draft</option>
<option value="scheduled">Scheduled</option>
<option value="inactive">Inactive</option>
</select>
<!--end::Select2-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the product status.</div>
<!--end::Description-->
<!--begin::Datepicker-->
<div class="d-none mt-10">
<label for="kt_ecommerce_add_product_status_datepicker" class="form-label">Select publishing date and time</label>
<input class="form-control" id="kt_ecommerce_add_product_status_datepicker" placeholder="Pick date & time" />
<!-- Display number of transactions -->
<div id="hb_backOfficeTransactions" class="fs-2hx fw-bold">0</div>
<div class="fs-4 fw-semibold text-gray-500 mb-7">Transactions</div>
<!--begin::Min replication date-->
<div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-7 mb-3">
<div id="hb_minBackOfficeTransactionDate" class="fs-6 text-gray-800 fw-bold"></div>
<div class="fw-semibold text-gray-500">Min Date</div>
</div>
<!--end::Datepicker-->
<!--end::Min replication date-->
<!--begin::Max replication date-->
<div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-7 mb-3">
<div id="hb_maxBackOfficeTransactionDate" class="fs-6 text-gray-800 fw-bold"></div>
<div class="fw-semibold text-gray-500">Max Date</div>
</div>
<!--end::Max replication date-->
<!--begin::Business date-->
<div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-7 mb-3">
<div id="hb_backOfficeBusinessDate" class="fs-6 fw-bold"></div>
<div class="fw-semibold text-gray-500">Business Date</div>
</div>
<!--end::Business date-->
</div>
<!--end::Card body-->
</div>
<!--end::Status-->
<!--begin::Category & tags-->
<!--end::Back_office stats-->
<!--begin::Replication Status-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<!--begin::Card title-->
<div class="card-title">
<h2>Product Details</h2>
<h2>Replication Status</h2>
</div>
<!--end::Card title-->
<!--begin::Card toolbar-->
<div class="card-toolbar">
<div class="rounded-circle w-15px h-15px" id="hb_pendingReplicationOk"></div>
</div>
<!--end::Card toolbar-->
</div>
<!--end::Card header-->
<!--begin::Card body-->
<div class="card-body pt-0">
<!--begin::Input group-->
<!--begin::Label-->
<label class="form-label">Categories</label>
<!--end::Label-->
<!--begin::Select2-->
<select class="form-select mb-2" data-control="select2" data-placeholder="Select an option" data-allow-clear="true" multiple="multiple">
<option></option>
<option value="Computers">Computers</option>
<option value="Watches">Watches</option>
<option value="Headphones">Headphones</option>
<option value="Footwear">Footwear</option>
<option value="Cameras">Cameras</option>
<option value="Shirts">Shirts</option>
<option value="Household">Household</option>
<option value="Handbags">Handbags</option>
<option value="Wines">Wines</option>
<option value="Sandals">Sandals</option>
</select>
<!--end::Select2-->
<!--begin::Description-->
<div class="text-muted fs-7 mb-7">Add product to a category.</div>
<!--end::Description-->
<!--end::Input group-->
<!--begin::Button-->
<a href="apps/ecommerce/catalog/add-category.html" class="btn btn-light-primary btn-sm mb-10">
<i class="ki-outline ki-plus fs-2"></i>Create new category</a>
<!--end::Button-->
<!--begin::Input group-->
<!--begin::Label-->
<label class="form-label d-block">Tags</label>
<!--end::Label-->
<!--begin::Input-->
<input id="kt_ecommerce_add_product_tags" name="kt_ecommerce_add_product_tags" class="form-control mb-2" value="new, trending, sale" />
<!--end::Input-->
<!--begin::Description-->
<div class="text-muted fs-7">Add tags to a product.</div>
<!--end::Description-->
<!--end::Input group-->
<!-- Display number of replications -->
<div id="hb_pendingReplications" class="fs-2hx fw-bold">0</div>
<div class="fs-4 fw-semibold text-gray-500 mb-7">Pending transactions</div>
<!--begin::Min replication date-->
<div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-7 mb-3">
<div id="hb_minPendingReplicationDate" class="fs-6 text-gray-800 fw-bold"></div>
<div class="fw-semibold text-gray-500">Min Date</div>
</div>
<!--end::Min replication date-->
<!--begin::Max replication date-->
<div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-7 mb-3">
<div id="hb_maxPendingReplicationDate" class="fs-6 text-gray-800 fw-bold"></div>
<div class="fw-semibold text-gray-500">Max Date</div>
</div>
<!--end::Max replication date-->
</div>
<!--end::Card body-->
</div>
<!--end::Category & tags-->
<!--<!--end::Replication Status-->
<!--begin::Card widget 6-->
<div class="card card-flush">
<!--begin::Header-->
<div class="card-header pt-5">
<!--begin::Title-->
<div class="card-title d-flex flex-column">
<!--begin::Info-->
<div class="d-flex align-items-center">
<!--begin::Currency-->
<span class="fs-4 fw-semibold text-gray-500 me-1 align-self-start">$</span>
<!--end::Currency-->
<!--begin::Amount-->
<span class="fs-2hx fw-bold text-gray-900 me-2 lh-1 ls-n2">2,420</span>
<!--end::Amount-->
<!--begin::Badge-->
<span class="badge badge-light-success fs-base">
<i class="ki-outline ki-arrow-up fs-5 text-success ms-n1"></i>2.6%</span>
<!--end::Badge-->
</div>
<!--end::Info-->
<!--begin::Subtitle-->
<span class="text-gray-500 pt-1 fw-semibold fs-6">Average Daily Sales</span>
<!--end::Subtitle-->
</div>
<!--end::Title-->
</div>
<!--end::Header-->
<!--begin::Card body-->
<!--begin::Card body DELETE-->
<div class="card-body d-flex align-items-end px-0 pb-0">
<!--begin::Chart-->
<div id="kt_card_widget_6_chart" class="w-100" style="height: 80px"></div>
@ -409,38 +373,7 @@ Contact: frederik.benoist@inetum.com
<!--end::Card body-->
</div>
<!--end::Card widget 6-->
<!--begin::Template settings-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<!--begin::Card title-->
<div class="card-title">
<h2>Product Template</h2>
</div>
<!--end::Card title-->
</div>
<!--end::Card header-->
<!--begin::Card body-->
<div class="card-body pt-0">
<!--begin::Select store template-->
<label for="kt_ecommerce_add_product_store_template" class="form-label">Select a product template</label>
<!--end::Select store template-->
<!--begin::Select2-->
<select class="form-select mb-2" data-control="select2" data-hide-search="true" data-placeholder="Select an option" id="kt_ecommerce_add_product_store_template">
<option></option>
<option value="default" selected="selected">Default template</option>
<option value="electronics">Electronics</option>
<option value="office">Office stationary</option>
<option value="fashion">Fashion</option>
</select>
<!--end::Select2-->
<!--begin::Description-->
<div class="text-muted fs-7">Assign a template from your current theme to define how a single product is displayed.</div>
<!--end::Description-->
</div>
<!--end::Card body-->
</div>
<!--end::Template settings-->
</div>
<!--end::Aside column-->
<!--begin::Main column-->
@ -449,7 +382,7 @@ Contact: frederik.benoist@inetum.com
<ul class="nav nav-custom nav-tabs nav-line-tabs nav-line-tabs-2x border-0 fs-4 fw-semibold mb-n2">
<!--begin:::Tab item-->
<li class="nav-item">
<a class="nav-link text-active-primary pb-4 active" data-bs-toggle="tab" href="#kt_ecommerce_add_product_general">General</a>
<a class="nav-link text-active-primary pb-4 active" data-bs-toggle="tab" href="#kt_store_item">Item</a>
</li>
<!--end:::Tab item-->
<!--begin:::Tab item-->
@ -467,14 +400,16 @@ Contact: frederik.benoist@inetum.com
<!--begin::Tab content-->
<div class="tab-content">
<!--begin::Tab pane-->
<div class="tab-pane fade show active" id="kt_ecommerce_add_product_general" role="tab-panel">
<div class="tab-pane fade show active" id="kt_store_item" role="tab-panel">
<div class="d-flex flex-column gap-7 gap-lg-10">
<!--begin::General options-->
<form id="kt_store_item_form" class="form d-flex flex-column flex-lg-row">
<!--begin::General options-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<div class="card-title">
<h2>General</h2>
<h2>Search Item</h2>
</div>
</div>
<!--end::Card header-->
@ -483,234 +418,117 @@ Contact: frederik.benoist@inetum.com
<!--begin::Input group-->
<div class="mb-10 fv-row">
<!--begin::Label-->
<label class="required form-label">Product Name</label>
<label class="required form-label">Item</label>
<!--end::Label-->
<!--begin::Input-->
<input type="text" name="product_name" class="form-control mb-2" placeholder="Product name" value="Sample product" />
<input type="text" name="itemId" class="form-control mb-2" placeholder="Item ID" value="BX44145" />
<!--end::Input-->
<!--begin::Description-->
<div class="text-muted fs-7">A product name is required and recommended to be unique.</div>
<!--end::Description-->
</div>
<!--end::Input group-->
<!--begin::Input group-->
<div>
<!--begin::Label-->
<label class="form-label">Description</label>
<!--end::Label-->
<!--begin::Editor-->
<div id="kt_ecommerce_add_product_description" name="kt_ecommerce_add_product_description" class="min-h-200px mb-2"></div>
<!--end::Editor-->
<!--begin::Description-->
<div class="text-muted fs-7">Set a description to the product for better visibility.</div>
<!--end::Description-->
</div>
<!--end::Input group-->
<!--begin::Button-->
<button type="submit" id="kt_store_item_submit" class="btn btn-primary">
<span class="indicator-label">Search item</span>
<span class="indicator-progress">Please wait...
<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
</button>
<!--end::Button-->
</div>
<!--end::Card header-->
</div>
<!--end::General options-->
<!--begin::Media-->
</form>
<!--begin::Table ITEM-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<div class="card-title">
<h2>Media</h2>
<h2>Table ITM_ITEM</h2>
</div>
</div>
<!--end::Card header-->
<!--begin::Card body-->
<div class="card-body pt-0">
<!--begin::Input group-->
<div class="fv-row mb-2">
<!--begin::Dropzone-->
<div class="dropzone" id="kt_ecommerce_add_product_media">
<!--begin::Message-->
<div class="dz-message needsclick">
<!--begin::Icon-->
<i class="ki-outline ki-file-up text-primary fs-3x"></i>
<!--end::Icon-->
<!--begin::Info-->
<div class="ms-4">
<h3 class="fs-5 fw-bold text-gray-900 mb-1">Drop files here or click to upload.</h3>
<span class="fs-7 fw-semibold text-gray-500">Upload up to 10 files</span>
<div class="card-body py-4">
<!--begin::Table-->
<table class="table table-striped border rounded gy-5 gs-7" id="kt_table_item">
<thead>
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
<th>ITEM_ID</th>
<th>LEVEL</th>
<th>PARENT</th>
<th>TYPE</th>
<th>CREATE</th>
<th>UPDATE</th>
</tr>
</thead>
</table>
<!--end::Table-->
</div>
<!--end::Info-->
<!--end::Card body-->
</div>
</div>
<!--end::Dropzone-->
</div>
<!--end::Input group-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the product media gallery.</div>
<!--end::Description-->
</div>
<!--end::Card header-->
</div>
<!--end::Media-->
<!--begin::Pricing-->
<!--end::Table ITEM-->
<!--begin::Table ITEM_OPTION-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<div class="card-title">
<h2>Pricing</h2>
<h2>Table ITM_ITEM_OPTIONS</h2>
</div>
</div>
<!--end::Card header-->
<!--begin::Card body-->
<div class="card-body pt-0">
<!--begin::Input group-->
<div class="mb-10 fv-row">
<!--begin::Label-->
<label class="required form-label">Base Price</label>
<!--end::Label-->
<!--begin::Input-->
<input type="text" name="price" class="form-control mb-2" placeholder="Product price" value="199.99" />
<!--end::Input-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the product price.</div>
<!--end::Description-->
<div class="card-body py-4">
<!--begin::Table-->
<table class="table table-striped border rounded gy-5 gs-7" id="kt_table_item_options">
<thead>
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
<th>ITEM_ID</th>
<th>LEVEL</th>
<th>VENDABLE</th>
<th>TAXE</th>
<th>VENDOR</th>
<th>SEASON</th>
<th>CREATE</th>
<th>UPDATE</th>
</tr>
</thead>
</table>
<!--end::Table-->
</div>
<!--end::Input group-->
<!--begin::Input group-->
<div class="fv-row mb-10">
<!--begin::Label-->
<label class="fs-6 fw-semibold mb-2">Discount Type
<span class="ms-1" data-bs-toggle="tooltip" title="Select a discount type that will be applied to this product">
<i class="ki-outline ki-information-5 text-gray-500 fs-6"></i>
</span></label>
<!--End::Label-->
<!--begin::Row-->
<div class="row row-cols-1 row-cols-md-3 row-cols-lg-1 row-cols-xl-3 g-9" data-kt-buttons="true" data-kt-buttons-target="[data-kt-button='true']">
<!--begin::Col-->
<div class="col">
<!--begin::Option-->
<label class="btn btn-outline btn-outline-dashed btn-active-light-primary d-flex text-start p-6" data-kt-button="true">
<!--begin::Radio-->
<span class="form-check form-check-custom form-check-solid form-check-sm align-items-start mt-1">
<input class="form-check-input" type="radio" name="discount_option" value="1" />
</span>
<!--end::Radio-->
<!--begin::Info-->
<span class="ms-5">
<span class="fs-4 fw-bold text-gray-800 d-block">No Discount</span>
</span>
<!--end::Info-->
</label>
<!--end::Option-->
<!--end::Card body-->
</div>
<!--end::Col-->
<!--begin::Col-->
<div class="col">
<!--begin::Option-->
<label class="btn btn-outline btn-outline-dashed btn-active-light-primary active d-flex text-start p-6" data-kt-button="true">
<!--begin::Radio-->
<span class="form-check form-check-custom form-check-solid form-check-sm align-items-start mt-1">
<input class="form-check-input" type="radio" name="discount_option" value="2" checked="checked" />
</span>
<!--end::Radio-->
<!--begin::Info-->
<span class="ms-5">
<span class="fs-4 fw-bold text-gray-800 d-block">Percentage %</span>
</span>
<!--end::Info-->
</label>
<!--end::Option-->
<!--end::Table ITEM_OPTION-->
<!--begin::Table ITEM_PRICES-->
<div class="card card-flush py-4">
<!--begin::Card header-->
<div class="card-header">
<div class="card-title">
<h2>ITM_ITEM_PRICES</h2>
</div>
<!--end::Col-->
<!--begin::Col-->
<div class="col">
<!--begin::Option-->
<label class="btn btn-outline btn-outline-dashed btn-active-light-primary d-flex text-start p-6" data-kt-button="true">
<!--begin::Radio-->
<span class="form-check form-check-custom form-check-solid form-check-sm align-items-start mt-1">
<input class="form-check-input" type="radio" name="discount_option" value="3" />
</span>
<!--end::Radio-->
<!--begin::Info-->
<span class="ms-5">
<span class="fs-4 fw-bold text-gray-800 d-block">Fixed Price</span>
</span>
<!--end::Info-->
</label>
<!--end::Option-->
</div>
<!--end::Col-->
</div>
<!--end::Row-->
</div>
<!--end::Input group-->
<!--begin::Input group-->
<div class="mb-10 fv-row" id="kt_ecommerce_add_product_discount_percentage">
<!--begin::Label-->
<label class="form-label">Set Discount Percentage</label>
<!--end::Label-->
<!--begin::Slider-->
<div class="d-flex flex-column text-center mb-5">
<div class="d-flex align-items-start justify-content-center mb-7">
<span class="fw-bold fs-3x" id="kt_ecommerce_add_product_discount_label">0</span>
<span class="fw-bold fs-4 mt-1 ms-2">%</span>
</div>
<div id="kt_ecommerce_add_product_discount_slider" class="noUi-sm"></div>
</div>
<!--end::Slider-->
<!--begin::Description-->
<div class="text-muted fs-7">Set a percentage discount to be applied on this product.</div>
<!--end::Description-->
</div>
<!--end::Input group-->
<!--begin::Input group-->
<div class="d-none mb-10 fv-row" id="kt_ecommerce_add_product_discount_fixed">
<!--begin::Label-->
<label class="form-label">Fixed Discounted Price</label>
<!--end::Label-->
<!--begin::Input-->
<input type="text" name="dicsounted_price" class="form-control mb-2" placeholder="Discounted price" />
<!--end::Input-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the discounted product price. The product will be reduced at the determined fixed price</div>
<!--end::Description-->
</div>
<!--end::Input group-->
<!--begin::Tax-->
<div class="d-flex flex-wrap gap-5">
<!--begin::Input group-->
<div class="fv-row w-100 flex-md-root">
<!--begin::Label-->
<label class="required form-label">Tax Class</label>
<!--end::Label-->
<!--begin::Select2-->
<select class="form-select mb-2" name="tax" data-control="select2" data-hide-search="true" data-placeholder="Select an option">
<option></option>
<option value="0">Tax Free</option>
<option value="1" selected="selected">Taxable Goods</option>
<option value="2">Downloadable Product</option>
</select>
<!--end::Select2-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the product tax class.</div>
<!--end::Description-->
</div>
<!--end::Input group-->
<!--begin::Input group-->
<div class="fv-row w-100 flex-md-root">
<!--begin::Label-->
<label class="form-label">VAT Amount (%)</label>
<!--end::Label-->
<!--begin::Input-->
<input type="text" class="form-control mb-2" value="35" />
<!--end::Input-->
<!--begin::Description-->
<div class="text-muted fs-7">Set the product VAT about.</div>
<!--end::Description-->
</div>
<!--end::Input group-->
</div>
<!--end:Tax-->
</div>
<!--end::Card header-->
<!--begin::Card body-->
<div class="card-body py-4">
<!--begin::Table-->
<table class="table table-striped border rounded gy-5 gs-7" id="kt_table_item_prices">
<thead>
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
<th>ITEM_ID</th>
<th>LEVEL</th>
<th>TYPE</th>
<th>DATES</th>
<th>PRICE</th>
<th data-priority="2">EXTERNAL_ID</th>
<th>CREATE</th>
<th>UPDATE</th>
</tr>
</thead>
</table>
<!--end::Table-->
</div>
<!--end::Pricing-->
<!--end::Card body-->
</div>
<!--end::Table ITEM_PRICES-->
</div>
</div>
<!--end::Tab pane-->
@ -1647,21 +1465,9 @@ Contact: frederik.benoist@inetum.com
<!--end::Tab pane-->
</div>
<!--end::Tab content-->
<div class="d-flex justify-content-end">
<!--begin::Button-->
<a href="apps/ecommerce/catalog/products.html" id="kt_ecommerce_add_product_cancel" class="btn btn-light me-5">Cancel</a>
<!--end::Button-->
<!--begin::Button-->
<button type="submit" id="kt_ecommerce_add_product_submit" class="btn btn-primary">
<span class="indicator-label">Save Changes</span>
<span class="indicator-progress">Please wait...
<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
</button>
<!--end::Button-->
</div>
</div>
<!--end::Main column-->
</form>
</div>
<!--end::Form-->
</div>
<!--end::Content-->
@ -1672,19 +1478,13 @@ Contact: frederik.benoist@inetum.com
<!--begin::Copyright-->
<div class="text-gray-900 order-2 order-md-1">
<span class="text-muted fw-semibold me-1">2023&copy;</span>
<a href="https://keenthemes.com" target="_blank" class="text-gray-800 text-hover-primary">Keenthemes</a>
<a href="https://www.inetum.com/fr" target="_blank" class="text-gray-800 text-hover-primary">Inetum</a>
</div>
<!--end::Copyright-->
<!--begin::Menu-->
<ul class="menu menu-gray-600 menu-hover-primary fw-semibold order-1">
<li class="menu-item">
<a href="https://keenthemes.com" target="_blank" class="menu-link px-2">About</a>
</li>
<li class="menu-item">
<a href="https://devs.keenthemes.com" target="_blank" class="menu-link px-2">Support</a>
</li>
<li class="menu-item">
<a href="https://1.envato.market/EA4JP" target="_blank" class="menu-link px-2">Purchase</a>
<a href="https://www.inetum.com/fr" target="_blank" class="menu-link px-2">A propos</a>
</li>
</ul>
<!--end::Menu-->
@ -4644,7 +4444,7 @@ Contact: frederik.benoist@inetum.com
<script src="assets/plugins/custom/formrepeater/formrepeater.bundle.js"></script>
<!--end::Vendors Javascript-->
<!--begin::Custom Javascript(used for this page only)-->
<script src="assets/js/custom/apps/ecommerce/catalog/save-product.js"></script>
<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
<script src="assets/js/widgets.bundle.js"></script>
<script src="assets/js/custom/widgets.js"></script>
<script src="store/view/view-store.js"></script>

View File

@ -3,21 +3,240 @@
// Class definition
var KTStoreView = function () {
// Shared variables
var id_structure
var storeId
var ipAddress
var datatableItem;
var tableItem = document.getElementById('kt_table_item');
var datatableItemOption
var tableItemOptions = document.getElementById('kt_table_item_options');
var datatableItemPrices;
var tableItemPrices = document.getElementById('kt_table_item_prices');
// Init store view page
var initStoreView = () => {
console.log("ID"+id_structure);
// call StoreDetails API
fetch('http://localhost:8080/hdpos/api/stores/getStoreDetails?dbHost='+ipAddress+'&storeId='+storeId)
.then(response => response.json())
.then(data => {
document.getElementById("hb_storeTitle").innerText = data.store.id_structure + " - " + data.store.nom;
document.getElementById("hb_storeIpAddress").innerText = ipAddress;
document.getElementById("hb_storePhoneNumber").innerText = data.store.telephone;
// Display backOffice transaction informations
var statusTransaction = document.getElementById("hb_backOfficeTransactionOk");
if (data.replication.backOfficeTransactionOk) {
statusTransaction.classList.add("bg-success");
document.getElementById("hb_backOfficeBusinessDate").classList.add("text-gray-800");
} else {
statusTransaction.classList.add("bg-danger");
document.getElementById("hb_backOfficeBusinessDate").classList.add("text-danger");
}
document.getElementById("hb_backOfficeTransactions").innerText = data.transaction.backOfficeTransactions;
document.getElementById("hb_minBackOfficeTransactionDate").innerText = data.transaction.minBackOfficeTransactionDate;
document.getElementById("hb_maxBackOfficeTransactionDate").innerText = data.transaction.maxBackOfficeTransactionDate;
document.getElementById("hb_backOfficeBusinessDate").innerText = data.transaction.backOfficeBusinessDate;
// Display replication informations
var statusTransaction = document.getElementById("hb_pendingReplicationOk");
if (data.replication.pendingReplicationOk) {
statusTransaction.classList.add("bg-success");
} else {
statusTransaction.classList.add("bg-danger");
}
document.getElementById("hb_pendingReplications").innerText = data.replication.pendingReplications;
document.getElementById("hb_minPendingReplicationDate").innerText = data.replication.minPendingReplicationDate;
document.getElementById("hb_maxPendingReplicationDate").innerText = data.replication.maxPendingReplicationDate;
})
.catch(error => {
console.error('Error retrieving store details:', error);
});
}
// Submit form handler
const handleItemSubmit = () => {
// Define variables
let validator;
// Get elements
const form = document.getElementById('kt_store_item_form');
const submitButton = document.getElementById('kt_store_item_submit');
// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
validator = FormValidation.formValidation(
form,
{
fields: {
'itemId': {
validators: {
notEmpty: {
message: 'Item ID is required'
}
}
}
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap5({
rowSelector: '.fv-row',
eleInvalidClass: '',
eleValidClass: ''
})
}
}
);
// Handle submit item search button
submitButton.addEventListener('click', e => {
e.preventDefault();
// Validate form before submit
if (validator) {
validator.validate().then(function (status) {
if (status == 'Valid') {
submitButton.setAttribute('data-kt-indicator', 'on');
// Disable submit button while loading
submitButton.disabled = true;
var itemId = document.querySelector('input[name="itemId"]').value;
// call StoreDetails API
fetch('http://localhost:8080/hdpos/api/items/getItemDetails?dbHost='+ipAddress+'&itemId='+itemId)
.then(response => response.json())
.then(data => {
if ( $.fn.dataTable.isDataTable('#kt_table_item') ) {
$('#kt_table_item').DataTable().destroy();
}
datatableItem = $(tableItem).DataTable({
"info": true,
"bStateSave": true, // cookie
'order': [],
"pageLength": 10,
"lengthChange": false,
columns: [
{ data: 'itemId', name: "ITEM_ID" },
{ data: 'itemLevelCode', name: "LEVEL" },
{ data: 'parentItemId', name: "PARENT" },
{ data: 'itemTypeCode', name: "TYPE" },
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.createDate + '<br>' + full.createUserId;
}
},
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.updateDate + '<br>' + full.updateUserId;
}
}
],
"data": data.items
});
if ( $.fn.dataTable.isDataTable('#kt_table_item_options') ) {
$('#kt_table_item_options').DataTable().destroy();
}
datatableItemOption = $(tableItemOptions).DataTable({
"info": true,
"bStateSave": true, // cookie
'order': [],
"pageLength": 10,
"lengthChange": false,
columns: [
{ data: 'itemId', name: "ITEM_ID" },
{ data: null,
render: function(data, type, full, meta) {
return full.levelCode + ':' + full.levelValue;
}
},
{ data: 'itemAvailabilityCode', name: "VENDABLE" },
{ data: 'taxGroupId', name: "TAXE" },
{ data: 'vendor', name: "VENDOR" },
{ data: 'seasonCode', name: "SEASON" },
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.createDate + '<br>' + full.createUserId;
}
},
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.updateDate + '<br>' + full.updateUserId;
}
}
],
"data": data.itemOptions
});
if ( $.fn.dataTable.isDataTable('#kt_table_item_prices') ) {
$('#kt_table_item_prices').DataTable().destroy();
}
datatableItemPrices = $(tableItemPrices).DataTable({
"info": true,
"bStateSave": true, // cookie
'order': [],
"pageLength": 10,
"lengthChange": false,
responsive: true,
columns: [
{ data: 'itemId', name: "ITEM_ID" },
{ data: null,
render: function(data, type, full, meta) {
return full.levelCode + ':' + full.levelValue;
}
},
{ data: 'itmPricePropertyCode', name: "TYPE" },
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.effectiveDate + '<br>' + full.expirationDate;
}
},
{ data: 'price', name: "PRICE" },
{ data: 'externalId', name: "EXTERNAL_ID" },
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.createDate + '<br>' + full.createUserId;
}
},
{ data: null, // Using null to create a custom column
render: function(data, type, full, meta) {
return full.updateDate + '<br>' + full.updateUserId;
}
}
],
"data": data.itemPrices
});
// Enable submit button after loading
submitButton.removeAttribute('data-kt-indicator');
submitButton.disabled = false;
})
.catch(error => {
console.error('Error retrieving item details:', error);
// Enable submit button after loading
submitButton.removeAttribute('data-kt-indicator');
submitButton.disabled = false;
});
}
});
}
})
}
return {
// Public functions
init: function () {
// Elements
id_structure = KTUtil.getURLParam("id_structure");
// Parse the URL parameter
storeId = KTUtil.getURLParam("storeId");
ipAddress = KTUtil.getURLParam("ip");
// Handle forms
initStoreView();
handleItemSubmit();
}
};
}();