◆ execute()
Object org.turro.financials.document.action.CloneDocumentAction.execute |
( |
Context |
context | ) |
|
Definition at line 42 of file CloneDocumentAction.java.
43 final Document nd =
new Document(),
44 doc = (Document) context.get(
"entity");
46 Framework.getCurrent().getPage(),
49 new InputField(
"Contract",
null,
null, 0) {
51 protected HtmlBasedComponent createEditor() {
52 ContractCombobox ccb =
new ContractCombobox();
53 ccb.setOnlyActive(
true);
54 ccb.setDocumentDefinition(doc.getDocumentDefinition());
55 ccb.setObjectValue(doc.getContract());
59 new InputField(
"Date",
null,
null, 0) {
61 protected HtmlBasedComponent createEditor() {
62 return new DateboxShort((Date) Framework.getAttribute(
this,
"date"));
65 new InputField(
"Draft", (Boolean) Framework.getAttribute(
this,
"draft",
false),
null, 0)
68 public Object
execute(Context context) {
69 InputField[] fields = (InputField[]) context.get(
"fields");
70 Contract contract =
null;
72 Boolean draft =
false;
73 if (fields.length > 0) {
74 for (InputField f : fields) {
75 if (
"Contract".equals(f.getLabel())) {
76 contract = (Contract) f.getValue();
77 }
else if (
"Date".equals(f.getLabel())) {
78 date = (Date) f.getValue();
79 Framework.setAttribute(
this,
"date", date);
80 }
else if (
"Draft".equals(f.getLabel())) {
81 draft = (Boolean) f.getValue();
82 Framework.setAttribute(
this,
"draft", draft);
85 if (contract !=
null) {
86 nd.setContract(contract);
87 nd.copyFrom(doc, nd.getContract().getId() != doc.getContract().getId());
89 nd.setDocumentDate(date);
90 nd.setReceiptDate(date);
95 if (nd.getDocumentDefinition().isAutoNumbered()) {
96 nd.setDocumentNumber(
"");
98 FinancialsMenu.showDocument(nd);
Object execute(Context context)
◆ getImage()
String org.turro.financials.document.action.CloneDocumentAction.getImage |
( |
| ) |
|
◆ getLabel()
String org.turro.financials.document.action.CloneDocumentAction.getLabel |
( |
| ) |
|
The documentation for this class was generated from the following file: