TotalsInterface.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Api\Data;
  7. /**
  8. * Interface TotalsInterface
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface TotalsInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. /**#@+
  15. * Constants defined for keys of array, makes typos less likely
  16. */
  17. const KEY_GRAND_TOTAL = 'grand_total';
  18. const KEY_BASE_GRAND_TOTAL = 'base_grand_total';
  19. const KEY_SUBTOTAL = 'subtotal';
  20. const KEY_BASE_SUBTOTAL = 'base_subtotal';
  21. const KEY_DISCOUNT_AMOUNT = 'discount_amount';
  22. const KEY_BASE_DISCOUNT_AMOUNT = 'base_discount_amount';
  23. const KEY_SUBTOTAL_WITH_DISCOUNT = 'subtotal_with_discount';
  24. const KEY_BASE_SUBTOTAL_WITH_DISCOUNT = 'base_subtotal_with_discount';
  25. const KEY_SHIPPING_AMOUNT = 'shipping_amount';
  26. const KEY_BASE_SHIPPING_AMOUNT = 'base_shipping_amount';
  27. const KEY_SHIPPING_DISCOUNT_AMOUNT = 'shipping_discount_amount';
  28. const KEY_BASE_SHIPPING_DISCOUNT_AMOUNT = 'base_shipping_discount_amount';
  29. const KEY_TAX_AMOUNT = 'tax_amount';
  30. const KEY_BASE_TAX_AMOUNT = 'base_tax_amount';
  31. const KEY_WEEE_TAX_APPLIED_AMOUNT = 'weee_tax_applied_amount';
  32. const KEY_SHIPPING_TAX_AMOUNT = 'shipping_tax_amount';
  33. const KEY_BASE_SHIPPING_TAX_AMOUNT = 'base_shipping_tax_amount';
  34. const KEY_SUBTOTAL_INCL_TAX = 'subtotal_incl_tax';
  35. const KEY_BASE_SUBTOTAL_INCL_TAX = 'base_subtotal_incl_tax';
  36. const KEY_SHIPPING_INCL_TAX = 'shipping_incl_tax';
  37. const KEY_BASE_SHIPPING_INCL_TAX = 'base_shipping_incl_tax';
  38. const KEY_BASE_CURRENCY_CODE = 'base_currency_code';
  39. const KEY_QUOTE_CURRENCY_CODE = 'quote_currency_code';
  40. const KEY_COUPON_CODE = 'coupon_code';
  41. const KEY_ITEMS = 'items';
  42. const KEY_TOTAL_SEGMENTS = 'total_segments';
  43. const KEY_ITEMS_QTY = 'items_qty';
  44. /**#@-*/
  45. /**
  46. * Get grand total in quote currency
  47. *
  48. * @return float|null
  49. */
  50. public function getGrandTotal();
  51. /**
  52. * Set grand total in quote currency
  53. *
  54. * @param float $grandTotal
  55. * @return $this
  56. */
  57. public function setGrandTotal($grandTotal);
  58. /**
  59. * Get grand total in base currency
  60. *
  61. * @return float|null
  62. */
  63. public function getBaseGrandTotal();
  64. /**
  65. * Set grand total in base currency
  66. *
  67. * @param float $baseGrandTotal
  68. * @return $this
  69. */
  70. public function setBaseGrandTotal($baseGrandTotal);
  71. /**
  72. * Get subtotal in quote currency
  73. *
  74. * @return float|null
  75. */
  76. public function getSubtotal();
  77. /**
  78. * Set subtotal in quote currency
  79. *
  80. * @param float $subtotal
  81. * @return $this
  82. */
  83. public function setSubtotal($subtotal);
  84. /**
  85. * Get subtotal in base currency
  86. *
  87. * @return float|null
  88. */
  89. public function getBaseSubtotal();
  90. /**
  91. * Set subtotal in base currency
  92. *
  93. * @param float $baseSubtotal
  94. * @return $this
  95. */
  96. public function setBaseSubtotal($baseSubtotal);
  97. /**
  98. * Get discount amount in quote currency
  99. *
  100. * @return float|null
  101. */
  102. public function getDiscountAmount();
  103. /**
  104. * Set discount amount in quote currency
  105. *
  106. * @param float $discountAmount
  107. * @return $this
  108. */
  109. public function setDiscountAmount($discountAmount);
  110. /**
  111. * Get discount amount in base currency
  112. *
  113. * @return float|null
  114. */
  115. public function getBaseDiscountAmount();
  116. /**
  117. * Set discount amount in base currency
  118. *
  119. * @param float $baseDiscountAmount
  120. * @return $this
  121. */
  122. public function setBaseDiscountAmount($baseDiscountAmount);
  123. /**
  124. * Get subtotal in quote currency with applied discount
  125. *
  126. * @return float|null
  127. */
  128. public function getSubtotalWithDiscount();
  129. /**
  130. * Set subtotal in quote currency with applied discount
  131. *
  132. * @param float $subtotalWithDiscount
  133. * @return $this
  134. */
  135. public function setSubtotalWithDiscount($subtotalWithDiscount);
  136. /**
  137. * Get subtotal in base currency with applied discount
  138. *
  139. * @return float|null
  140. */
  141. public function getBaseSubtotalWithDiscount();
  142. /**
  143. * Set subtotal in base currency with applied discount
  144. *
  145. * @param float $baseSubtotalWithDiscount
  146. * @return $this
  147. */
  148. public function setBaseSubtotalWithDiscount($baseSubtotalWithDiscount);
  149. /**
  150. * Get shipping amount in quote currency
  151. *
  152. * @return float|null
  153. */
  154. public function getShippingAmount();
  155. /**
  156. * Set shipping amount in quote currency
  157. *
  158. * @param float $shippingAmount
  159. * @return $this
  160. */
  161. public function setShippingAmount($shippingAmount);
  162. /**
  163. * Get shipping amount in base currency
  164. *
  165. * @return float|null
  166. */
  167. public function getBaseShippingAmount();
  168. /**
  169. * Set shipping amount in base currency
  170. *
  171. * @param float $baseShippingAmount
  172. * @return $this
  173. */
  174. public function setBaseShippingAmount($baseShippingAmount);
  175. /**
  176. * Get shipping discount amount in quote currency
  177. *
  178. * @return float|null
  179. */
  180. public function getShippingDiscountAmount();
  181. /**
  182. * Set shipping discount amount in quote currency
  183. *
  184. * @param float $shippingDiscountAmount
  185. * @return $this
  186. */
  187. public function setShippingDiscountAmount($shippingDiscountAmount);
  188. /**
  189. * Get shipping discount amount in base currency
  190. *
  191. * @return float|null
  192. */
  193. public function getBaseShippingDiscountAmount();
  194. /**
  195. * Set shipping discount amount in base currency
  196. *
  197. * @param float $baseShippingDiscountAmount
  198. * @return $this
  199. */
  200. public function setBaseShippingDiscountAmount($baseShippingDiscountAmount);
  201. /**
  202. * Get tax amount in quote currency
  203. *
  204. * @return float|null
  205. */
  206. public function getTaxAmount();
  207. /**
  208. * Set tax amount in quote currency
  209. *
  210. * @param float $taxAmount
  211. * @return $this
  212. */
  213. public function setTaxAmount($taxAmount);
  214. /**
  215. * Get tax amount in base currency
  216. *
  217. * @return float|null
  218. */
  219. public function getBaseTaxAmount();
  220. /**
  221. * Set tax amount in base currency
  222. *
  223. * @param float $baseTaxAmount
  224. * @return $this
  225. */
  226. public function setBaseTaxAmount($baseTaxAmount);
  227. /**
  228. * Returns the total weee tax applied amount in quote currency.
  229. *
  230. * @return float Item weee tax applied amount in quote currency.
  231. */
  232. public function getWeeeTaxAppliedAmount();
  233. /**
  234. * Sets the total weee tax applied amount in quote currency.
  235. *
  236. * @param float $weeeTaxAppliedAmount
  237. * @return $this
  238. */
  239. public function setWeeeTaxAppliedAmount($weeeTaxAppliedAmount);
  240. /**
  241. * Get shipping tax amount in quote currency
  242. *
  243. * @return float|null
  244. */
  245. public function getShippingTaxAmount();
  246. /**
  247. * Set shipping tax amount in quote currency
  248. *
  249. * @param float $shippingTaxAmount
  250. * @return $this
  251. */
  252. public function setShippingTaxAmount($shippingTaxAmount);
  253. /**
  254. * Get shipping tax amount in base currency
  255. *
  256. * @return float|null
  257. */
  258. public function getBaseShippingTaxAmount();
  259. /**
  260. * Set shipping tax amount in base currency
  261. *
  262. * @param float $baseShippingTaxAmount
  263. * @return $this
  264. */
  265. public function setBaseShippingTaxAmount($baseShippingTaxAmount);
  266. /**
  267. * Get subtotal including tax in quote currency
  268. *
  269. * @return float|null
  270. */
  271. public function getSubtotalInclTax();
  272. /**
  273. * Set subtotal including tax in quote currency
  274. *
  275. * @param float $subtotalInclTax
  276. * @return $this
  277. */
  278. public function setSubtotalInclTax($subtotalInclTax);
  279. /**
  280. * Get subtotal including tax in base currency
  281. *
  282. * @return float|null
  283. */
  284. public function getBaseSubtotalInclTax();
  285. /**
  286. * Set subtotal including tax in base currency
  287. *
  288. * @param float $baseSubtotalInclTax
  289. * @return $this
  290. */
  291. public function setBaseSubtotalInclTax($baseSubtotalInclTax);
  292. /**
  293. * Get shipping including tax in quote currency
  294. *
  295. * @return float|null
  296. */
  297. public function getShippingInclTax();
  298. /**
  299. * Set shipping including tax in quote currency
  300. *
  301. * @param float $shippingInclTax
  302. * @return $this
  303. */
  304. public function setShippingInclTax($shippingInclTax);
  305. /**
  306. * Get shipping including tax in base currency
  307. *
  308. * @return float|null
  309. */
  310. public function getBaseShippingInclTax();
  311. /**
  312. * Set shipping including tax in base currency
  313. *
  314. * @param float $baseShippingInclTax
  315. * @return $this
  316. */
  317. public function setBaseShippingInclTax($baseShippingInclTax);
  318. /**
  319. * Get base currency code
  320. *
  321. * @return string|null
  322. */
  323. public function getBaseCurrencyCode();
  324. /**
  325. * Set base currency code
  326. *
  327. * @param string $baseCurrencyCode
  328. * @return $this
  329. */
  330. public function setBaseCurrencyCode($baseCurrencyCode);
  331. /**
  332. * Get quote currency code
  333. *
  334. * @return string|null
  335. */
  336. public function getQuoteCurrencyCode();
  337. /**
  338. * Set quote currency code
  339. *
  340. * @param string $quoteCurrencyCode
  341. * @return $this
  342. */
  343. public function setQuoteCurrencyCode($quoteCurrencyCode);
  344. /**
  345. * Get applied coupon code
  346. *
  347. * @return string|null
  348. */
  349. public function getCouponCode();
  350. /**
  351. * Set applied coupon code
  352. *
  353. * @param string $couponCode
  354. * @return $this
  355. */
  356. public function setCouponCode($couponCode);
  357. /**
  358. * Get items qty
  359. *
  360. * @return int||null
  361. */
  362. public function getItemsQty();
  363. /**
  364. * Set items qty
  365. *
  366. * @param int $itemsQty
  367. * @return $this
  368. */
  369. public function setItemsQty($itemsQty = null);
  370. /**
  371. * Get totals by items
  372. *
  373. * @return \Magento\Quote\Api\Data\TotalsItemInterface[]|null
  374. */
  375. public function getItems();
  376. /**
  377. * Set totals by items
  378. *
  379. * @param \Magento\Quote\Api\Data\TotalsItemInterface[] $items
  380. * @return $this
  381. */
  382. public function setItems(array $items = null);
  383. /**
  384. * Get dynamically calculated totals
  385. *
  386. * @return \Magento\Quote\Api\Data\TotalSegmentInterface[]
  387. */
  388. public function getTotalSegments();
  389. /**
  390. * Set dynamically calculated totals
  391. *
  392. * @param \Magento\Quote\Api\Data\TotalSegmentInterface[] $totals
  393. * @return $this
  394. */
  395. public function setTotalSegments($totals = []);
  396. /**
  397. * Retrieve existing extension attributes object or create a new one.
  398. *
  399. * @return \Magento\Quote\Api\Data\TotalsExtensionInterface|null
  400. */
  401. public function getExtensionAttributes();
  402. /**
  403. * Set an extension attributes object.
  404. *
  405. * @param \Magento\Quote\Api\Data\TotalsExtensionInterface $extensionAttributes
  406. * @return $this
  407. */
  408. public function setExtensionAttributes(\Magento\Quote\Api\Data\TotalsExtensionInterface $extensionAttributes);
  409. }