Guest User

Untitled

a guest
Jun 25th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. @HttpPost
  2. global static ID createInvoice (
  3. String customerId,
  4. String addressId,
  5. String invoiceId,
  6. String invoiceType,
  7. String invoiceTypeLocalized,
  8. String invoiceDate,
  9. String paymentDueDate,
  10. String invoiceNumber,
  11. String startDate,
  12. String endDate,
  13. String periodDescription,
  14. Decimal amount,
  15. Decimal vatAmount,
  16. Decimal totalAmount
  17. ) {
  18. invoice__c thisinvoice = new invoice__c (
  19. customerId__c = customerId,
  20. addressId__c = addressId,
  21. invoiceId__c = invoiceId,
  22. invoiceType__c = invoiceType,
  23. invoiceTypeLocalized__c = invoiceTypeLocalized,
  24. invoiceDate__c = Date.valueOf(invoiceDate.replace('T',' ')),
  25. paymentDueDate__c = Date.valueOf(paymentDueDate.replace('T',' ')),
  26. invoiceNumber__c = invoiceNumber,
  27. startDate__c = Date.valueOf(startDate.replace('T',' ')),
  28. endDate__c = Date.valueOf(endDate.replace('T',' ')),
  29. periodDescription__c = periodDescription,
  30. amount__c = amount,
  31. vatAmount__c = vatAmount,
  32. totalAmount__c = totalAmount
  33. );
  34. insert thisInvoice;
  35. return thisInvoice.Id;
  36. }
Add Comment
Please, Sign In to add comment