144 Framework.setAttribute(
this,
"docTax", docTax.
getNumber());
149 Document doc =
new Document();
151 doc.setCurrency(doc.getContract().getCurrency());
152 doc.setDocumentDate(docDate.
getValue());
153 doc.setDocumentNumber(docNumber.getValue());
154 doc.setReceiptDate(docReceipt.
getValue());
157 DocumentLine nl =
new DocumentLine();
158 nl.setConcept(concept);
159 nl.setDiscountMoney(0);
160 nl.setDiscountPerCent(0);
164 nl.setContractPreference(nl.getLineType().getContractPreference());
167 nl.setProductByContractor(
null);
171 nl.setEquivalenceSurcharge(0);
173 doc.getDocumentLines().add(nl);
174 doc =
new DocumentWrapper(doc).save(
new ArrayList(doc.getDocumentLines()),
null);
178 Document expiry =
new Document();
180 DocumentWorkflow dw =
new DocumentWorkflow();
181 dw.setAncestor(doc.getDocumentDefinition());
182 dw.setDescendant(expiry.getDocumentDefinition());
183 expiry.flowFrom(doc,
new DocumentWrapper(doc).getDocDescription(), dw);
184 expiry.setDocumentNumber(doc.getDocumentNumber() +
"/1");
185 expiry.setDocumentDate(doc.getDocumentDate());
186 expiry.setReceiptDate(doc.getReceiptDate());
187 DocumentLine dl = expiry.getDocumentLines().iterator().next();
190 new DocumentWrapper(expiry).save(
new ArrayList(expiry.getDocumentLines()),
null);
192 FinancialsMenu.showDocument(doc);
193 Events.postEvent(
new Event(Events.ON_CLOSE,
this));