]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/staff_client/chrome/content/evergreen/circ/receipt_template_editor.xul
receipt template editor
[Evergreen.git] / Evergreen / staff_client / chrome / content / evergreen / circ / receipt_template_editor.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: About -->
4
5 <!-- Stylesheets -->
6 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
7 <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
8
9 <window id="itemsout_receipt_template_win" 
10         onload="try { my_init(); } catch(E) { alert(E); }"
11         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
12
13         <script>mw.sdump('D_TRACE','Loading itemsout_receipt_template.xul\n');</script>
14
15         <script>
16         <![CDATA[
17                 var test_patron = mw.JSON2js('/*--S au --*/[null,null,null,[/*--S aua --*/[null,null,null,"work","CITY","USA","Fulton","13","30043","GA","123 street road","#AR54","18","1"]/*--E aua --*/,/*--S aua --*/[null,null,null,"Vacation","PC Beach","USA","PC County","42","01010","FL","111 A Street","Unit #12A","18","1"]/*--E aua --*/],[/*--S ac --*/[null,null,null,"1","21099000006699","14","18"]/*--E ac --*/],[{"circ":/*--S aoc --*/[null,null,null,"212","2005-07-05 04:58:02-04","14 days","2wk_default","1 day","134","50.00","books","0.10","books","1","1",null,"11","18",null,"2005-07-19 10:38:25.211964-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"31041005404709","11",null,"212",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-05-06 11:13:05.063398-04","1","2","1","11","2","1","1","0.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Albrand, Martha.",[],null,"3",null,null,"",[],"1959","Random House",null,[],[],null,"PIN01000004 ","A  day in Monte Carlo",["text"]]/*--E mvr --*/},{"circ":/*--S aoc --*/[null,null,null,"12","2005-08-04 11:31:02-04","14 days","2wk_default","1 day","171","50.00","books","0.10","books","0","2",null,"2139800","18",null,"2005-07-21 17:11:44.203345-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"33207000838641","1938753",null,"10",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-07-21 17:08:53.504341-04","1","2","1","2139800","2","1","1","10.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Sproule, Anna.",[],null,"330278",null,null,"0531182150 (lib. bdg.)",[],"1988","Bookwright Press",null,["Know your pet"],[["Dogs"],["Dog breeds"]],"Discusses how to choose and care for a pet dog and provides information on various breeds.","PIN03092988 ","Dogs",["text"]]/*--E mvr --*/},{"circ":/*--S aoc --*/[null,null,null,"1","2005-08-05 14:36:02-04","14 days","2wk_default","1 day","173","50.00","books","0.10","books","0","2",null,"1329873","18",null,"2005-07-22 20:17:07.199888-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"34520000676111","1187974",null,"182",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-05-06 11:13:05.063398-04","1","2","1","1329873","2","1","1","0.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Margolis, Matthew.",[],null,"97448",null,"1st Vintage Books ed.","0394711742 (pbk.) :",[],"1982, c1979","Vintage Books",null,[],[["Dogs"]],null,"PIN02040633 ","The  dog in your life a complete guide to choosing, raising, feeding, training, and caring for your dog plus sections on show dogs, hunting dogs, coursing dogs, herd dogs, sled dogs, guard dogs, guide dogs, and a discussion of common canine illnesses",["text"]]/*--E mvr --*/}],[/*--S ahr --*/[null,null,null,"Copy found, waiting for capture",null,"3601016","email2@somewheres.info",null,null,"T",null,"45","800.555.0000","12","2005-07-24 15:47:42.091479-04","2005-07-21 16:35:16.026892-04","18","0","847314","18"]/*--E ahr --*/,/*--S ahr --*/[null,null,null,"Copy found, waiting for capture",null,"1386122","email2@somewheres.info",null,null,"T",null,"46","800.555.0000","12","2005-07-24 15:47:45.240195-04","2005-07-21 16:40:12.783469-04","18","0","152833","18"]/*--E ahr --*/,/*--S ahr --*/[null,null,null,"Available","2005-07-21 17:04:11.853992-04","548582","email2@somewheres.info",null,null,"T",null,"47","800.555.0000","12","2005-07-21 17:03:49.248665-04","2005-07-21 17:03:10.523049-04","18","0","23932","18"]/*--E ahr --*/],null,[/*--S actscecm --*/[null,null,null,"40","17","Yes","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"14","2","Yes","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"46","18","test2","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"42","16","","18"]/*--E actscecm --*/],null,"1",null,/*--S aua --*/[null,null,null,"Vacation","PC Beach","USA","PC County","42","01010","FL","111 A Street","Unit #12A","18","1"]/*--E aua --*/,/*--S ac --*/[null,null,null,"1","21099000006699","14","18"]/*--E ac --*/,"0","2005-05-13","0.00","800.555.0000","1900-01-02","email2@somewheres.info",null,"2008-05-13","Erickson","Bill","10","18","5","2","345","365","1122211188.708583190.17503114108",/*--S aua --*/[null,null,null,"work","CITY","USA","Fulton","13","30043","GA","123 street road","#AR54","18","1"]/*--E aua --*/,"0","1",null,null,null,"Councilperson","3",null,"1","Jr","0","18","erickson"]/*--E au --*/');
18
19                 function my_init() {
20                         document.getElementById('itemsout_header_tb').value = mw.G.itemsout_header;
21                         document.getElementById('itemsout_line_item_tb').value = mw.G.itemsout_line_item;
22                         document.getElementById('itemsout_footer_tb').value = mw.G.itemsout_footer;
23                         document.getElementById('checkout_header_tb').value = mw.G.checkout_header;
24                         document.getElementById('checkout_line_item_tb').value = mw.G.checkout_line_item;
25                         document.getElementById('checkout_footer_tb').value = mw.G.checkout_footer;
26                         document.getElementById('checkin_header_tb').value = mw.G.checkin_header;
27                         document.getElementById('checkin_line_item_tb').value = mw.G.checkin_line_item;
28                         document.getElementById('checkin_footer_tb').value = mw.G.checkin_footer;
29                         document.getElementById('holds_header_tb').value = mw.G.holds_header;
30                         document.getElementById('holds_line_item_tb').value = mw.G.holds_line_item;
31                         document.getElementById('holds_footer_tb').value = mw.G.holds_footer;
32                 }
33
34                 function test_itemsout() {
35                         var params = { 
36                                 'au' : test_patron, 
37                                 'lib' : mw.G.user_ou,
38                                 'header' : document.getElementById('itemsout_header_tb').value,
39                                 'line_item' : document.getElementById('itemsout_line_item_tb').value,
40                                 'footer' : document.getElementById('itemsout_footer_tb').value
41                         };
42                         mw.print_itemsout_receipt( params );
43                 }
44
45                 function save_itemsout() {
46                         mw.G.itemsout_header = document.getElementById('itemsout_header_tb').value;
47                         mw.G.itemsout_line_item = document.getElementById('itemsout_line_item_tb').value;
48                         mw.G.itemsout_footer = document.getElementById('itemsout_footer_tb').value;
49                 }
50
51                 function test_checkout() {
52                         var params = { 
53                                 'au' : test_patron, 
54                                 'lib' : mw.G.user_ou,
55                                 'header' : document.getElementById('checkout_header_tb').value,
56                                 'line_item' : document.getElementById('checkout_line_item_tb').value,
57                                 'footer' : document.getElementById('checkout_footer_tb').value
58                         };
59                         mw.print_checkout_receipt( params );
60                 }
61
62                 function save_checkout() {
63                         mw.G.checkout_header = document.getElementById('checkout_header_tb').value;
64                         mw.G.checkout_line_item = document.getElementById('checkout_line_item_tb').value;
65                         mw.G.checkout_footer = document.getElementById('checkout_footer_tb').value;
66                 }
67
68                 function test_checkin() {
69                         var params = { 
70                                 'au' : test_patron, 
71                                 'lib' : mw.G.user_ou,
72                                 'header' : document.getElementById('checkin_header_tb').value,
73                                 'line_item' : document.getElementById('checkin_line_item_tb').value,
74                                 'footer' : document.getElementById('checkin_footer_tb').value
75                         };
76                         mw.print_checkin_receipt( params );
77                 }
78
79                 function save_checkin() {
80                         mw.G.checkin_header = document.getElementById('checkin_header_tb').value;
81                         mw.G.checkin_line_item = document.getElementById('checkin_line_item_tb').value;
82                         mw.G.checkin_footer = document.getElementById('checkin_footer_tb').value;
83                 }
84
85                 function test_holds() {
86                         var params = { 
87                                 'au' : test_patron, 
88                                 'lib' : mw.G.user_ou,
89                                 'header' : document.getElementById('holds_header_tb').value,
90                                 'line_item' : document.getElementById('holds_line_item_tb').value,
91                                 'footer' : document.getElementById('holds_footer_tb').value
92                         };
93                         mw.print_holds_receipt( params );
94                 }
95
96                 function save_holds() {
97                         mw.G.holds_header = document.getElementById('holds_header_tb').value;
98                         mw.G.holds_line_item = document.getElementById('holds_line_item_tb').value;
99                         mw.G.holds_footer = document.getElementById('holds_footer_tb').value;
100                 }
101
102         ]]>
103         </script>
104
105         <vbox flex="1" class="my_overflow">
106                 <groupbox orient="vertical" flex="1">
107                         <caption label="Receipt Template Editor"/>
108                         <hbox flex="1">
109                                 <groupbox orient="vertical" flex="1">
110                                         <caption label="DESCRIPTION" />
111                                         <hbox flex="1">
112                                                 <iframe flex="1" src="data:text/html,&lt;html&gt;&lt;p&gt;Please note that this interface is for testing purposes, and that modifications you make here will not persist between different invocations of the staff client.  In future versions of the software, you will be able to save and share named templates.&lt;/p&gt;&lt;p&gt;The following macros get evaluated and substituted for each receipt printed: %LIBRARY% %PINES_CODE% %PATRON_LASTNAME% %PATRON_FIRSTNAME% %PATRON_MIDDLENAME% %PATRON_BARCODE% %TODAY% %OUT% %DUE% %DURATION% %COPY_BARCODE% %TITLE% %AUTHOR% %PUBLISHER% %PUBDATE% %NUMBER%&lt;/p&gt;&lt;p&gt;If there's a specific macro you would like to see, please let us know.  There will be variations on these for handling truncation and date formats.  See the examples.&lt;/p&gt;&lt;/html&gt;" />;
113                                         </hbox>
114                                 </groupbox>
115                                 <groupbox orient="vertical" flex="1">
116                                         <caption label="TEMPLATES" />
117                                 <tabbox flex="1">
118                                         <tabs>
119                                                 <tab label="Items Out"/>
120                                                 <tab label="Holds"/>
121                                                 <tab label="Check Out"/>
122                                                 <tab label="Check In"/>
123                                         </tabs>
124                                         <tabpanels flex="1">
125                                                 <tabpanel>
126                                                         <vbox flex="1">
127                                                                 <groupbox orient="vertical" flex="1">
128                                                                         <caption label="Header"/>
129                                                                         <textbox id="itemsout_header_tb" multiline="true" flex="1"/>
130                                                                 </groupbox>
131                                                                 <groupbox orient="vertical" flex="1">
132                                                                         <caption label="Line Item"/>
133                                                                         <textbox id="itemsout_line_item_tb" multiline="true" flex="1"/>
134                                                                 </groupbox>
135                                                                 <groupbox orient="vertical" flex="1">
136                                                                         <caption label="Footer"/>
137                                                                         <textbox id="itemsout_footer_tb" multiline="true" flex="1"/>
138                                                                 </groupbox>
139                                                                 <hbox>
140                                                                         <spacer flex="1"/>
141                                                                         <button label="Test" accesskey="T" oncommand="test_itemsout();"/>
142                                                                         <button label="Save" accesskey="S" oncommand="save_itemsout();"/>
143                                                                 </hbox>
144                                                         </vbox>
145                                                 </tabpanel>
146                                                 <tabpanel>
147                                                         <vbox flex="1">
148                                                                 <groupbox orient="vertical" flex="1">
149                                                                         <caption label="Header"/>
150                                                                         <textbox id="checkout_header_tb" multiline="true" flex="1"/>
151                                                                 </groupbox>
152                                                                 <groupbox orient="vertical" flex="1">
153                                                                         <caption label="Line Item"/>
154                                                                         <textbox id="checkout_line_item_tb" multiline="true" flex="1"/>
155                                                                 </groupbox>
156                                                                 <groupbox orient="vertical" flex="1">
157                                                                         <caption label="Footer"/>
158                                                                         <textbox id="checkout_footer_tb" multiline="true" flex="1"/>
159                                                                 </groupbox>
160                                                                 <hbox>
161                                                                         <spacer flex="1"/>
162                                                                         <button label="Test" accesskey="T" oncommand="test_checkout();"/>
163                                                                         <button label="Save" accesskey="S" oncommand="save_checkout();"/>
164                                                                 </hbox>
165                                                         </vbox>
166                                                 </tabpanel>
167                                                 <tabpanel>
168                                                         <vbox flex="1">
169                                                                 <groupbox orient="vertical" flex="1">
170                                                                         <caption label="Header"/>
171                                                                         <textbox id="checkin_header_tb" multiline="true" flex="1"/>
172                                                                 </groupbox>
173                                                                 <groupbox orient="vertical" flex="1">
174                                                                         <caption label="Line Item"/>
175                                                                         <textbox id="checkin_line_item_tb" multiline="true" flex="1"/>
176                                                                 </groupbox>
177                                                                 <groupbox orient="vertical" flex="1">
178                                                                         <caption label="Footer"/>
179                                                                         <textbox id="checkin_footer_tb" multiline="true" flex="1"/>
180                                                                 </groupbox>
181                                                                 <hbox>
182                                                                         <spacer flex="1"/>
183                                                                         <button label="Test" accesskey="T" oncommand="test_checkin();"/>
184                                                                         <button label="Save" accesskey="S" oncommand="save_checkin();"/>
185                                                                 </hbox>
186                                                         </vbox>
187                                                 </tabpanel>
188                                                 <tabpanel>
189                                                         <vbox flex="1">
190                                                                 <groupbox orient="vertical" flex="1">
191                                                                         <caption label="Header"/>
192                                                                         <textbox id="holds_header_tb" multiline="true" flex="1"/>
193                                                                 </groupbox>
194                                                                 <groupbox orient="vertical" flex="1">
195                                                                         <caption label="Line Item"/>
196                                                                         <textbox id="holds_line_item_tb" multiline="true" flex="1"/>
197                                                                 </groupbox>
198                                                                 <groupbox orient="vertical" flex="1">
199                                                                         <caption label="Footer"/>
200                                                                         <textbox id="holds_footer_tb" multiline="true" flex="1"/>
201                                                                 </groupbox>
202                                                                 <hbox>
203                                                                         <spacer flex="1"/>
204                                                                         <button label="Test" accesskey="T" oncommand="test_holds();"/>
205                                                                         <button label="Save" accesskey="S" oncommand="save_holds();"/>
206                                                                 </hbox>
207                                                         </vbox>
208                                                 </tabpanel>
209                                         </tabpanels>
210                                 </tabbox>
211                                 </groupbox>
212                         </hbox>
213                 </groupbox>
214         </vbox>
215
216 </window>
217