2 // Copyright (C) 2010 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
10 // Product Name (blank where repeated)
11 // Warehouse Name (blank where repeated) or Total for Product
12 // Starting Inventory (detail lines: date)
13 // Ending Inventory (detail lines: invoice ID)
19 //SANITIZE ALL ESCAPES
20 $sanitize_all_escapes=true;
23 //STOP FAKE REGISTER GLOBALS
24 $fake_register_globals=false;
27 require_once("../globals.php");
28 require_once("$srcdir/patient.inc");
29 require_once("$srcdir/sql-ledger.inc");
30 require_once("$srcdir/acl.inc");
31 require_once("$srcdir/formatting.inc.php");
33 // Specify if product or warehouse is the first column.
34 $product_first = (!empty($_POST['form_by']) && $_POST['form_by'] == 'w') ?
0 : 1;
36 $last_warehouse_id = '~';
39 function esc4Export($str) {
40 return str_replace('"', '\\"', $str);
43 // Get ending inventory for the report's end date.
44 // Optionally restricts by product ID and/or warehouse ID.
45 function getEndInventory($product_id = 0, $warehouse_id = '~') {
46 global $form_from_date, $form_to_date, $form_product;
49 if ($warehouse_id !== '~') {
50 $whidcond = $warehouse_id === '' ?
51 "AND ( di.warehouse_id IS NULL OR di.warehouse_id = '' )" :
52 "AND di.warehouse_id = '$warehouse_id'";
56 if ($form_product) $product_id = $form_product;
58 $prodcond = "AND di.drug_id = '$product_id'";
61 // Get sum of current inventory quantities + destructions done after the
62 // report end date (which is effectively a type of transaction).
63 $eirow = sqlQuery("SELECT sum(di.on_hand) AS on_hand " .
64 "FROM drug_inventory AS di WHERE " .
65 "( di.destroy_date IS NULL OR di.destroy_date > '$form_to_date' ) " .
66 "$prodcond $whidcond");
68 // Get sum of sales/adjustments/purchases after the report end date.
69 $sarow = sqlQuery("SELECT sum(ds.quantity) AS quantity " .
70 "FROM drug_sales AS ds, drug_inventory AS di WHERE " .
71 "ds.sale_date > '$form_to_date' AND " .
72 "di.inventory_id = ds.inventory_id " .
73 "$prodcond $whidcond");
75 // Get sum of transfers out after the report end date.
76 $xfrow = sqlQuery("SELECT sum(ds.quantity) AS quantity " .
77 "FROM drug_sales AS ds, drug_inventory AS di WHERE " .
78 "ds.sale_date > '$form_to_date' AND " .
79 "di.inventory_id = ds.xfer_inventory_id " .
80 "$prodcond $whidcond");
82 return $eirow['on_hand'] +
$sarow['quantity'] - $xfrow['quantity'];
85 function thisLineItem($product_id, $warehouse_id, $patient_id, $encounter_id,
86 $rowprod, $rowwh, $transdate, $qtys, $irnumber='')
88 global $warehouse, $product, $secqtys, $priqtys, $grandqtys;
89 global $whleft, $prodleft; // left 2 columns, blank where repeated
90 global $last_warehouse_id, $last_product_id, $product_first;
93 $invnumber = empty($irnumber) ?
($patient_id ?
"$patient_id.$encounter_id" : "") : $irnumber;
95 // Product name for this detail line item.
96 if (empty($rowprod)) $rowprod = 'Unnamed Product';
98 // Warehouse name for this line item.
99 if (empty($rowwh)) $rowwh = 'None';
101 // If new warehouse or product...
102 if ($warehouse_id != $last_warehouse_id ||
$product_id != $last_product_id) {
104 // If there was anything to total...
105 if (($product_first && $last_warehouse_id != '~') ||
(!$product_first && $last_product_id)) {
107 $secei = getEndInventory($last_product_id, $last_warehouse_id);
109 // Print second-column totals.
110 if ($form_action == 'export') {
112 if (! $_POST['form_details']) {
113 if ($product_first) {
114 echo '"' . esc4Export($product) . '"';
115 echo ',"' . esc4Export($warehouse) . '"';
117 echo '"' . esc4Export($warehouse) . '"';
118 echo ',"' . esc4Export($product) . '"';
120 echo ',"' . ($secei - $secqtys[0] - $secqtys[1] - $secqtys[2] - $secqtys[3] - $secqtys[4]) . '"'; // start inventory
121 echo ',"' . $secqtys[0] . '"'; // sales
122 echo ',"' . $secqtys[1] . '"'; // distributions
123 echo ',"' . $secqtys[2] . '"'; // purchases
124 echo ',"' . $secqtys[3] . '"'; // transfers
125 echo ',"' . $secqtys[4] . '"'; // adjustments
126 echo ',"' . $secei . '"'; // end inventory
133 <tr bgcolor
="#ddddff">
134 <?php
if ($product_first) { ?
>
136 <?php
echo htmlspecialchars($prodleft); $prodleft = " "; ?
>
138 <td
class="detail" colspan
='3'>
139 <?php
if ($_POST['form_details']) echo htmlspecialchars(xl('Total for')) . ' '; echo htmlspecialchars($warehouse); ?
>
143 <?php
echo htmlspecialchars($whleft); $whleft = " "; ?
>
145 <td
class="detail" colspan
='3'>
146 <?php
if ($_POST['form_details']) echo htmlspecialchars(xl('Total for')) . ' '; echo htmlspecialchars($product); ?
>
149 <td
class="dehead" align
="right">
150 <?php
echo $secei - $secqtys[0] - $secqtys[1] - $secqtys[2] - $secqtys[3] - $secqtys[4]; ?
>
152 <td
class="dehead" align
="right">
153 <?php
echo $secqtys[0]; ?
>
155 <td
class="dehead" align
="right">
156 <?php
echo $secqtys[1]; ?
>
158 <td
class="dehead" align
="right">
159 <?php
echo $secqtys[2]; ?
>
161 <td
class="dehead" align
="right">
162 <?php
echo $secqtys[3]; ?
>
164 <td
class="dehead" align
="right">
165 <?php
echo $secqtys[4]; ?
>
167 <td
class="dehead" align
="right">
168 <?php
echo $secei; ?
>
172 } // End not csv export
174 $secqtys = array(0, 0, 0, 0, 0);
175 if ($product_first ) {
176 $whleft = $warehouse = $rowwh;
177 $last_warehouse_id = $warehouse_id;
179 $prodleft = $product = $rowprod;
180 $last_product_id = $product_id;
184 // If first column is changing, time for its totals.
185 if (($product_first && $product_id != $last_product_id) ||
186 (!$product_first && $warehouse_id != $last_warehouse_id))
188 if (($product_first && $last_product_id) ||
189 (!$product_first && $last_warehouse_id != '~'))
191 $priei = $product_first ?
getEndInventory($last_product_id) :
192 getEndInventory(0, $last_warehouse_id);
193 // Print first column total.
194 if ($form_action != 'export') {
197 <tr bgcolor
="#ffdddd">
201 <td
class="detail" colspan
="3">
202 <?php
echo htmlspecialchars(xl('Total for')) . ' '; echo htmlspecialchars($product_first ?
$product : $warehouse); ?
>
204 <td
class="dehead" align
="right">
205 <?php
echo $priei - $priqtys[0] - $priqtys[1] - $priqtys[2] - $priqtys[3] - $priqtys[4]; ?
>
207 <td
class="dehead" align
="right">
208 <?php
echo $priqtys[0]; ?
>
210 <td
class="dehead" align
="right">
211 <?php
echo $priqtys[1]; ?
>
213 <td
class="dehead" align
="right">
214 <?php
echo $priqtys[2]; ?
>
216 <td
class="dehead" align
="right">
217 <?php
echo $priqtys[3]; ?
>
219 <td
class="dehead" align
="right">
220 <?php
echo $priqtys[4]; ?
>
222 <td
class="dehead" align
="right">
223 <?php
echo $priei; ?
>
227 } // End not csv export
229 $priqtys = array(0, 0, 0, 0, 0);
230 if ($product_first) {
231 $prodleft = $product = $rowprod;
232 $last_product_id = $product_id;
234 $whleft = $warehouse = $rowwh;
235 $last_warehouse_id = $warehouse_id;
240 if ($_POST['form_details'] && $product_id && ($qtys[0] +
$qtys[1] +
$qtys[2] +
$qtys[3] +
$qtys[4])) {
241 if ($form_action == 'export') {
242 if ($product_first) {
243 echo '"' . esc4Export($product ) . '"';
244 echo ',"' . esc4Export($warehouse) . '"';
246 echo '"' . esc4Export($warehouse) . '"';
247 echo ',"' . esc4Export($product) . '"';
249 echo ',"' . oeFormatShortDate($transdate) . '"';
250 echo ',"' . esc4Export($invnumber) . '"';
251 echo ',"' . $qtys[0] . '"'; // sales
252 echo ',"' . $qtys[1] . '"'; // distributions
253 echo ',"' . $qtys[2] . '"'; // purchases
254 echo ',"' . $qtys[3] . '"'; // transfers
255 echo ',"' . $qtys[4] . '"'; // adjustments
261 <?php
if ($product_first) { ?
>
263 <?php
echo htmlspecialchars($prodleft); $prodleft = " "; ?
>
266 <?php
echo htmlspecialchars($whleft); $whleft = " "; ?
>
270 <?php
echo htmlspecialchars($whleft); $whleft = " "; ?
>
273 <?php
echo htmlspecialchars($prodleft); $prodleft = " "; ?
>
277 <?php
echo oeFormatShortDate($transdate); ?
>
280 <?php
echo htmlspecialchars($invnumber); ?
>
285 <td
class="dehead" align
="right">
286 <?php
echo $qtys[0]; ?
>
288 <td
class="dehead" align
="right">
289 <?php
echo $qtys[1]; ?
>
291 <td
class="dehead" align
="right">
292 <?php
echo $qtys[2]; ?
>
294 <td
class="dehead" align
="right">
295 <?php
echo $qtys[3]; ?
>
297 <td
class="dehead" align
="right">
298 <?php
echo $qtys[4]; ?
>
305 } // End not csv export
307 for ($i = 0; $i < 5; ++
$i) {
308 $secqtys[$i] +
= $qtys[$i];
309 $priqtys[$i] +
= $qtys[$i];
310 $grandqtys[$i] +
= $qtys[$i];
314 if (! acl_check('acct', 'rep')) die(htmlspecialchars(xl("Unauthorized access.")));
316 // this is "" or "submit" or "export".
317 $form_action = $_POST['form_action'];
319 $form_from_date = fixDate($_POST['form_from_date'], date('Y-m-d'));
320 $form_to_date = fixDate($_POST['form_to_date'] , date('Y-m-d'));
321 $form_product = $_POST['form_product'];
323 if ($form_action == 'export') {
324 header("Pragma: public");
325 header("Expires: 0");
326 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
327 header("Content-Type: application/force-download");
328 header("Content-Disposition: attachment; filename=inventory_activity.csv");
329 header("Content-Description: File Transfer");
331 if ($product_first) {
332 echo '"' . esc4export(xl('Product' )) . '",';
333 echo '"' . esc4export(xl('Warehouse')) . '",';
335 echo '"' . esc4export(xl('Warehouse')) . '",';
336 echo '"' . esc4export(xl('Product' )) . '",';
338 if ($_POST['form_details']) {
339 echo '"' . esc4export(xl('Date' )) . '",';
340 echo '"' . esc4export(xl('Invoice' )) . '",';
341 echo '"' . esc4export(xl('Sales' )) . '",';
342 echo '"' . esc4export(xl('Distributions')) . '",';
343 echo '"' . esc4export(xl('Purchases' )) . '",';
344 echo '"' . esc4export(xl('Transfers' )) . '",';
345 echo '"' . esc4export(xl('Adjustments' )) . '"' . "\n";
348 echo '"' . esc4export(xl('Start' )) . '",';
349 echo '"' . esc4export(xl('Sales' )) . '",';
350 echo '"' . esc4export(xl('Distributions')) . '",';
351 echo '"' . esc4export(xl('Purchases' )) . '",';
352 echo '"' . esc4export(xl('Transfers' )) . '",';
353 echo '"' . esc4export(xl('Adjustments' )) . '",';
354 echo '"' . esc4export(xl('End' )) . '"' . "\n";
361 <?php
html_header_show();?
>
362 <title
><?php
echo htmlspecialchars(xl('Inventory Activity')) ?
></title
>
364 <link rel
='stylesheet' href
='<?php echo $css_header ?>' type
='text/css'>
366 <style type
="text/css">
367 /* specifically include & exclude from printing */
369 #report_parameters {visibility: hidden; display: none;}
370 #report_parameters_daterange {visibility: visible; display: inline;}
371 #report_results {margin-top: 30px;}
373 /* specifically exclude some from the screen */
375 #report_parameters_daterange {visibility: hidden; display: none;}
377 body
{ font
-family
:sans
-serif
; font
-size
:10pt
; font
-weight
:normal
}
378 .dehead
{ color
:#000000; font-family:sans-serif; font-size:10pt; font-weight:bold }
379 .detail
{ color
:#000000; font-family:sans-serif; font-size:10pt; font-weight:normal }
382 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
383 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
384 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
385 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
386 <script type
="text/javascript" src
="../../library/textformat.js"></script
>
387 <script language
='JavaScript'>
388 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
389 function mysubmit(action
) {
390 var f
= document
.forms
[0];
391 f
.form_action
.value
= action
;
392 top
.restoreSession();
399 <body leftmargin
='0' topmargin
='0' marginwidth
='0' marginheight
='0' class='body_top'>
403 <h2
><?php
echo htmlspecialchars(xl('Inventory Activity'))?
></h2
>
405 <form method
='post' action
='inventory_activity.php?product=<?php echo htmlspecialchars($product_first, ENT_QUOTES); ?>'>
407 <div id
="report_parameters">
408 <!-- form_action is set to
"submit" or "export" at form submit time
-->
409 <input type
='hidden' name
='form_action' value
='' />
416 <?php
echo htmlspecialchars(xl('By')); ?
>:
419 <select name
='form_by'>
420 <option value
='p'><?php
echo htmlspecialchars(xl('Product')); ?
></option
>
421 <option value
='w'<?php
if (!$product_first) echo ' selected'; ?
>><?php
echo htmlspecialchars(xl('Warehouse')); ?
></option
>
425 <?php
echo htmlspecialchars(xl('From')); ?
>:
428 <input type
='text' name
='form_from_date' id
="form_from_date" size
='10'
429 value
='<?php echo htmlspecialchars($form_from_date, ENT_QUOTES) ?>'
430 title
='<?php echo htmlspecialchars(xl('yyyy
-mm
-dd
'), ENT_QUOTES) ?>'
431 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'>
432 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
433 id
='img_from_date' border
='0' alt
='[?]' style
='cursor:pointer'
434 title
='<?php echo htmlspecialchars(xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
437 <?php
echo htmlspecialchars(xl('To')); ?
>:
440 <input type
='text' name
='form_to_date' id
="form_to_date" size
='10'
441 value
='<?php echo htmlspecialchars($form_to_date, ENT_QUOTES) ?>'
442 title
='<?php echo htmlspecialchars(xl('yyyy
-mm
-dd
'), ENT_QUOTES) ?>'
443 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'>
444 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
445 id
='img_to_date' border
='0' alt
='[?]' style
='cursor:pointer'
446 title
='<?php echo htmlspecialchars(xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
451 <?php
echo htmlspecialchars(xl('For'), ENT_NOQUOTES
); ?
>:
455 // Build a drop-down list of products.
457 $query = "SELECT drug_id, name FROM drugs ORDER BY name, drug_id";
458 $pres = sqlStatement($query);
459 echo " <select name='form_product'>\n";
460 echo " <option value=''>-- " . htmlspecialchars(xl('All Products')) . " --\n";
461 while ($prow = sqlFetchArray($pres)) {
462 $drug_id = $prow['drug_id'];
463 echo " <option value='$drug_id'";
464 if ($drug_id == $form_product) echo " selected";
465 echo ">" . htmlspecialchars($prow['name']) . "\n";
471 <?php
echo htmlspecialchars(xl('Details')); ?
>:
473 <td colspan
='3' nowrap
>
474 <input type
='checkbox' name
='form_details' value
='1'<?php
if ($_POST['form_details']) echo " checked"; ?
> />
479 <td align
='left' valign
='middle'>
480 <table style
='border-left:1px solid; width:100%; height:100%'>
483 <a href
='#' class='css_button' onclick
='mysubmit("submit")' style
='margin-left:1em'>
484 <span
><?php
echo htmlspecialchars(xl('Submit')); ?
></span
>
486 <?php
if ($form_action) { ?
>
487 <a href
='#' class='css_button' onclick
='window.print()' style
='margin-left:1em'>
488 <span
><?php
echo htmlspecialchars(xl('Print')); ?
></span
>
490 <a href
='#' class='css_button' onclick
='mysubmit("export")' style
='margin-left:1em'>
491 <span
><?php
echo htmlspecialchars(xl('CSV Export')); ?
></span
>
502 <?php
if ($form_action) { // if submit (already not export here) ?>
504 <div id
="report_results">
505 <table border
='0' cellpadding
='1' cellspacing
='2' width
='98%'>
507 <tr bgcolor
="#dddddd">
509 <?php
echo htmlspecialchars($product_first ?
xl('Product') : xl('Warehouse')); ?
>
511 <?php
if ($_POST['form_details']) { ?
>
513 <?php
echo htmlspecialchars($product_first ?
xl('Warehouse') : xl('Product')); ?
>
516 <?php
echo htmlspecialchars(xl('Date')); ?
>
519 <?php
echo htmlspecialchars(xl('Invoice')); ?
>
522 <td
class="dehead" colspan
="3">
523 <?php
echo htmlspecialchars($product_first ?
xl('Warehouse') : xl('Product')); ?
>
526 <td
class="dehead" align
="right" width
="8%">
527 <?php
echo htmlspecialchars(xl('Start')); ?
>
529 <td
class="dehead" align
="right" width
="8%">
530 <?php
echo htmlspecialchars(xl('Sales')); ?
>
532 <td
class="dehead" align
="right" width
="8%">
533 <?php
echo htmlspecialchars(xl('Distributions')); ?
>
535 <td
class="dehead" align
="right" width
="8%">
536 <?php
echo htmlspecialchars(xl('Purchases')); ?
>
538 <td
class="dehead" align
="right" width
="8%">
539 <?php
echo htmlspecialchars(xl('Transfers')); ?
>
541 <td
class="dehead" align
="right" width
="8%">
542 <?php
echo htmlspecialchars(xl('Adjustments')); ?
>
544 <td
class="dehead" align
="right" width
="8%">
545 <?php
echo htmlspecialchars(xl('End')); ?
>
552 if ($form_action) { // if submit or export
553 $from_date = $form_from_date;
554 $to_date = $form_to_date;
560 $grandqtys = array(0, 0, 0, 0, 0);
561 $priqtys = array(0, 0, 0, 0, 0);
562 $secqtys = array(0, 0, 0, 0, 0);
563 $last_inventory_id = 0;
565 $query = "SELECT s.sale_id, s.sale_date, s.quantity, s.fee, s.pid, s.encounter, " .
566 "s.xfer_inventory_id, s.distributor_id, d.name, lo.title, " .
567 "di.drug_id, di.warehouse_id, di.inventory_id, di.destroy_date, di.on_hand, " .
568 "fe.invoice_refno " .
569 "FROM drug_inventory AS di " .
570 "JOIN drugs AS d ON d.drug_id = di.drug_id " .
571 "LEFT JOIN drug_sales AS s ON " .
572 "s.sale_date >= '$from_date' AND s.sale_date <= '$to_date' AND " .
573 "s.drug_id = di.drug_id AND " .
574 "( s.inventory_id = di.inventory_id OR s.xfer_inventory_id = di.inventory_id ) " .
575 "LEFT JOIN list_options AS lo ON lo.list_id = 'warehouse' AND " .
576 "lo.option_id = di.warehouse_id " .
577 "LEFT JOIN form_encounter AS fe ON fe.pid = s.pid AND fe.encounter = s.encounter " .
578 "WHERE ( di.destroy_date IS NULL OR di.destroy_date >= '$form_from_date' )";
580 // If a product was specified.
582 $query .= " AND di.drug_id = '$form_product'";
585 if ($product_first) {
586 $query .= " ORDER BY d.name, d.drug_id, lo.title, di.warehouse_id, " .
587 "di.inventory_id, s.sale_date, s.sale_id";
589 $query .= " ORDER BY lo.title, di.warehouse_id, d.name, d.drug_id, " .
590 "di.inventory_id, s.sale_date, s.sale_id";
593 $res = sqlStatement($query);
594 while ($row = sqlFetchArray($res)) {
596 // If new lot and it was destroyed during the reporting period,
597 // generate a pseudo-adjustment for that.
598 if ($row['inventory_id'] != $last_inventory_id) {
599 $last_inventory_id = $row['inventory_id'];
600 if (!empty($row['destroy_date']) && $row['on_hand'] != 0
601 && $row['destroy_date'] <= $form_to_date)
603 thisLineItem($row['drug_id'], $row['warehouse_id'], 0,
604 0, $row['name'], $row['title'], $row['destroy_date'],
605 array(0, 0, 0, 0, 0 - $row['on_hand']),
610 $qtys = array(0, 0, 0, 0, 0);
611 if ($row['sale_id']) {
612 if ($row['xfer_inventory_id']) {
613 // A transfer sale item will appear twice, once with each lot.
614 if ($row['inventory_id'] == $row['xfer_inventory_id'])
615 $qtys[3] = $row['quantity'];
617 $qtys[3] = 0 - $row['quantity'];
619 else if ($row['pid'])
620 $qtys[0] = 0 - $row['quantity'];
621 else if ($row['distributor_id'])
622 $qtys[1] = 0 - $row['quantity'];
623 else if ($row['fee'] != 0)
624 $qtys[2] = 0 - $row['quantity'];
625 else // no pid, distributor, source lot or fee: must be an adjustment
626 $qtys[4] = 0 - $row['quantity'];
628 thisLineItem($row['drug_id'], $row['warehouse_id'], $row['pid'] +
0,
629 $row['encounter'] +
0, $row['name'], $row['title'], $row['sale_date'],
630 $qtys, $row['invoice_refno']);
633 // Generate totals for last product and warehouse.
634 thisLineItem(0, '~', 0, 0, '', '', '0000-00-00', array(0, 0, 0, 0, 0));
636 // Grand totals line.
637 if ($form_action != 'export') { // if submit
638 $grei = getEndInventory();
640 <tr bgcolor
="#dddddd">
641 <td
class="detail" colspan
="4">
642 <?php
echo htmlspecialchars(xl('Grand Total')); ?
>
644 <td
class="dehead" align
="right">
645 <?php
echo $grei - $grandqtys[0] - $grandqtys[1] - $grandqtys[2] - $grandqtys[3] - $grandqtys[4]; ?
>
647 <td
class="dehead" align
="right">
648 <?php
echo $grandqtys[0]; ?
>
650 <td
class="dehead" align
="right">
651 <?php
echo $grandqtys[1]; ?
>
653 <td
class="dehead" align
="right">
654 <?php
echo $grandqtys[2]; ?
>
656 <td
class="dehead" align
="right">
657 <?php
echo $grandqtys[3]; ?
>
659 <td
class="dehead" align
="right">
660 <?php
echo $grandqtys[4]; ?
>
662 <td
class="dehead" align
="right">
668 } // end if submit or export
670 if ($form_action != 'export') {
676 } // end if ($form_action)
683 <!-- stuff
for the popup calendar
-->
684 <script language
="Javascript">
685 Calendar
.setup({inputField
:"form_from_date", ifFormat
:"%Y-%m-%d", button
:"img_from_date"});
686 Calendar
.setup({inputField
:"form_to_date", ifFormat
:"%Y-%m-%d", button
:"img_to_date"});