commonModule.controller('invoiceTableTemplateController', ['$log', '$scope', '$translate', 'InvoiceManageService', 'SweetAlert',
function ($log, $scope, $translate,InvoiceManageService, SweetAlert) {
    "use strict";
    $log.debug('invoiceTableTemplateController.ctor()...');
    var loadDetail=function(){
        InvoiceManageService.getInputInvoiceItemList($scope.invoice.id).success(function (response) {
            $scope.invoice.items = response;
        }).error(function () {
            SweetAlert.error('', $translate.instant('CommonFail'));
        });
    };
     (function initialize() {
         if ($scope.isLoadDetail) {
             loadDetail();
         }
     })();
}]);