Browse Source

checkout Rechnung löschen

robert 2 years ago
parent
commit
cec747758e
2 changed files with 25 additions and 7 deletions
  1. 1 1
      scripts/controllers/checkout.js
  2. 24 6
      templates/checkout.html

+ 1 - 1
scripts/controllers/checkout.js

@@ -18,7 +18,7 @@ angular.module('pos')
         
         $scope.filterInvoices = function (flag) {
             if (flag == -1) {
-                return _.filter($scope.invoices, function (e) { return e.checkout != 0; });
+                return _.filter($scope.invoices, function (e) { return e.checkout > 0; });
             }
             return _.filter($scope.invoices, function (e) { return e.checkout == flag; });
         };        

+ 24 - 6
templates/checkout.html

@@ -99,7 +99,12 @@
                 </th>
             </tr>
             <tr ng-show="currentInvoice.checkout==0">
-                <td colspan="3"></td>
+                <td>
+                    <button type="button" class="btn btn-lg btn-danger" ng-click="setCheckout(-1)">
+                        <i class="glyphicon glyphicon-trash"></i> Löschen
+                    </button>
+                </td>
+                <td colspan="2"></td>
                 <td>
                     <button type="button" class="btn btn-lg btn-primary" ng-click="setCheckout(2)">
                         <i class="glyphicon glyphicon-credit-card"></i> Karte
@@ -131,7 +136,7 @@
                 </td>
             </tr>
 
-            <tr ng-show="currentInvoice.checkout!=0">
+            <tr ng-show="currentInvoice.checkout>0">
                 <td><i class="glyphicon glyphicon-print"></i></td>
                 <td colspan="3">
                     Drucken?
@@ -141,7 +146,7 @@
                     <button type="button" class="btn btn-success" ng-click="printInvoice(currentInvoice.invoice_number)" ng-show="currentInvoice.printed==1"><i class="glyphicon glyphicon-check"></i></button>
                 </td>
             </tr>
-            <tr ng-show="currentInvoice.checkout!=0">
+            <tr ng-show="currentInvoice.checkout>0">
                 <td><i class="glyphicon glyphicon-download-alt"></i></td>
                 <td colspan="3">
                     Zahlung erfolgreich?
@@ -155,8 +160,7 @@
                     </button>
                 </td>
             </tr>            
-
-
+            
             <tr>
                 <th></th>
                 <th class="text-right">Pos</th>
@@ -177,7 +181,21 @@
                 </td>
                 <td></td>
             </tr>
-
+            
+            <tr ng-show="currentInvoice.checkout==-1">
+                <td><i class="glyphicon glyphicon-download-alt"></i></td>
+                <td colspan="3">
+                    Wirklich l&ouml;schen?
+                </td>
+                <td class="text-right">
+                    <button type="button" class="btn btn-lg btn-danger" data-toggle="modal" data-target="#invoiceModal" ng-click="performCheckout(currentInvoice)">
+                        <i class="glyphicon glyphicon-ok"></i> Ja 
+                    </button>
+                    <button type="button" class="btn btn-lg btn-default" ng-click="currentInvoice.checkout=0">
+                        <i class="glyphicon glyphicon-remove"></i> Nein 
+                    </button>
+                </td>
+            </tr>  
         </table>