Offers
This commit is contained in:
@@ -20,7 +20,7 @@ dbo.offersInit = function () {
|
||||
init: function () {
|
||||
var vm = dbo.offersModel;
|
||||
|
||||
// vm.refreshOffers();
|
||||
vm.refreshOffers();
|
||||
},
|
||||
|
||||
newOffer: function () {
|
||||
@@ -97,8 +97,24 @@ dbo.offersInit = function () {
|
||||
var vm = dbo.offersModel;
|
||||
|
||||
dbo.offerDataService.getAllOffers( vm.archive() ? 'T' : 'F', function ( data ) {
|
||||
vm.offers( data );
|
||||
vm.offers.removeAll();
|
||||
$.each( data, function ( i, p ) {
|
||||
vm.offers.push( new vm.Offer( p ) );
|
||||
} )
|
||||
} );
|
||||
},
|
||||
|
||||
Offer: function ( data ) {
|
||||
this.id = data.id;
|
||||
this.acceptance_chance = data.acceptance_chance;
|
||||
this.projectNumber = data.project ? data.project.projectnumber : null;
|
||||
this.customerName = data.customer ? data.customer.name : null;
|
||||
this.customer_id = data.customer_id;
|
||||
this.startdate = data.startdate ? dbo.helpers.mysql2date( data.startdate ) : null;
|
||||
this.rejectdate = data.rejectdate ? dbo.helpers.mysql2date( data.rejectdate ) : null;
|
||||
this.accepteddate = data.accepteddate ? dbo.helpers.mysql2date( data.accepteddate ) : null;
|
||||
this.acceptance_chance = data.acceptance_chance ? data.acceptance_chance : 0;
|
||||
this.archive = data.archive;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user