Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. endButton: new sap.m.Button("partnerOkButton", {
  2. text: "Ok",
  3. enabled: false,
  4. press: function(e) {
  5. var selectedPartner = sap.ui.getCore().byId("partnerList").getSelectedItem().getBindingContext().getObject();
  6. // TODO: Need to implement this into the Quotation generation
  7. var selectedQt = sap.ui.getCore().byId("qtType").getSelectedKey();
  8.  
  9. var h = self.oApplicationFacade.getApplicationModel("customizing").getProperty("/HEAD_DISCOUNT");
  10. var c = new sap.ui.model.json.JSONModel();
  11. var p = [{
  12. PartnerNumber: selectedPartner.CustomerID,
  13. PartnerFunction: "AG"
  14. }];
  15. var a = { results: p };
  16. c.setProperty("/PartnerSet", a);
  17. c.setProperty("/SoldToParty", selectedPartner.CustomerID);
  18. c.setProperty("/SalesOrganization", selectedPartner.SalesOrganization);
  19. c.setProperty("/DistributionChannel", selectedPartner.DistributionChannel);
  20. c.setProperty("/Division", selectedPartner.Division);
  21. c.setProperty("/RequestedDeliveryDate", self._currentDateTime());
  22. c.setProperty("/ValidTo", self._currentDateTime());
  23. c.setProperty("/ValidFrom", self._currentDateTime());
  24. c.setProperty("/PurchaseOrder", "");
  25. var b = [{
  26. ItemID: "000000",
  27. CondTypeCode: h,
  28. Counter: "000",
  29. AmountInternal: "0.0"
  30. }];
  31. var d = { results: b };
  32. c.setProperty("/PricingConditionSet", d);
  33. self.oApplicationFacade.setApplicationModel("NewQuotation", c);
  34. if (sap.ui.Device.system.phone) {
  35. self.oRouter.navTo("edit");
  36. } else {
  37. self.oRouter.navTo("edit");
  38. //self.oRouter.navTo("products", undefined, true);
  39. }
  40.  
  41. self.dialog.close();
  42. }
  43. }),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement