WIP PreorderProduct 2025-02-17

This commit is contained in:
Frank Schubert
2025-02-18 13:52:35 +01:00
parent aa7a3eb1ed
commit fdd6ed7ebb
11 changed files with 893 additions and 219 deletions

View File

@@ -1,180 +1,5 @@
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/menu.php"); ?>
<div class="container">
<h1 class="mt-5">Preorder Product Management</h1>
<h2 class="mt-4">Create Preorder</h2>
<form id="createPreorderForm" class="mb-4">
<div class="form-group">
<label for="rimo_service_id">Rimo Service ID:</label>
<input type="number" class="form-control" id="rimo_service_id" name="rimo_service_id">
</div>
<button type="submit" class="btn btn-primary">Create Preorder</button>
</form>
<h2 class="mt-4">Create Preorder Product</h2>
<form id="createPreorderProductForm" class="mb-4">
<div class="form-group">
<label for="type">Type:</label>
<select class="form-control" id="type" name="type">
<option value="enduser_setup">Enduser Setup</option>
<option value="provider_setup">Provider Setup</option>
<option value="provider_usage">Provider Usage</option>
</select>
</div>
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" name="name">
</div>
<div class="form-group">
<label for="vatgroup_id">VAT Group ID:</label>
<input type="number" class="form-control" id="vatgroup_id" name="vatgroup_id">
</div>
<div class="form-group">
<label for="price_inet">Price Inet:</label>
<input type="number" step="0.0001" class="form-control" id="price_inet" name="price_inet">
</div>
<div class="form-group">
<label for="price_inet_tv">Price Inet TV:</label>
<input type="number" step="0.0001" class="form-control" id="price_inet_tv" name="price_inet_tv">
</div>
<div class="form-group">
<label for="price_catv">Price CATV:</label>
<input type="number" step="0.0001" class="form-control" id="price_catv" name="price_catv">
</div>
<div class="form-group">
<label for="price_passive">Price Passive:</label>
<input type="number" step="0.0001" class="form-control" id="price_passive" name="price_passive">
</div>
<div class="form-group">
<label for="create_by">Created By:</label>
<input type="number" class="form-control" id="create_by" name="create_by">
</div>
<div class="form-group">
<label for="edit_by">Edited By:</label>
<input type="number" class="form-control" id="edit_by" name="edit_by">
</div>
<button type="submit" class="btn btn-primary">Create Preorder Product</button>
</form>
<h2 class="mt-4">Create Preorder Product Price</h2>
<form id="createPreorderProductPriceForm" class="mb-4">
<div class="form-group">
<label for="preorderproduct_id">Preorder Product ID:</label>
<input type="number" class="form-control" id="preorderproduct_id" name="preorderproduct_id">
</div>
<div class="form-group">
<label for="netowner_id">Netowner ID:</label>
<input type="number" class="form-control" id="netowner_id" name="netowner_id">
</div>
<div class="form-group">
<label for="preordercampaign_id">Preorder Campaign ID:</label>
<input type="number" class="form-control" id="preordercampaign_id" name="preordercampaign_id">
</div>
<div class="form-group">
<label for="description">Description:</label>
<textarea class="form-control" id="description" name="description"></textarea>
</div>
<div class="form-group">
<label for="start_date">Start Date:</label>
<input type="date" class="form-control" id="start_date" name="start_date">
</div>
<div class="form-group">
<label for="end_date">End Date:</label>
<input type="date" class="form-control" id="end_date" name="end_date">
</div>
<div class="form-group">
<label for="price_inet">Price Inet:</label>
<input type="number" step="0.0001" class="form-control" id="price_inet" name="price_inet">
</div>
<div class="form-group">
<label for="price_inet_tv">Price Inet TV:</label>
<input type="number" step="0.0001" class="form-control" id="price_inet_tv" name="price_inet_tv">
</div>
<div class="form-group">
<label for="price_catv">Price CATV:</label>
<input type="number" step="0.0001" class="form-control" id="price_catv" name="price_catv">
</div>
<div class="form-group">
<label for="price_passive">Price Passive:</label>
<input type="number" step="0.0001" class="form-control" id="price_passive" name="price_passive">
</div>
<div class="form-group">
<label for="billing_delay">Billing Delay:</label>
<input type="number" class="form-control" id="billing_delay" name="billing_delay">
</div>
<div class="form-group">
<label for="billing_period">Billing Period:</label>
<input type="number" class="form-control" id="billing_period" name="billing_period">
</div>
<div class="form-group">
<label for="contract_term">Contract Term:</label>
<input type="number" class="form-control" id="contract_term" name="contract_term">
</div>
<div class="form-group">
<label for="note">Note:</label>
<textarea class="form-control" id="note" name="note"></textarea>
</div>
<div class="form-group">
<label for="create_by">Created By:</label>
<input type="number" class="form-control" id="create_by" name="create_by">
</div>
<div class="form-group">
<label for="edit_by">Edited By:</label>
<input type="number" class="form-control" id="edit_by" name="edit_by">
</div>
<button type="submit" class="btn btn-primary">Create Preorder Product Price</button>
</form>
<h2 class="mt-4">Create Preorder Product Marketshare Discount</h2>
<form id="createPreorderProductMarketshareDiscountForm" class="mb-4">
<div class="form-group">
<label for="preorderproductprice_id">Preorder Product Price ID:</label>
<input type="number" class="form-control" id="preorderproductprice_id" name="preorderproductprice_id">
</div>
<div class="form-group">
<label for="price_15">Price 15%:</label>
<input type="number" step="0.0001" class="form-control" id="price_15" name="price_15">
</div>
<div class="form-group">
<label for="price_20">Price 20%:</label>
<input type="number" step="0.0001" class="form-control" id="price_20" name="price_20">
</div>
<div class="form-group">
<label for="price_25">Price 25%:</label>
<input type="number" step="0.0001" class="form-control" id="price_25" name="price_25">
</div>
<div class="form-group">
<label for="price_30">Price 30%:</label>
<input type="number" step="0.0001" class="form-control" id="price_30" name="price_30">
</div>
<div class="form-group">
<label for="price_35">Price 35%:</label>
<input type="number" step="0.0001" class="form-control" id="price_35" name="price_35">
</div>
<div class="form-group">
<label for="price_40">Price 40%:</label>
<input type="number" step="0.0001" class="form-control" id="price_40" name="price_40">
</div>
<div class="form-group">
<label for="price_45">Price 45%:</label>
<input type="number" step="0.0001" class="form-control" id="price_45" name="price_45">
</div>
<div class="form-group">
<label for="price_50">Price 50%:</label>
<input type="number" step="0.0001" class="form-control" id="price_50" name="price_50">
</div>
<div class="form-group">
<label for="create_by">Created By:</label>
<input type="number" class="form-control" id="create_by" name="create_by">
</div>
<div class="form-group">
<label for="edit_by">Edited By:</label>
<input type="number" class="form-control" id="edit_by" name="edit_by">
</div>
<button type="submit" class="btn btn-primary">Create Preorder Product Marketshare Discount</button>
</form>
</div>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>

View File

@@ -0,0 +1,87 @@
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("Preordercampaign")?>">Vorbestellkampagnen</a></li>
<li class="breadcrumb-item active">Bepreisung</li>
</ol>
</div>
<h4 class="page-title">Preise</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body mb-3 bg-light">
<div class="row">
<div class="col-12">
<h4 class="header-title">Preise</h4>
</div>
</div>
<div class="row">
<div class="col">
<?php foreach($netoperators as $netoperator): // TODO: Netoperators als Tabs anzeigen ?>
<h4><span class="text-pink"><?=$netoperator->getCompanyOrName()?> (<?=$netoperator->id?>)</span></h4>
<div class="card">
<div class="card-body mb-3">
<form method="post" action="<?=self::getUrl("PreorderProduct", "save")?>">
<h4>Produkte</h4>
<?php foreach($products as $product): ?>
<?php $product->setNetoperatorId($netoperator->id) ?>
<?php $prices = (array_key_exists($netoperator->id, $product->prices)) ? $product->prices[$netoperator->id] : false; ?>
<?php //var_dump($prices); ?>
<div class="card">
<div class="card-body mb-3">
<h4>Preiseinstellungen für <?=$product->name?></h4>
<?php if($product->type == "operator_setup"): ?>
<?php include(__DIR__."/include/netoperator-prices-setup.php"); ?>
<?php elseif($product->type == "enduser_setup"): ?>
<?php include(__DIR__."/include/enduser-prices-setup.php"); ?>
<?php elseif($product->type == "operatr_usage"): ?>
<?php include(__DIR__."/include/netoperator-prices-usage.php"); ?>
<?php endif; ?>
</div>
</div>
<hr />
<?php endforeach; ?>
<input type="submit" class="btn btn-primary mt-2" value="Speichern" />
</form>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$('.datepicker').datepicker({
language: 'de',
format: "dd.mm.yyyy",
showWeekDays: true,
todayBtn: 'linked',
autoclose: true
});
</script>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,82 @@
<div class="row">
<div class="col-6">
<div class="form-group">
Derzeit gültiger Preis: <strong><?=$product->current_price->price_setup?></strong>
<?php if($product->current_price->end_date): ?>
(bis <?=(new DateTime($product->current_price->end_date))->format("d.m.Y")?>)
<?php endif; ?>
<br />
Derzeit regulärer Preis: <strong><?=$product->current_regular_price->price_setup?></strong><br />
Originalpreis: <?=$product->first_price->price_setup?>
</div>
<div class="form-group">
<button type="button" class="btn btn-outline-success" onclick='$("#pricehistory-<?=$netoperator->id?>-<?=$product->id?>").toggle()'><i class="fas fa-fw fa-list"></i> Preishistory anzeigen</button>
</div>
<div class="row hidden" id="pricehistory-<?=$netoperator->id?>-<?=$product->id?>">
<table class="table table-sm table-striped table-hover">
<tr>
<th>Preis</th>
<th>Gültig von</th>
<th>Gültig bis</th>
</tr>
<?php foreach(PreorderProductPrice::search(["netowner_id" => $netowner->id,"preorderproduct_id" => $product->id, "netoperator_id" => $netoperator->id]) as $line): ?>
<tr>
<td><?=$line->price_setup?></td>
<td><?=($line->start_date) ? (new DateTime($line->start_date))->format("d.m.Y") : "-"?></td>
<td><?=($line->end_date) ? (new DateTime($line->end_date))->format("d.m.Y") : "-"?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
<h4>Neuer Preis</h4>
<div class="form-group">
<label>Bereitstellungsentgelt</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">€</span>
</div>
<input type="text" class="form-control" name="netoperators[<?=$netoperator->id?>][<?=$product->id?>][price_setup]" value="" />
</div>
</div>
<div class="form-group">
<label>Neuer Preis Gültigkeit</label>
<div class="row">
<div class="col-6">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Preis gültig von</span>
</div>
<input type="text" class="form-control datepicker" name="netoperators[<?=$netoperator->id?>][<?=$product->id?>][start_date]" value="" />
</div>
</div>
<div class="col-6">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Preis gültig bis</span>
</div>
<input type="text" class="form-control datepicker" name="netoperators[<?=$netoperator->id?>][<?=$product->id?>][end_date]" value="" />
</div>
</div>
</div>
<small>
Ohne <strong>Gültig-Bis-Datum</strong> gilt der neue Preis für immer, bis ein neuer Preis eingetragen wird.<br />
Mit <strong>Gültig-Bis-Datum</strong> gilt der neue Preis bis einschließlich dem <strong>Gültig-Bis-Datum</strong>, danach gilt der vorige Preis wieder.
</small>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
<?php