Took some of the new learnings from invoice generation and put into receipt generations. Also moved some shared functions to pmgr.js, and renamed things for consistency.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@239 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -139,6 +139,48 @@ function fmtCurrency(amount) {
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Datepicker helpers
|
||||
|
||||
function datepickerNow(id) {
|
||||
now = new Date();
|
||||
// datepicker seems to squash the time portion,
|
||||
// so we have to pass in a copy of now instead.
|
||||
$("#"+id).datepicker('setDate', new Date(now));
|
||||
$("#"+id).val($("#"+id).val()
|
||||
+ ' '
|
||||
+ (now.getHours() < 10 ? '0' : '')
|
||||
+ now.getHours() + ':'
|
||||
+ (now.getMinutes() < 10 ? '0' : '')
|
||||
+ now.getMinutes());
|
||||
}
|
||||
|
||||
function datepickerSet(fromid, id, a, b) {
|
||||
if (fromid == null)
|
||||
dt = new Date();
|
||||
else
|
||||
dt = new Date($("#"+fromid).datepicker('getDate'));
|
||||
|
||||
if (a != null)
|
||||
dt.setDate(a);
|
||||
if (b != null)
|
||||
dt.setDate(b);
|
||||
|
||||
$("#"+id).datepicker('setDate', dt);
|
||||
}
|
||||
|
||||
function datepickerBOM(fromid, id) {
|
||||
datepickerSet(fromid, id, 1);
|
||||
}
|
||||
|
||||
function datepickerEOM(fromid, id) {
|
||||
datepickerSet(fromid, id, 32, 0);
|
||||
}
|
||||
|
||||
|
||||
// REVISIT <AP>: 20090617
|
||||
// I would rather use XML to pass from JS to PHP, but at the
|
||||
// moment things were working just fine with serialize, and
|
||||
|
||||
Reference in New Issue
Block a user