<commit_before><div class="admin-paymentgroup-item">
    <page-property name="title" value="Betalingsgruppe"></page-property>

    <div class="page-header">
        <h1>
            <span class="eventgroup">
                <a href="a/eventgroup/{{ctrl.paymentgroup.eventgroup.id}}/paymentgroups">{{ctrl.paymentgroup.eventgroup.title}}</a>
            </span>
            Betalingsgruppe: {{ctrl.paymentgroup.title}}

            <span class="pull-right">
                <button class="btn btn-default" ng-click="ctrl.startEdit()" ng-if="!ctrl.paymentgroup.time_end && !ctrl.edit">
                    Rediger
                </button>
                <button class="btn btn-default" ng-click="ctrl.show_details = !ctrl.show_details">
                    {{ctrl.show_details ? 'Skjul detaljer' : 'Vis detaljer'}}
                </button>
                <button class="btn btn-primary" ng-click="ctrl.close()" ng-if="!ctrl.paymentgroup.time_end">
                    Avslutt/ta oppgjør
                </button>
            </span>
        </h1>
    </div>

    <form ng-if="ctrl.edit" ng-submit="ctrl.save()" class="form-horizontal" autocomplete="off">
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">Tittel</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="ctrl.edit.title" id="title" placeholder="" required autofocus>
            </div>
        </div>
        <div class="form-group">
            <label for="description" class="col-sm-2 control-label">Beskrivelse</label>
            <div class="col-sm-6">
                <textarea class="form-control" ng-model="ctrl.edit.description" id="description" rows="5" placeholder="(valgfritt)"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-6 col-sm-offset-2">
                <input type="submit" value="Oppdater" class="btn btn-primary">
                <a class="btn" ng-click="ctrl.abortEdit()">Avbryt</a>
            </div>
        </div>
    </form>

    <div ng-if="!ctrl.edit">

        <dl class="dl-horizontal">
            <dt>Tittel</dt>
            <dd>{{ctrl.paymentgroup.title}}</dd>
            <dt>Beskrivelse</dt>
            <dd marked="ctrl.paymentgroup.description"></dd>
            <dt>Opprettet</dt>
            <dd>{{ctrl.paymentgroup.time_start|formatdate:'DD.MM.YYYY HH:mm'}} av {{ctrl.paymentgroup.user_created}}</dd>
            <dt>Avsluttet</dt>
            <dd ng-if="ctrl.paymentgroup.time_end">{{ctrl.paymentgroup.time_end|formatdate:'DD.MM.YYYY HH:mm'}} av {{ctrl.paymentgroup.user_closed}}</dd>
            <dd ng-if="!ctrl.paymentgroup.time_end">Ikke avsluttet</dd>
        </dl>

        <dl class="dl-horizontal">
            <dt>Solgte billetter</dt>
            <dd>{{-ctrl.totals.valid|price}} - {{ctrl.totals.revoked|price}} = {{-ctrl.totals.valid-ctrl.totals.revoked|price}}</dd>
            <dt>Transaksjoner</dt>
            <dd>{{ctrl.totals.payments|price}}</dd>
            <dt>Utestående beløp</dt>
            <dd>{{(-ctrl.totals.valid-ctrl.totals.revoked-ctrl.totals.payments)|price}}</dd>
        </dl>

        <dl class="dl-horizontal">
            <dt>Registrerte betalinger</dt>
            <dd>{{ctrl.ps.sum|price}}</dd>
            <dt>Kassedifferanse</dt>
            <dd>{{ctrl.totals.payments-ctrl.ps.sum|price}}</dd>
        </dl>


        <h2>
            Betalingskilder
            <span class="pull-right btn btn-primary" ng-click="ctrl.newPaymentsource()">Registrer opptelling</span>
        </h2>

        <div ng-if="ctrl.ps.cashgroups.length == 0 && ctrl.ps.other.length == 0">
            Ingen betalingskilder er registrert.
        </div>

        <div ng-repeat="group in ctrl.ps.cashgroups">
            <div ng-class="{is_deleted: group.is_deleted}" ng-if="!group.is_deleted || ctrl.show_details">
                <h3><commit_msg>Hide register new paymentsource when closed<commit_after><div class="admin-paymentgroup-item">
    <page-property name="title" value="Betalingsgruppe"></page-property>

    <div class="page-header">
        <h1>
            <span class="eventgroup">
                <a href="a/eventgroup/{{ctrl.paymentgroup.eventgroup.id}}/paymentgroups">{{ctrl.paymentgroup.eventgroup.title}}</a>
            </span>
            Betalingsgruppe: {{ctrl.paymentgroup.title}}

            <span class="pull-right">
                <button class="btn btn-default" ng-click="ctrl.startEdit()" ng-if="!ctrl.paymentgroup.time_end && !ctrl.edit">
                    Rediger
                </button>
                <button class="btn btn-default" ng-click="ctrl.show_details = !ctrl.show_details">
                    {{ctrl.show_details ? 'Skjul detaljer' : 'Vis detaljer'}}
                </button>
                <button class="btn btn-primary" ng-click="ctrl.close()" ng-if="!ctrl.paymentgroup.time_end">
                    Avslutt/ta oppgjør
                </button>
            </span>
        </h1>
    </div>

    <form ng-if="ctrl.edit" ng-submit="ctrl.save()" class="form-horizontal" autocomplete="off">
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">Tittel</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="ctrl.edit.title" id="title" placeholder="" required autofocus>
            </div>
        </div>
        <div class="form-group">
            <label for="description" class="col-sm-2 control-label">Beskrivelse</label>
            <div class="col-sm-6">
                <textarea class="form-control" ng-model="ctrl.edit.description" id="description" rows="5" placeholder="(valgfritt)"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-6 col-sm-offset-2">
                <input type="submit" value="Oppdater" class="btn btn-primary">
                <a class="btn" ng-click="ctrl.abortEdit()">Avbryt</a>
            </div>
        </div>
    </form>

    <div ng-if="!ctrl.edit">

        <dl class="dl-horizontal">
            <dt>Tittel</dt>
            <dd>{{ctrl.paymentgroup.title}}</dd>
            <dt>Beskrivelse</dt>
            <dd marked="ctrl.paymentgroup.description"></dd>
            <dt>Opprettet</dt>
            <dd>{{ctrl.paymentgroup.time_start|formatdate:'DD.MM.YYYY HH:mm'}} av {{ctrl.paymentgroup.user_created}}</dd>
            <dt>Avsluttet</dt>
            <dd ng-if="ctrl.paymentgroup.time_end">{{ctrl.paymentgroup.time_end|formatdate:'DD.MM.YYYY HH:mm'}} av {{ctrl.paymentgroup.user_closed}}</dd>
            <dd ng-if="!ctrl.paymentgroup.time_end">Ikke avsluttet</dd>
        </dl>

        <dl class="dl-horizontal">
            <dt>Solgte billetter</dt>
            <dd>{{-ctrl.totals.valid|price}} - {{ctrl.totals.revoked|price}} = {{-ctrl.totals.valid-ctrl.totals.revoked|price}}</dd>
            <dt>Transaksjoner</dt>
            <dd>{{ctrl.totals.payments|price}}</dd>
            <dt>Utestående beløp</dt>
            <dd>{{(-ctrl.totals.valid-ctrl.totals.revoked-ctrl.totals.payments)|price}}</dd>
        </dl>

        <dl class="dl-horizontal">
            <dt>Registrerte betalinger</dt>
            <dd>{{ctrl.ps.sum|price}}</dd>
            <dt>Kassedifferanse</dt>
            <dd>{{ctrl.totals.payments-ctrl.ps.sum|price}}</dd>
        </dl>


        <h2>
            Betalingskilder
            <span class="pull-right btn btn-primary" ng-if="!ctrl.paymentgroup.time_end" ng-click="ctrl.newPaymentsource()">Registrer opptelling</span>
        </h2>

        <div ng-if="ctrl.ps.cashgroups.length == 0 && ctrl.ps.other.length == 0">
            Ingen betalingskilder er registrert.
        </div>

        <div ng-repeat="group in ctrl.ps.cashgroups">
            <div ng-class="{is_deleted: group.is_deleted}" ng-if="!group.is_deleted || ctrl.show_details">
                <h3>
{'fraction_non_alphanumeric': 0.17352347299343765, 'fraction_numerical': 0.0035335689045936395, 'mean_word_length': 2.1624102154828413, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 197, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1441420', 'n_tokens_mistral': 2608, 'n_tokens_neox': 2497, 'n_words': 357}