Advertisement
vitareinforce

refurbish rev vitra

Dec 18th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.51 KB | None | 0 0
  1. if (vm.isRefurbish == "Ya") {
  2. vm.inventoryLookup[vm.stockIn.itemId].isAssembly = true;
  3. var refurbishInput = {
  4. "assemblyDate": new Date(),
  5. "inventoryId": vm.stockIn.itemId,
  6. "itemAssemblyQuantity": vm.stockIn.itemAmount,
  7. "assembledQuantity": 0,
  8. "legalEntityId": vm.stockIn.legalEntityId,
  9. "branchId": vm.stockIn.branchId,
  10. };
  11. console.log(refurbishInput);
  12. refurbishService.createOrUpdateRefurbish({
  13. refurbish: refurbishInput
  14. }).then(function (result) {
  15. abp.notify.info("Data Perakitan Refurbish Telah Diupdate");
  16.  
  17. });
  18. }
  19.  
  20. if (vm.isRefurbish == "Tidak") {
  21. vm.inventoryLookup[vm.stockIn.itemId].totalQuantity = parseInt(vm.inventoryLookup[vm.stockIn.itemId].totalQuantity) + parseInt(vm.stockIn.itemAmount);
  22. vm.inventoryLookup[vm.stockIn.itemId].isAssembly = false;
  23.  
  24. console.log(vm.inventoryLookup[vm.stockIn.itemId]);
  25. inventoryService.createOrUpdateInventory({
  26. inventory: vm.inventoryLookup[vm.stockIn.itemId]
  27. }).then(function (result) {
  28. abp.notify.info("Data Inventory Telah Diupdate");
  29. var transactionData = {
  30. "transactionType": "Central Procurement",
  31. "transactionDate": new Date,
  32. "itemId": vm.stockIn.itemId,
  33. "outQuantity": parseInt(vm.stockIn.itemAmount),
  34. "transactionNominal": parseInt(vm.stockIn.itemAmount) * parseInt(vm.inventoryLookup[vm.stockIn.itemId].sellingPrice),
  35. "legalEntityId": vm.stockIn.legalEntityId,
  36. "branchId": vm.stockIn.branchId,
  37. "transactionScope": "Internal",
  38. "paymentType": "Cash",
  39. "transactionStatus": "Completed"
  40. };
  41.  
  42. }).finally(function () {
  43. vm.saving = false;
  44. });
  45. }
  46.  
  47. if (vm.isAssembly == "Ya") {
  48. vm.inventoryLookup[vm.stockIn.itemId].totalQuantity = parseInt(vm.inventoryLookup[vm.stockIn.itemId].totalQuantity) + parseInt(vm.stockIn.itemAmount);
  49. vm.inventoryLookup[vm.stockIn.itemId].isAssembly = true;
  50. console.log(vm.inventoryLookup[vm.stockIn.itemId]);
  51. inventoryService.createOrUpdateInventory({
  52. inventory: vm.inventoryLookup[vm.stockIn.itemId]
  53. }).then(function (result) {
  54. abp.notify.info("Data Inventory Telah Diupdate");
  55. var transactionData = {
  56. "transactionType": "Central Procurement",
  57. "transactionDate": new Date,
  58. "itemId": vm.stockIn.itemId,
  59. "outQuantity": parseInt(vm.stockIn.itemAmount),
  60. "transactionNominal": parseInt(vm.stockIn.itemAmount) * parseInt(vm.inventoryLookup[vm.stockIn.itemId].sellingPrice),
  61. "legalEntityId": vm.stockIn.legalEntityId,
  62. "branchId": vm.stockIn.branchId,
  63. "transactionScope": "Internal",
  64. "paymentType": "Cash",
  65. "transactionStatus": "Completed"
  66. };
  67.  
  68. }).finally(function () {
  69. vm.saving = false;
  70. });
  71. }
  72.  
  73. if (vm.isAssembly == "Tidak") {
  74. vm.inventoryLookup[vm.stockIn.itemId].totalQuantity = parseInt(vm.inventoryLookup[vm.stockIn.itemId].totalQuantity) + parseInt(vm.stockIn.itemAmount);
  75. console.log(vm.inventoryLookup[vm.stockIn.itemId]);
  76. vm.inventoryLookup[vm.stockIn.itemId].isAssembly = false;
  77. inventoryService.createOrUpdateInventory({
  78. inventory: vm.inventoryLookup[vm.stockIn.itemId]
  79. }).then(function (result) {
  80. abp.notify.info("Data Inventory Telah Diupdate");
  81. var transactionData = {
  82. "transactionType": "Central Procurement",
  83. "transactionDate": new Date,
  84. "itemId": vm.stockIn.itemId,
  85. "outQuantity": parseInt(vm.stockIn.itemAmount),
  86. "transactionNominal": parseInt(vm.stockIn.itemAmount) * parseInt(vm.inventoryLookup[vm.stockIn.itemId].sellingPrice),
  87. "legalEntityId": vm.stockIn.legalEntityId,
  88. "branchId": vm.stockIn.branchId,
  89. "transactionScope": "Internal",
  90. "paymentType": "Cash",
  91. "transactionStatus": "Completed"
  92. };
  93.  
  94. }).finally(function () {
  95. vm.saving = false;
  96. });
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement