xns: Roo,
closable : false,
collapsible : false,
- height : 910,
+ height : 600,
modal : true,
resizable : false,
- title : "Edit / Create gltrans",
+ title : "Create / View Transaction",
width : 800,
items : [
{
xtype: 'ContentPanel',
xns: Roo,
- region : 'center',
+ region : 'north',
items : [
{
xtype: 'Form',
{
if (action.type == 'setdata') {
//_this.dialog.el.mask("Loading");
- //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+ if (_this.data.gltrans_id) {
+ this.load({ method: 'GET', params: { '_id' : _this.data.gltrans_id }});
+ return;
+ }
+ _this.grid.footer.onClick('first'); // clear..
return;
}
if (action.type == 'load') {
- _this.dialog.el.unmask();
+ _this.grid.footer.onClick('first');
return;
}
if (action.type =='submit') {
- _this.dialog.el.unmask();
+
_this.dialog.hide();
if (_this.callback) {
xns: Roo.form,
fieldLabel : 'Sequence',
name : 'gltrans_sequence',
+ readOnly : true,
width : 100
},
{
xns: Roo.form,
fieldLabel : 'Journal No.',
name : 'gltrans_journalnumber',
+ readOnly : true,
width : 75
},
{
{
xtype: 'TextField',
xns: Roo.form,
- fieldLabel : 'Entered',
- name : 'gltrans_entered',
+ fieldLabel : 'Created',
+ name : 'gltrans_created',
+ readOnly : true,
width : 150
}
]
xns: Roo.form,
boxLabel : 'Posted',
fieldLabel : 'Status',
- name : 'Posted',
- width : 75
+ name : 'gltrans_posted',
+ width : 100,
+ inputValue : true
},
{
xtype: 'Row',
xns: Roo.form,
boxLabel : 'Recorded in Bank Reconcile',
fieldLabel : ' ',
+ inputValue : true,
name : 'gltrans_rec',
width : 200
},
xns: Roo.form,
boxLabel : 'Deleted',
fieldLabel : 'Deleted',
+ inputValue : true,
name : 'gltrans_deleted',
width : 75
}
xns: Roo.form,
fieldLabel : 'Source',
name : 'gltrans_source',
+ readOnly : true,
width : 100
},
{
xns: Roo.form,
fieldLabel : 'Doc Type',
name : 'gltrans_doctype',
+ readOnly : true,
width : 100
},
{
xns: Roo.form,
fieldLabel : 'References',
name : 'gltrans_misc_id',
+ readOnly : true,
width : 75
+ },
+ {
+ xtype: 'Button',
+ xns: Roo,
+ text : "Show"
}
]
},
{
- xtype: 'TextField',
+ xtype: 'Row',
xns: Roo.form,
- fieldLabel : 'Doc No.',
- name : 'gltrans_docnumber',
- width : 400
+ items : [
+ {
+ xtype: 'TextField',
+ xns: Roo.form,
+ fieldLabel : 'Doc No.',
+ name : 'gltrans_docnumber',
+ width : 100
+ },
+ {
+ xtype: 'TextField',
+ xns: Roo.form,
+ fieldLabel : 'Notes',
+ name : 'gltrans_notes',
+ width : 300
+ }
+ ]
}
]
}
]
+ },
+ {
+ xtype: 'GridPanel',
+ xns: Roo,
+ listeners : {
+ activate : function() {
+ _this.panel = this;
+ if (_this.grid) {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ background : false,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'gltrans',
+ title : "gltrans",
+ grid : {
+ xtype: 'Grid',
+ xns: Roo.grid,
+ listeners : {
+ render : function()
+ {
+ _this.grid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+ if (_this.panel.active) {
+ this.footer.onClick('first');
+ }
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ if (!_this.dialog) return;
+ _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ },
+ autoExpandColumn : 'gltrans_accnt_id',
+ loadMask : true,
+ dataSource : {
+ xtype: 'Store',
+ xns: Roo.data,
+ listeners : {
+ beforeload : function (_self, options)
+ {
+ this.removeAll();
+ if (!_this.form.findField('gltrans_sequence').getValue()) {
+ return false;
+ }
+ options.params.gltrans_sequence = _this.form.findField('gltrans_sequence').getValue();
+ }
+ },
+ remoteSort : true,
+ sortInfo : { field : 'gltrans_source', direction: 'ASC' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/gltrans.php'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ totalProperty : 'total',
+ root : 'data',
+ id : 'id',
+ fields : [
+ {
+ 'name': 'gltrans_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_exported',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_created',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'gltrans_date',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'gltrans_sequence',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_accnt_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_source',
+ 'type': 'string'
+ },
+ {
+ 'name': 'gltrans_docnumber',
+ 'type': 'string'
+ },
+ {
+ 'name': 'gltrans_misc_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_amount',
+ 'type': 'float'
+ },
+ {
+ 'name': 'gltrans_notes',
+ 'type': 'string'
+ },
+ {
+ 'name': 'gltrans_journalnumber',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_posted',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_doctype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'gltrans_rec',
+ 'type': 'int'
+ },
+ {
+ 'name': 'gltrans_username',
+ 'type': 'string'
+ },
+ {
+ 'name': 'gltrans_deleted',
+ 'type': 'int'
+ }
+ ]
+ }
+ },
+ footer : {
+ xtype: 'PagingToolbar',
+ xns: Roo,
+ pageSize : 25,
+ displayInfo : true,
+ displayMsg : "Displaying gltrans{0} - {1} of {2}",
+ emptyMsg : "No gltrans found"
+ },
+ toolbar : {
+ xtype: 'Toolbar',
+ xns: Roo,
+ items : [
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ text : "Add",
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+ listeners : {
+ click : function()
+ {
+ if (!_this.dialog) return;
+ _this.dialog.show( { id : 0 } , function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ }
+ },
+ {
+ xtype: 'Fill',
+ xns: Roo.Toolbar
+ },
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ text : "Delete",
+ cls : 'x-btn-text-icon',
+ icon : rootURL + '/Pman/templates/images/trash.gif',
+ listeners : {
+ click : function()
+ {
+ Pman.genericDelete(_this, 'gltrans');
+ }
+ }
+ }
+ ]
+ },
+ colModel : [
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'gltrans_id',
+ header : 'ID#',
+ width : 50,
+ renderer : function(v) { return String.format('{0}', v); }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ dataIndex : 'gltrans_accnt_id',
+ header : 'Account',
+ width : 75,
+ renderer : function(v,x,r) {
+
+ return String.format('{0}', r.data.gltrans_accnt_id_accnt_descrip);
+ }
+ },
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ align : 'right',
+ dataIndex : 'gltrans_amount',
+ header : 'Gltrans amount',
+ width : 100,
+ renderer : function(v) {
+
+ var vv = Roo.util.Format.number(v,2);
+ if (v*1 < 0 ) {
+ return '<span style="color:red">' + vv + '</span>';
+ }
+ return vv;
+ }
+ }
+ ]
+ }
}
],
north : {
xtype: 'LayoutRegion',
- xns: Roo
+ xns: Roo,
+ height : 150
},
center : {
xtype: 'LayoutRegion',
{
// do some checks?
-
- _this.dialog.el.mask("Saving");
+ if (_this.data.gltrans_id) {
+ return;
+ }
+
_this.form.doAction("submit");
}