Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
37378 amit 1
package com.spice.profitmandi.web.model;
2
 
3
import java.time.LocalDateTime;
4
import java.time.format.DateTimeFormatter;
5
import java.time.temporal.ChronoUnit;
6
 
7
/**
8
 * One row of the Sale Returns action-pending queue. A pending return can exist in two shapes -
9
 * a debit note the warehouse has not received yet (no purchase return order at all), or a return
10
 * order that is received/rejected but not settled - so the screen needs a single flattened row
11
 * rather than the two entity types.
12
 */
13
public class SaleReturnRow {
14
 
15
	public static final String ACTION_RECEIVE = "RECEIVE";
16
	public static final String ACTION_REFUND = "REFUND";
17
	public static final String ACTION_ACKNOWLEDGE = "ACKNOWLEDGE";
18
	public static final String ACTION_APPROVE = "APPROVE";
19
 
20
	private Integer debitNoteId;
21
	private String debitNoteNumber;
22
	private Integer purchaseReturnOrderId;
23
	private String invoiceNumber;
24
	private String partnerName;
25
	private String warehouseName;
26
	private String statusLabel;
27
	private String statusStyle;
28
	private String dateLabel;
29
	private LocalDateTime pendingSince;
30
	private String pendingAction;
31
 
32
	public Integer getDebitNoteId() {
33
		return debitNoteId;
34
	}
35
 
36
	public void setDebitNoteId(Integer debitNoteId) {
37
		this.debitNoteId = debitNoteId;
38
	}
39
 
40
	public String getDebitNoteNumber() {
41
		return debitNoteNumber;
42
	}
43
 
44
	public void setDebitNoteNumber(String debitNoteNumber) {
45
		this.debitNoteNumber = debitNoteNumber;
46
	}
47
 
48
	public Integer getPurchaseReturnOrderId() {
49
		return purchaseReturnOrderId;
50
	}
51
 
52
	public void setPurchaseReturnOrderId(Integer purchaseReturnOrderId) {
53
		this.purchaseReturnOrderId = purchaseReturnOrderId;
54
	}
55
 
56
	public String getInvoiceNumber() {
57
		return invoiceNumber;
58
	}
59
 
60
	public void setInvoiceNumber(String invoiceNumber) {
61
		this.invoiceNumber = invoiceNumber;
62
	}
63
 
64
	public String getPartnerName() {
65
		return partnerName;
66
	}
67
 
68
	public void setPartnerName(String partnerName) {
69
		this.partnerName = partnerName;
70
	}
71
 
72
	public String getWarehouseName() {
73
		return warehouseName;
74
	}
75
 
76
	public void setWarehouseName(String warehouseName) {
77
		this.warehouseName = warehouseName;
78
	}
79
 
80
	public String getStatusLabel() {
81
		return statusLabel;
82
	}
83
 
84
	public void setStatusLabel(String statusLabel) {
85
		this.statusLabel = statusLabel;
86
	}
87
 
88
	public String getStatusStyle() {
89
		return statusStyle;
90
	}
91
 
92
	public void setStatusStyle(String statusStyle) {
93
		this.statusStyle = statusStyle;
94
	}
95
 
96
	public String getDateLabel() {
97
		return dateLabel;
98
	}
99
 
100
	public void setDateLabel(String dateLabel) {
101
		this.dateLabel = dateLabel;
102
	}
103
 
104
	public LocalDateTime getPendingSince() {
105
		return pendingSince;
106
	}
107
 
108
	public void setPendingSince(LocalDateTime pendingSince) {
109
		this.pendingSince = pendingSince;
110
	}
111
 
112
	public String getPendingAction() {
113
		return pendingAction;
114
	}
115
 
116
	public void setPendingAction(String pendingAction) {
117
		this.pendingAction = pendingAction;
118
	}
119
 
120
	public String getFormattedPendingSince() {
121
		if (pendingSince == null) return null;
122
		return pendingSince.format(DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm"));
123
	}
124
 
125
	public long getPendingDays() {
126
		if (pendingSince == null) return 0;
127
		return ChronoUnit.DAYS.between(pendingSince, LocalDateTime.now());
128
	}
129
}