Details.cshtml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. @model GreenTree.Strohrmann.ERP.Web.Models.Business.CraftModel
  2. @{
  3. ViewData["Title"] = "Kundendetails";
  4. }
  5. <h1>Werksdetails</h1>
  6. <h4>@Model.Name</h4>
  7. <hr />
  8. <div class="row">
  9. <div class="col-4 pr-1">
  10. <div class="card h-100">
  11. <div class="card-header pb-1">
  12. <h6>Allgemein</h6>
  13. </div>
  14. <div class="card-body">
  15. <dl class="row">
  16. <dt class = "col-sm-6">
  17. @Html.DisplayNameFor(model => model.Id)
  18. </dt>
  19. <dd class = "col-sm-6">
  20. @Html.DisplayFor(model => model.Id)
  21. </dd>
  22. <dt class = "col-sm-6">
  23. @Html.DisplayNameFor(model => model.Name)
  24. </dt>
  25. <dd class = "col-sm-6">
  26. @Html.DisplayFor(model => model.Name)
  27. </dd>
  28. <dt class = "col-sm-6">
  29. @Html.DisplayNameFor(model => model.CreationDate)
  30. </dt>
  31. <dd class = "col-sm-6">
  32. @Html.DisplayFor(model => model.CreationDate)
  33. </dd>
  34. <dt class = "col-sm-6">
  35. @Html.DisplayNameFor(model => model.Customer)
  36. </dt>
  37. <dd class = "col-sm-6">
  38. @Html.DisplayFor(model => model.CustomerText)
  39. </dd>
  40. <dt class = "col-sm-6">
  41. @Html.DisplayNameFor(model => model.Comment)
  42. </dt>
  43. <dd class = "col-sm-6">
  44. @Html.DisplayFor(model => model.Comment)
  45. </dd>
  46. </dl>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="col-8">
  51. <div class="card">
  52. <div class="card-header pb-1">
  53. <h6 class="float-left">Arbeitsstunden</h6>
  54. </div>
  55. <div id="craftemployeelist" class="card-body">
  56. <table class="table table-striped">
  57. @if (Model != null && Model.CraftEmployees != null && Model.CraftEmployees.Count > 0)
  58. {
  59. <thead>
  60. <tr class="row">
  61. <th class="col-4">
  62. @Html.DisplayNameFor(model => model.CraftEmployees.First().Value.Employee)
  63. </th>
  64. <th class="col-2">
  65. @Html.DisplayNameFor(model => model.CraftEmployees.First().Value.Amount)
  66. </th>
  67. <th class="col-2">
  68. @Html.DisplayNameFor(model => model.CraftEmployees.First().Value.Value)
  69. </th>
  70. <th class="col-4">
  71. @Html.DisplayNameFor(model => model.CraftEmployees.First().Value.Comment)
  72. </th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. @foreach (var item in Model.CraftEmployees)
  77. {
  78. <tr class="row">
  79. <td class="col-4">
  80. @Html.DisplayFor(model => item.Value.Employee.Fullname)
  81. </td>
  82. <td class="col-2">
  83. @Html.DisplayFor(model => item.Value.Amount)
  84. <span class="ml-1">Std.</span>
  85. </td>
  86. <td class="col-2">
  87. @Html.DisplayFor(model => item.Value.Value)
  88. </td>
  89. <td class="col-4">
  90. @Html.DisplayFor(model => item.Value.Comment)
  91. </td>
  92. </tr>
  93. }
  94. </tbody>
  95. }
  96. else
  97. {
  98. <tbody>
  99. <tr class="row">
  100. Keine Stunden eingetragen
  101. </tr>
  102. </tbody>
  103. }
  104. </table>
  105. </div>
  106. <div class="card-footer">
  107. <div class="row">
  108. <div class="col-4">
  109. <h5 class="mb-0">
  110. <span class="badge badge-info">
  111. <span class="fa fa-hashtag" aria-label="Anzahl"> </span>
  112. @if (Model != null && Model.CraftEmployees != null)
  113. {
  114. <span id="aggEmployeeCount">
  115. @Model.CraftEmployees.Values.Count
  116. </span>
  117. }
  118. else
  119. {
  120. <span id="aggEmployeeCount">1</span>
  121. }
  122. </span>
  123. </h5>
  124. </div>
  125. <div class="col-2">
  126. <h5 class="mb-0">
  127. <span class="badge badge-info">
  128. <img height="14" src="~/img/icon-average-48.png" alt="Durchschnitt" title="Durchschnitt" />
  129. @if (Model != null && Model.CraftEmployees != null)
  130. {
  131. <span id="aggEmployeeAmountAvg">
  132. @String.Format("{0:G29} Std.", Model.CraftEmployees.Values.Average(m => m.Amount))
  133. </span>
  134. }
  135. else
  136. {
  137. <span id="aggEmployeeAmountAvg"> -</span>
  138. }
  139. </span>
  140. </h5>
  141. </div>
  142. <div class="col-6">
  143. <h5 class="mb-0">
  144. <span class="badge badge-info">
  145. <img height="14" src="~/img/icon-sigma-48.png" alt="Summe" title="Summe" />
  146. @if (Model != null && Model.CraftEmployees != null)
  147. {
  148. <span id="aggEmployeeValueSum">
  149. @String.Format("{0} €", Model.CraftEmployees.Values.Sum(m => m.Value))
  150. </span>
  151. }
  152. else
  153. {
  154. <span id="aggEmployeeValueSum"> -</span>
  155. }
  156. </span>
  157. </h5>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. <div class="card mt-3">
  163. <div class="card-header pb-1">
  164. <h6 class="float-left">Materialien</h6>
  165. </div>
  166. <div id="craftmateriallist" class="card-body">
  167. <table class="table table-striped">
  168. @if (Model != null && Model.CraftMaterials != null && Model.CraftMaterials.Count > 0)
  169. {
  170. <thead>
  171. <tr class="row">
  172. <th class="col-4">
  173. @Html.DisplayNameFor(model => model.CraftMaterials.First().Value.Material)
  174. </th>
  175. <th class="col-2">
  176. @Html.DisplayNameFor(model => model.CraftMaterials.First().Value.Amount)
  177. </th>
  178. <th class="col-2">
  179. @Html.DisplayNameFor(model => model.CraftMaterials.First().Value.CalculationFactor)
  180. </th>
  181. <th class="col-4">
  182. @Html.DisplayNameFor(model => model.CraftMaterials.First().Value.Value)
  183. </th>
  184. </tr>
  185. </thead>
  186. <tbody>
  187. @foreach (var item in Model.CraftMaterials)
  188. {
  189. <tr class="row">
  190. <td class="col-4">
  191. @Html.DisplayFor(model => item.Value.MaterialText)
  192. </td>
  193. <td class="col-2">
  194. @Html.DisplayFor(model => item.Value.Amount)
  195. @Html.DisplayFor(model => item.Value.Material.DefaultUnit.ShortName)
  196. </td>
  197. <td class="col-2">
  198. @Html.DisplayFor(model => item.Value.CalculationFactorUncalculated)
  199. </td>
  200. <td class="col-4">
  201. @Html.DisplayFor(model => item.Value.Value)
  202. </td>
  203. </tr>
  204. }
  205. </tbody>
  206. }
  207. else
  208. {
  209. <tbody>
  210. Keine Materialien verwendet
  211. </tbody>
  212. }
  213. </table>
  214. </div>
  215. <div class="card-footer">
  216. <div class="row">
  217. <div class="col-4">
  218. <h5 class="mb-0">
  219. <span class="badge badge-info">
  220. <span class="fa fa-hashtag" aria-label="Anzahl"> </span>
  221. @if (Model != null && Model.CraftMaterials != null)
  222. {
  223. <span id="aggMaterialCount">
  224. @Model.CraftMaterials.Values.Count
  225. </span>
  226. }
  227. else
  228. {
  229. <span id="aggMaterialCount">1</span>
  230. }
  231. </span>
  232. </h5>
  233. </div>
  234. <div class="col-2">
  235. </div>
  236. <div class="col-2">
  237. <h5 class="mb-0">
  238. <span class="badge badge-info">
  239. <img height="14" src="~/img/icon-average-48.png" alt="Durchschnitt" title="Durchschnitt" />
  240. @if (Model != null && Model.CraftMaterials != null)
  241. {
  242. <span id="aggMaterialCalculationFactorAvg">
  243. @String.Format("{0:G29} %", Model.CraftMaterials.Values.Average(m => m.CalculationFactor))
  244. </span>
  245. }
  246. else
  247. {
  248. <span id="aggMaterialCalculationFactorAvg"> -</span>
  249. }
  250. </span>
  251. </h5>
  252. </div>
  253. <div class="col-4">
  254. <h5 class="mb-0">
  255. <span class="badge badge-info">
  256. <img height="14" src="~/img/icon-sigma-48.png" alt="Summe" title="Summe" />
  257. @if (Model != null && Model.CraftMaterials != null)
  258. {
  259. <span id="aggMaterialValueSum">
  260. @String.Format("{0} €", Model.CraftMaterials.Values.Sum(m => m.Value))
  261. </span>
  262. }
  263. else
  264. {
  265. <span id="aggMaterialValueSum"> -</span>
  266. }
  267. </span>
  268. </h5>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. <hr />
  276. <div class="d-flex">
  277. @Html.ActionLink("Bearbeiten", "Edit", new { id = Model.Id })
  278. <div class="align-self-center ml-3">
  279. <a asp-action="Index">Zurück zur Liste</a>
  280. </div>
  281. <div class="align-self-center ml-auto">
  282. <a href="#" data-toggle="modal" data-target="#trackingModal">Änderungsinfo</a>
  283. </div>
  284. </div>
  285. <div id="trackingModal" class="modal fade" tabindex="-1" role="dialog">
  286. <div class="modal-dialog" role="document">
  287. <div class="modal-content modal-content-header-custom">
  288. <div class="modal-header modal-header-info text-white">
  289. <h5 class="modal-title">Änderungsinfo - @Model.Name</h5>
  290. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  291. <span aria-hidden="true">&times;</span>
  292. </button>
  293. </div>
  294. <div class="modal-body">
  295. <dl class="row">
  296. <dt class = "col-sm-4">
  297. @Html.DisplayNameFor(model => model.CreatedBy)
  298. </dt>
  299. <dd class = "col-sm-6">
  300. @Html.DisplayFor(model => model.CreatedBy)
  301. </dd>
  302. <dt class = "col-sm-4">
  303. @Html.DisplayNameFor(model => model.CreatedOn)
  304. </dt>
  305. <dd class = "col-sm-6">
  306. @Html.DisplayFor(model => model.CreatedOn)
  307. </dd>
  308. </dl>
  309. <dl class="row">
  310. <dt class = "col-sm-4">
  311. @Html.DisplayNameFor(model => model.ChangedBy)
  312. </dt>
  313. <dd class = "col-sm-6">
  314. @Html.DisplayFor(model => model.ChangedBy)
  315. </dd>
  316. <dt class = "col-sm-4">
  317. @Html.DisplayNameFor(model => model.ChangedOn)
  318. </dt>
  319. <dd class = "col-sm-6">
  320. @Html.DisplayFor(model => model.ChangedOn)
  321. </dd>
  322. </dl>
  323. </div>
  324. <div class="modal-footer">
  325. <button type="button" class="btn btn-secondary" data-dismiss="modal">Schließen</button>
  326. </div>
  327. </div>
  328. </div>
  329. </div>