- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 37 of file Cart.java.
◆ Cart()
org.turro.financials.cart.Cart.Cart |
( |
| ) |
|
Definition at line 45 of file Cart.java.
46 this.items =
new CartItemSet();
◆ addDeliveryItem()
boolean org.turro.financials.cart.Cart.addDeliveryItem |
( |
long |
productId, |
|
|
double |
quantity, |
|
|
double |
tax, |
|
|
double |
price |
|
) |
| |
Definition at line 117 of file Cart.java.
118 CartItem ci =
new CartItem();
119 ci.setProductId(productId);
120 ci.setQuantity(quantity);
124 ci.setDeliveryItem(
true);
boolean addItem(CartItem cartItem)
◆ addItem()
boolean org.turro.financials.cart.Cart.addItem |
( |
long |
productId, |
|
|
double |
quantity, |
|
|
double |
tax, |
|
|
double |
price |
|
) |
| |
Definition at line 128 of file Cart.java.
130 CartItem ci =
new CartItem();
131 ci.setProductId(productId);
132 ci.setQuantity(quantity);
136 ci.setDeliveryItem(
false);
void setStatus(int status)
◆ changeItem() [1/2]
void org.turro.financials.cart.Cart.changeItem |
( |
Integer |
order, |
|
|
double |
quantity |
|
) |
| |
Definition at line 151 of file Cart.java.
153 Iterator<CartItem> it = items.iterator();
154 while(it.hasNext()) {
155 CartItem ci = it.next();
156 if(ci.getOrder() == order) {
157 ci.setQuantity(quantity);
◆ changeItem() [2/2]
void org.turro.financials.cart.Cart.changeItem |
( |
Integer |
order, |
|
|
String |
concept |
|
) |
| |
Definition at line 163 of file Cart.java.
165 Iterator<CartItem> it = items.iterator();
166 while(it.hasNext()) {
167 CartItem ci = it.next();
168 if(ci.getOrder() == order) {
169 ci.setConcept(concept);
◆ deserializeFor()
static Cart org.turro.financials.cart.Cart.deserializeFor |
( |
IContact |
contact | ) |
|
|
static |
Definition at line 246 of file Cart.java.
247 Cart cart = (
Cart) Serializer.deserialize(
"/cart/" + contact.
getId() +
".ser");
249 String mailFile =
"/cart/" + contact.
getConnector(IUser.CONNECTOR_EMAIL) +
".ser";
250 cart = (
Cart) Serializer.deserialize(mailFile);
◆ deserializeForOrder()
static Cart org.turro.financials.cart.Cart.deserializeForOrder |
( |
String |
order | ) |
|
|
static |
Definition at line 255 of file Cart.java.
256 Cart cart = (
Cart) Serializer.deserialize(
"/cart/" + order +
".ser");
257 Serializer.remove(
"/cart/" + order +
".ser");
◆ getAmounts()
CartAmounts org.turro.financials.cart.Cart.getAmounts |
( |
| ) |
|
Definition at line 220 of file Cart.java.
221 return new CartAmounts(
this);
◆ getContact()
IContact org.turro.financials.cart.Cart.getContact |
( |
| ) |
|
Definition at line 224 of file Cart.java.
225 if(contact ==
null) {
226 contact = Contacts.getContactById(contactId);
◆ getCurrency()
Currency org.turro.financials.cart.Cart.getCurrency |
( |
| ) |
|
Definition at line 273 of file Cart.java.
274 if(_currency ==
null) {
275 _currency = Currency.getInstance(ShopContext.getInstance().getCurrency());
◆ getDeliveryValue()
String org.turro.financials.cart.Cart.getDeliveryValue |
( |
| ) |
|
◆ getItem()
CartItem org.turro.financials.cart.Cart.getItem |
( |
Integer |
order | ) |
|
Definition at line 175 of file Cart.java.
176 Iterator<CartItem> it = items.iterator();
177 while(it.hasNext()) {
178 CartItem ci = it.next();
179 if(ci.getOrder() == order) {
◆ getItems()
CartItemSet org.turro.financials.cart.Cart.getItems |
( |
| ) |
|
◆ getOrder()
String org.turro.financials.cart.Cart.getOrder |
( |
| ) |
|
◆ getProducts()
Collection<CartItem> org.turro.financials.cart.Cart.getProducts |
( |
long |
id | ) |
|
Definition at line 186 of file Cart.java.
187 ArrayList<CartItem> list =
new ArrayList<>();
188 for(CartItem ci : items) {
189 if(ci.getProductId() ==
id) {
◆ getResetOrder()
String org.turro.financials.cart.Cart.getResetOrder |
( |
| ) |
|
Definition at line 49 of file Cart.java.
50 order = IdGenerator.generateLong().substring(2, 14);
◆ getStatus()
int org.turro.financials.cart.Cart.getStatus |
( |
| ) |
|
◆ getTotalAmount()
double org.turro.financials.cart.Cart.getTotalAmount |
( |
| ) |
|
Definition at line 196 of file Cart.java.
198 for(CartItem ci : items) {
199 value += ci.getAmount();
◆ getTotalTax()
double org.turro.financials.cart.Cart.getTotalTax |
( |
| ) |
|
Definition at line 212 of file Cart.java.
214 for(CartItem ci : items) {
215 value += ci.getTaxAmount();
◆ getTotalTaxable()
double org.turro.financials.cart.Cart.getTotalTaxable |
( |
| ) |
|
Definition at line 204 of file Cart.java.
206 for(CartItem ci : items) {
207 value += ci.getTaxable();
◆ isEmpty()
boolean org.turro.financials.cart.Cart.isEmpty |
( |
| ) |
|
Definition at line 94 of file Cart.java.
95 return items.isEmpty();
◆ isPickup()
boolean org.turro.financials.cart.Cart.isPickup |
( |
| ) |
|
◆ isWantBill()
boolean org.turro.financials.cart.Cart.isWantBill |
( |
| ) |
|
◆ needsDelivery()
boolean org.turro.financials.cart.Cart.needsDelivery |
( |
| ) |
|
Definition at line 98 of file Cart.java.
99 Iterator<CartItem> it = items.iterator();
100 while(it.hasNext()) {
101 if(it.next().isNeedsDelivery()) {
◆ onRegister()
void org.turro.financials.cart.Cart.onRegister |
( |
String |
email | ) |
|
◆ removeDeliveryItem()
void org.turro.financials.cart.Cart.removeDeliveryItem |
( |
| ) |
|
Definition at line 108 of file Cart.java.
109 Iterator<CartItem> it = items.iterator();
110 while(it.hasNext()) {
111 if(it.next().isDeliveryItem()) {
◆ removeFor()
static void org.turro.financials.cart.Cart.removeFor |
( |
IContact |
contact | ) |
|
|
static |
Definition at line 261 of file Cart.java.
262 Serializer.remove(
"/cart/" + contact.
getId() +
".ser");
263 Serializer.remove(
"/cart/" + contact.
getConnector(IUser.CONNECTOR_EMAIL) +
".ser");
◆ removeItem()
void org.turro.financials.cart.Cart.removeItem |
( |
Integer |
order | ) |
|
Definition at line 140 of file Cart.java.
142 Iterator<CartItem> it = items.iterator();
143 while(it.hasNext()) {
144 if(it.next().getOrder() == order) {
◆ serializeFor() [1/2]
void org.turro.financials.cart.Cart.serializeFor |
( |
IContact |
contact | ) |
|
Definition at line 236 of file Cart.java.
238 Serializer.serialize(
"/cart/" + contact.
getId() +
".ser",
this);
◆ serializeFor() [2/2]
void org.turro.financials.cart.Cart.serializeFor |
( |
String |
email | ) |
|
Definition at line 231 of file Cart.java.
233 Serializer.serialize(
"/cart/" + email +
".ser",
this);
◆ serializeForOrder()
void org.turro.financials.cart.Cart.serializeForOrder |
( |
IContact |
contact | ) |
|
Definition at line 241 of file Cart.java.
242 contactId = contact.
getId();
243 Serializer.serialize(
"/cart/" +
getOrder() +
".ser",
this);
◆ setDeliveryValue()
void org.turro.financials.cart.Cart.setDeliveryValue |
( |
String |
deliveryValue | ) |
|
Definition at line 90 of file Cart.java.
91 this.deliveryValue = deliveryValue;
◆ setPickup()
void org.turro.financials.cart.Cart.setPickup |
( |
boolean |
pickup | ) |
|
◆ setStatus()
void org.turro.financials.cart.Cart.setStatus |
( |
int |
status | ) |
|
◆ setWantBill()
void org.turro.financials.cart.Cart.setWantBill |
( |
boolean |
wantBill | ) |
|
Definition at line 74 of file Cart.java.
75 this.wantBill = wantBill;
The documentation for this class was generated from the following file: