◆ createHandshakeFromDocument()
Definition at line 71 of file HandshakeDocument.java.
72 Company company = CompanyWrapper.getDefaultCompany();
74 HandshakeDocument hd =
new HandshakeDocument();
75 hd.contract = HandshakeContract.createHandshakeFromContract(document.getContract());
76 hd.documentName = document.getDocumentDefinition().getName();
77 hd.documentNumber = document.getDocumentNumber();
78 hd.documentDate = document.getDocumentDate();
79 hd.definitionId = mapDocumentDefinition(document);
80 for(DocumentLine dl : document.getDocumentLines()) {
82 HandshakeDocLine hdl =
new HandshakeDocLine();
83 hdl.concept = dl.getConcept();
84 hdl.discountMoney = dl.getDiscountMoney();
85 hdl.discountPerCent = dl.getDiscountPerCent();
86 hdl.equivalenceSurcharge = dl.getEquivalenceSurcharge();
87 hdl.price = dl.getPrice();
88 if(dl.getProduct() !=
null) {
89 hdl.product = HandshakeProduct.createHandshakeFromProduct(dl.getProduct());
91 hdl.quantity = dl.getQuantity();
92 hdl.retention = dl.getRetention();
93 hdl.tax = dl.getTax();
97 for(DocumentRelation dr : document.getDescendants()) {
98 Document doc = dr.getDescendant();
static HandshakeDocument createHandshakeFromDocument(Document document)
◆ createHandshakeFromFile()
static HandshakeDocument org.turro.financials.handshake.HandshakeDocument.createHandshakeFromFile |
( |
File |
file | ) |
|
|
static |
Definition at line 113 of file HandshakeDocument.java.
116 }
catch (IOException ex) {
117 Logger.getLogger(HandshakeDocument.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static HandshakeDocument createHandshakeFromJson(String value)
◆ createHandshakeFromJson()
static HandshakeDocument org.turro.financials.handshake.HandshakeDocument.createHandshakeFromJson |
( |
String |
value | ) |
|
|
static |
Definition at line 108 of file HandshakeDocument.java.
109 Gson gson =
new GsonBuilder().setDateFormat(
"yyyy/MM/dd").create();
110 return gson.fromJson(value, HandshakeDocument.class);
◆ createJsonFromDocument()
static String org.turro.financials.handshake.HandshakeDocument.createJsonFromDocument |
( |
Document |
document | ) |
|
|
static |
Definition at line 62 of file HandshakeDocument.java.
63 Gson gson =
new GsonBuilder().setDateFormat(
"yyyy/MM/dd").create();
66 return gson.toJson(hd);
◆ equals()
boolean org.turro.financials.handshake.HandshakeDocument.equals |
( |
Object |
obj | ) |
|
Definition at line 188 of file HandshakeDocument.java.
192 if (getClass() != obj.getClass()) {
195 final HandshakeDocument other = (HandshakeDocument) obj;
196 if (!Objects.equals(
this.contract, other.contract)) {
199 if (!Objects.equals(
this.documentNumber, other.documentNumber)) {
202 if (!Objects.equals(
this.documentDate, other.documentDate)) {
◆ existsHandshake()
static boolean org.turro.financials.handshake.HandshakeDocument.existsHandshake |
( |
HandshakeDocument |
hd | ) |
|
|
static |
Definition at line 152 of file HandshakeDocument.java.
154 if(!folder.exists()) { folder.mkdirs(); }
155 for(File file : folder.listFiles()) {
static final String HANDSHAKE_FOLDER
static HandshakeDocument createHandshakeFromFile(File file)
◆ getDocumentFromHandshake()
Definition at line 131 of file HandshakeDocument.java.
132 Dao dao =
new FinancialsPU();
133 return (Document) dao.getSingleResultOrNull(
134 "select d from Document d " +
135 "where d.contract.id = ? " +
136 "and d.documentNumber = ? " +
137 "and d.documentDate = ?",
HandshakeContract contract
◆ getProducts()
Iterable<HandshakeProduct> org.turro.financials.handshake.HandshakeDocument.getProducts |
( |
| ) |
|
Definition at line 208 of file HandshakeDocument.java.
209 Set<HandshakeProduct> products =
new HashSet<>();
210 addProducts(products,
this);
◆ hashCode()
int org.turro.financials.handshake.HandshakeDocument.hashCode |
( |
| ) |
|
◆ saveHandshakeDocument()
static void org.turro.financials.handshake.HandshakeDocument.saveHandshakeDocument |
( |
HandshakeDocument |
hd | ) |
|
|
static |
Definition at line 145 of file HandshakeDocument.java.
147 File file =
new File(ElephantContext.getRealPath(
HANDSHAKE_FOLDER) +
"/doc" + IdGenerator.generate() +
".handshake");
static boolean existsHandshake(HandshakeDocument hd)
static void saveHandshakeToFile(File file, HandshakeDocument hd)
◆ saveHandshakeToFile()
static void org.turro.financials.handshake.HandshakeDocument.saveHandshakeToFile |
( |
File |
file, |
|
|
HandshakeDocument |
hd |
|
) |
| |
|
static |
Definition at line 122 of file HandshakeDocument.java.
123 Gson gson =
new GsonBuilder().setDateFormat(
"yyyy/MM/dd").create();
125 FileUtil.setContent(file, gson.toJson(hd));
126 }
catch (IOException ex) {
127 Logger.getLogger(HandshakeContract.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ contract
◆ definitionId
long org.turro.financials.handshake.HandshakeDocument.definitionId |
◆ documentDate
Date org.turro.financials.handshake.HandshakeDocument.documentDate |
◆ documentName
String org.turro.financials.handshake.HandshakeDocument.documentName |
◆ documentNumber
String org.turro.financials.handshake.HandshakeDocument.documentNumber |
◆ expiries
List<HandshakeDocument> org.turro.financials.handshake.HandshakeDocument.expiries = new ArrayList<>() |
◆ HANDSHAKE_FOLDER
final String org.turro.financials.handshake.HandshakeDocument.HANDSHAKE_FOLDER = "/WEB-INF/handshake/document" |
|
static |
◆ lines
List<HandshakeDocLine> org.turro.financials.handshake.HandshakeDocument.lines = new ArrayList<>() |
The documentation for this class was generated from the following file: