Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (vm.isRefurbish == "Ya") {
- vm.inventoryLookup[vm.stockIn.itemId].isAssembly = true;
- var refurbishInput = {
- "assemblyDate": new Date(),
- "inventoryId": vm.stockIn.itemId,
- "itemAssemblyQuantity": vm.stockIn.itemAmount,
- "assembledQuantity": 0,
- "legalEntityId": vm.stockIn.legalEntityId,
- "branchId": vm.stockIn.branchId,
- };
- console.log(refurbishInput);
- refurbishService.createOrUpdateRefurbish({
- refurbish: refurbishInput
- }).then(function (result) {
- abp.notify.info("Data Perakitan Refurbish Telah Diupdate");
- });
- }
- if (vm.isRefurbish == "Tidak") {
- vm.inventoryLookup[vm.stockIn.itemId].totalQuantity = parseInt(vm.inventoryLookup[vm.stockIn.itemId].totalQuantity) + parseInt(vm.stockIn.itemAmount);
- vm.inventoryLookup[vm.stockIn.itemId].isAssembly = false;
- console.log(vm.inventoryLookup[vm.stockIn.itemId]);
- inventoryService.createOrUpdateInventory({
- inventory: vm.inventoryLookup[vm.stockIn.itemId]
- }).then(function (result) {
- abp.notify.info("Data Inventory Telah Diupdate");
- var transactionData = {
- "transactionType": "Central Procurement",
- "transactionDate": new Date,
- "itemId": vm.stockIn.itemId,
- "outQuantity": parseInt(vm.stockIn.itemAmount),
- "transactionNominal": parseInt(vm.stockIn.itemAmount) * parseInt(vm.inventoryLookup[vm.stockIn.itemId].sellingPrice),
- "legalEntityId": vm.stockIn.legalEntityId,
- "branchId": vm.stockIn.branchId,
- "transactionScope": "Internal",
- "paymentType": "Cash",
- "transactionStatus": "Completed"
- };
- }).finally(function () {
- vm.saving = false;
- });
- }
- if (vm.isAssembly == "Ya") {
- vm.inventoryLookup[vm.stockIn.itemId].totalQuantity = parseInt(vm.inventoryLookup[vm.stockIn.itemId].totalQuantity) + parseInt(vm.stockIn.itemAmount);
- vm.inventoryLookup[vm.stockIn.itemId].isAssembly = true;
- console.log(vm.inventoryLookup[vm.stockIn.itemId]);
- inventoryService.createOrUpdateInventory({
- inventory: vm.inventoryLookup[vm.stockIn.itemId]
- }).then(function (result) {
- abp.notify.info("Data Inventory Telah Diupdate");
- var transactionData = {
- "transactionType": "Central Procurement",
- "transactionDate": new Date,
- "itemId": vm.stockIn.itemId,
- "outQuantity": parseInt(vm.stockIn.itemAmount),
- "transactionNominal": parseInt(vm.stockIn.itemAmount) * parseInt(vm.inventoryLookup[vm.stockIn.itemId].sellingPrice),
- "legalEntityId": vm.stockIn.legalEntityId,
- "branchId": vm.stockIn.branchId,
- "transactionScope": "Internal",
- "paymentType": "Cash",
- "transactionStatus": "Completed"
- };
- }).finally(function () {
- vm.saving = false;
- });
- }
- if (vm.isAssembly == "Tidak") {
- vm.inventoryLookup[vm.stockIn.itemId].totalQuantity = parseInt(vm.inventoryLookup[vm.stockIn.itemId].totalQuantity) + parseInt(vm.stockIn.itemAmount);
- console.log(vm.inventoryLookup[vm.stockIn.itemId]);
- vm.inventoryLookup[vm.stockIn.itemId].isAssembly = false;
- inventoryService.createOrUpdateInventory({
- inventory: vm.inventoryLookup[vm.stockIn.itemId]
- }).then(function (result) {
- abp.notify.info("Data Inventory Telah Diupdate");
- var transactionData = {
- "transactionType": "Central Procurement",
- "transactionDate": new Date,
- "itemId": vm.stockIn.itemId,
- "outQuantity": parseInt(vm.stockIn.itemAmount),
- "transactionNominal": parseInt(vm.stockIn.itemAmount) * parseInt(vm.inventoryLookup[vm.stockIn.itemId].sellingPrice),
- "legalEntityId": vm.stockIn.legalEntityId,
- "branchId": vm.stockIn.branchId,
- "transactionScope": "Internal",
- "paymentType": "Cash",
- "transactionStatus": "Completed"
- };
- }).finally(function () {
- vm.saving = false;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement