Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/admin percentage cannot be less than 0 and more than 90 #664

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/scripts/abotypen/detail/abotypendetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ <h3 class="panel-title" translate>Zusatzdaten</h3>
<div class="input-group">
<div class="input-group-addon" ng-if="getModel() === 'abotypen'" >{{projekt.waehrung}}</div>
<div class="input-group-addon" ng-if="getModel() === 'zusatzAbotypen'" >{{projekt.waehrung}}</div>
<input type="number" ng-if="getModel() === 'abotypen'" placeholder="{{'Preis'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" class="form-control" name="zielpreis" ng-model="abotyp.zielpreis"></input>
<input type="number" ng-if="getModel() === 'zusatzAbotypen'" placeholder="{{'Preis'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" class="form-control" name="zielpreis" ng-model="zusatzAbotyp.zielpreis"></input>
<input type="number" ng-if="getModel() === 'abotypen'" placeholder="{{'Preis'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" min="0" max="99999.99" class="form-control" name="zielpreis" ng-model="abotyp.zielpreis"></input>
<input type="number" ng-if="getModel() === 'zusatzAbotypen'" placeholder="{{'Preis'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" min="0" max="99999.99" class="form-control" name="zielpreis" ng-model="zusatzAbotyp.zielpreis"></input>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been the case so far, but can we imagine a Abo or Zusatzabo with a negative price? This could be the case if someone is getting a discount of some sort?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is right, that was an option until know. I do not particularly like to have this "hack" to apply some "discount" or "voucher". I would be more in favor of implementing this functionality in case someone needs it. However, this would represent an effort that I don't think we would want to make in the short term... in any case we would need to define a min to avoid errors in the database, being the biggest min -99999.99

</div>
</div>
<div class="col-md-5" style="line-height:30px">
Expand All @@ -198,8 +198,8 @@ <h3 class="panel-title" translate>Zusatzdaten</h3>
<div class="col-md-6 row">
<div class="col-md-7">
<div class="input-group">
<input type="number" ng-if="getModel() === 'abotypen'" placeholder="{{'Satz'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" class="form-control" name="adminProzente" ng-model="abotyp.adminProzente" required></input>
<input type="number" ng-if="getModel() === 'zusatzAbotypen'" placeholder="{{'Satz'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" class="form-control" name="adminProzente" ng-model="zusatzAbotyp.adminProzente" required></input>
<input type="number" ng-if="getModel() === 'abotypen'" placeholder="{{'Satz'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" min="0" max="90" class="form-control" name="adminProzente" ng-model="abotyp.adminProzente" required></input>
<input type="number" ng-if="getModel() === 'zusatzAbotypen'" placeholder="{{'Satz'|translate}}" ng-pattern="/^[0-9]+([\.,][0-9]{1,3})?$/" step="0.01" min="0" max="90" class="form-control" name="adminProzente" ng-model="zusatzAbotyp.adminProzente" required></input>
<div class="input-group-addon" translate>%</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/rechnungen/detail/rechnungendetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h3 class="panel-title"><span class="navbar-brand" translate>Rechnungsdaten</spa
<div class="col-md-8">
<div class="input-group">
<div class="input-group-addon" ng-if="projekt !== undefined">{{projekt.waehrung}}</div>
<input ng-disabled="!canEditBetrag()" type="number" placeholder="{{'Betrag'|translate}}" ng-pattern="/^[-+]?[0-9]+([\.,][0-9]{1,3})?$/" min="0" step="0.01" class="form-control" name="betrag" ng-model="rechnung.betrag" required></input>
<input ng-disabled="!canEditBetrag()" type="number" placeholder="{{'Betrag'|translate}}" ng-pattern="/^[-+]?[0-9]+([\.,][0-9]{1,2})?$/" max="99999.99" min="0" step="0.01" class="form-control" name="betrag" ng-model="rechnung.betrag" required></input>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openolitor-admin",
"version": "2.6.14",
"version": "2.6.15",
"private": false,
"dependencies": {
"jquery": "npm:jquery#3.6.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openolitor-admin",
"version": "2.6.14",
"version": "2.6.15",
"description": "OpenOlitor Client Webapplication - Admin-Portal",
"repository": {
"type": "git",
Expand Down
Loading