Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 84 additions & 31 deletions brandAndVendor.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,88 @@ INSERT INTO vendor(id, name, strAddress, city, state, zipcode) VALUES(null, 'Bro
INSERT INTO vendor(id, name, strAddress, city, state, zipcode) VALUES(null, 'Cain Inc','4712 Trapoole Way','Livonia','MI','92650');
INSERT INTO vendor(id, name, strAddress, city, state, zipcode) VALUES(null, 'CollectorsRUs','1902 Renaissance Parkway','Atlanta ','GA','30308');

INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,1,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,2,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,3,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,4,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,5,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,6,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,7,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,8,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,9,'reorder',false);
INSERT INTO orders(id,user_id,vendor_id,type,closedInvoice) VALUES(null,1,10,'reorder',false);

INSERT INTO tag(id, name) VALUES(null,'Marvel')
INSERT INTO tag(id, name) VALUES(null,'Batman')
INSERT INTO tag(id, name) VALUES(null,'Hulk')
INSERT INTO tag(id, name) VALUES(null,'Avengers')
INSERT INTO tag(id, name) VALUES(null,'Superman')
INSERT INTO tag(id, name) VALUES(null,'Game of Thrones')
INSERT INTO tag(id, name) VALUES(null,'Aquaman')
INSERT INTO tag(id, name) VALUES(null,'Naruto')
INSERT INTO tag(id, name) VALUES(null,'Bleach')
INSERT INTO tag(id, name) VALUES(null,'Attack on Titian')
INSERT INTO tag(id, name) VALUES(null,'DC ')
INSERT INTO tag(id, name) VALUES(null,'Flash')
INSERT INTO tag(id, name) VALUES(null,'Justic League')
INSERT INTO tag(id, name) VALUES(null,'Deadpool')
INSERT INTO tag(id, name) VALUES(null,'Spiderman')
INSERT INTO tag(id, name) VALUES(null,'Captain America')
INSERT INTO tag(id, name) VALUES(null,'Magic The Gathering')
INSERT INTO tag(id, name) VALUES(null,'Dugeon & Dragons')
INSERT INTO tag(id, name) VALUES(null,'Yugioh')
INSERT INTO tag(id, name) VALUES(null,'Pokemon')
INSERT INTO tag(id, name) VALUES(null,'Wolverine')
INSERT INTO tag(id, name) VALUES(null,'X-Men')
INSERT INTO tag(id, name) VALUES(null,'Antman')
INSERT INTO tag(id, name) VALUES(null,'DareDevil')
INSERT INTO tag(id, name) VALUES(null,'Thor')
INSERT INTO tag(id, name) VALUES(null,'Iron Man')
INSERT INTO tag(id, name) VALUES(null,'Nightwing')
INSERT INTO tag(id, name) VALUES(null,'Hawkman')
INSERT INTO tag(id, name) VALUES(null,'Wonder Woman')
INSERT INTO tag(id, name) VALUES(null,'Supergirl')
INSERT INTO tag(id, name) VALUES(null,'The Walking Dead')


INSERT INTO tag(id, name) VALUES(null,'Marvel');
INSERT INTO tag(id, name) VALUES(null,'Batman');
INSERT INTO tag(id, name) VALUES(null,'Hulk');
INSERT INTO tag(id, name) VALUES(null,'Avengers');
INSERT INTO tag(id, name) VALUES(null,'Superman');
INSERT INTO tag(id, name) VALUES(null,'Game of Thrones');
INSERT INTO tag(id, name) VALUES(null,'Aquaman');
INSERT INTO tag(id, name) VALUES(null,'Naruto');
INSERT INTO tag(id, name) VALUES(null,'Bleach');
INSERT INTO tag(id, name) VALUES(null,'Attack on Titian');
INSERT INTO tag(id, name) VALUES(null,'DC ');
INSERT INTO tag(id, name) VALUES(null,'Flash');
INSERT INTO tag(id, name) VALUES(null,'Justic League');
INSERT INTO tag(id, name) VALUES(null,'Deadpool');
INSERT INTO tag(id, name) VALUES(null,'Spiderman');
INSERT INTO tag(id, name) VALUES(null,'Captain America');
INSERT INTO tag(id, name) VALUES(null,'Magic The Gathering');
INSERT INTO tag(id, name) VALUES(null,'Dugeon & Dragons');
INSERT INTO tag(id, name) VALUES(null,'Yugioh');
INSERT INTO tag(id, name) VALUES(null,'Pokemon');
INSERT INTO tag(id, name) VALUES(null,'Wolverine');
INSERT INTO tag(id, name) VALUES(null,'X-Men');
INSERT INTO tag(id, name) VALUES(null,'Antman');
INSERT INTO tag(id, name) VALUES(null,'DareDevil');
INSERT INTO tag(id, name) VALUES(null,'Thor');
INSERT INTO tag(id, name) VALUES(null,'Iron Man');
INSERT INTO tag(id, name) VALUES(null,'Nightwing');
INSERT INTO tag(id, name) VALUES(null,'Hawkman');
INSERT INTO tag(id, name) VALUES(null,'Wonder Woman');
INSERT INTO tag(id, name) VALUES(null,'Supergirl');
INSERT INTO tag(id, name) VALUES(null,'The Walking Dead');

INSERT INTO brand(id, name) VALUES(null, 'ACE Comics');
INSERT INTO brand(id, name) VALUES(null, 'All Star DC Comics');
INSERT INTO brand(id, name) VALUES(null, 'Atlas Comics');
INSERT INTO brand(id, name) VALUES(null, 'Caliber Comics');
INSERT INTO brand(id, name) VALUES(null, 'Calvary Comics');
INSERT INTO brand(id, name) VALUES(null, 'DC Comics');
INSERT INTO brand(id, name) VALUES(null, 'D. C. Thomson & Co. Ltd');
INSERT INTO brand(id, name) VALUES(null, 'Deep Sea Comics');
INSERT INTO brand(id, name) VALUES(null, 'Disney Comics');
INSERT INTO brand(id, name) VALUES(null, 'La Pastèque');
INSERT INTO brand(id, name) VALUES(null, 'Marvel Comics');
INSERT INTO brand(id, name) VALUES(null, 'Marvel Adventures');
INSERT INTO brand(id, name) VALUES(null, 'Marvel Age');
INSERT INTO brand(id, name) VALUES(null, 'Matrix Graphic Series');
INSERT INTO brand(id, name) VALUES(null, 'Maverick');
INSERT INTO brand(id, name) VALUES(null, 'Max Comics (MAX)');
INSERT INTO brand(id, name) VALUES(null, 'Media Factory');
INSERT INTO brand(id, name) VALUES(null, 'Michael Hunt Publishing');
INSERT INTO brand(id, name) VALUES(null, 'Mighty Comics');
INSERT INTO brand(id, name) VALUES(null, 'Milestone Media');
INSERT INTO brand(id, name) VALUES(null, 'Mille-Îles');
INSERT INTO brand(id, name) VALUES(null, 'Millennium Publications');
INSERT INTO brand(id, name) VALUES(null, 'Milk Shadow Books');
INSERT INTO brand(id, name) VALUES(null, 'MiniKomix');
INSERT INTO brand(id, name) VALUES(null, 'Mirage Studios');
INSERT INTO brand(id, name) VALUES(null, 'Mirror Comics');
INSERT INTO brand(id, name) VALUES(null, 'M. F. Enterprises');
INSERT INTO brand(id, name) VALUES(null, 'MLJ Magazines');
INSERT INTO brand(id, name) VALUES(null, 'Mojo Press');
INSERT INTO brand(id, name) VALUES(null, 'Moonstone Books');
INSERT INTO brand(id, name) VALUES(null, 'MOSAIK Steinchen für Steinchen Verlag');
INSERT INTO brand(id, name) VALUES(null, 'M Press');
INSERT INTO brand(id, name) VALUES(null, 'MU Press');
INSERT INTO brand(id, name) VALUES(null, 'MyInkComics.com');
INSERT INTO brand(id, name) VALUES(null, 'NBM Publishing');
INSERT INTO brand(id, name) VALUES(null, 'Neko Press');
INSERT INTO brand(id, name) VALUES(null, 'Standard Comics');
INSERT INTO brand(id, name) VALUES(null, 'New Century Comics');
INSERT INTO brand(id, name) VALUES(null, 'New Comics Group');
INSERT INTO brand(id, name) VALUES(null, 'Square Enix');
65 changes: 30 additions & 35 deletions client/app/components/add-inventory.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Ember from 'ember';

export default Ember.Component.extend({
session: Ember.inject.service('session'),
itemTypes:[{name:'comic'},{name:'figure'},{name:'game'},{name:'trade'},{name:'apparel'}],
type:null,
genderTypes:[{name:'male'},{name:'female'},{name:'unisex'}],
genderChoice:null,
figureChoices:[{name:'game'},{name:'figure'},{name:'collectable'},{name:'action'}],
figureChoice:null,
//figureChoice:null,
gameChoices:[{name:'card'},{name:'dice'},{name:'board'},{name:'role playing'}],
gameChoice:null,
//gameChoice:null,
materialChoices:[{name:'plush'},{name:'vinyl'},{name:'plastic'},{name:'die-cast'},{name:'metal'}],
materialChoice:null,
//materialChoice:null,
bindingChoices:[{name:'hardback'},{name:'paperback'}],
bindingChoice:null,

total:0,
quanity:0,
issue_num:null,
Expand All @@ -36,7 +36,6 @@ export default Ember.Component.extend({
return true;
}
}

}),
newBrand:Ember.computed('brand',function(){
if(this.get('brand')){
Expand All @@ -55,28 +54,7 @@ export default Ember.Component.extend({
writersOptions:[],
illustratorOptions:[],
tagOptions:[],
bindingOberserver:Ember.observer('bindingType','bindingChoice',function(){
if(this.bindingChoice!=null){
this.set('bindingType',this.bindingChoice.name);
}
}),
materialObserver:Ember.observer('materialType','materialChoice',function(){
if(this.materialChoice!=null){
this.set('materialType',this.materialChoice.name);
}
}),
gameObserver:Ember.observer('gameType','gameChoice',function(){
if(this.gameChoice!=null){
this.set('gameType',this.gameChoice.name);
}
}),
figureObserver:Ember.observer('figureType','figureChoice', function(){
var item = this.get('item');

if(this.figureChoice!=null){
this.set('figureType',this.figureChoice.name);
}
}),
sizeObserver:Ember.observer('size','sizeChoice',function(){
var item = this.get('item');

Expand All @@ -85,13 +63,6 @@ export default Ember.Component.extend({
}

}),
genderObserver:Ember.observer('gender','genderChoice',function(){
var item = this.get('item');

if(this.genderChoice!=null){
this.set('gender',this.genderChoice.name);
}
}),
typeObserver:Ember.observer('type',function(){
var item=this.get('item');
if(this.type.name==='comic' || this.type.name==='trade'){
Expand Down Expand Up @@ -160,11 +131,11 @@ export default Ember.Component.extend({
}
},
setSize(value){
console.log(value);
this.set('detail_id',value);
},
setWriters(event){
const writer = Ember.$(event.target).val();

if(writer.get('firstObject') === "other"){
this.sendAction('newWriter');
} else
Expand Down Expand Up @@ -199,6 +170,30 @@ export default Ember.Component.extend({
},
createNewItem(){
this.sendAction('createNewItem');
},
deleteItem(value){
console.log(value);
this.sendAction('deleteItem',value);
},
setFigure(value){
console.log(value);
this.set('figureChoice',value);
},
setMaterial(value){
console.log(value);
this.set('materialChoice',value);
},
setApparelType(value){
this.set('apparelType',value);
},
setGame(value){
this.set('gameType',value);
},
setBinding(value){
this.set('bindingType',value);
},
setGender(value){
this.set('gender',value);
}
}
});
9 changes: 9 additions & 0 deletions client/app/components/invoice-finder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Ember from 'ember';

export default Ember.Component.extend({
actions:{
setVendor(value){
this.sendAction('findInvoice',value);
}
}
});
20 changes: 20 additions & 0 deletions client/app/components/invoice-graph.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Ember from 'ember';

export default Ember.Component.extend({
actions:{
addToInvoice(value){
this.sendAction('addLineItem',value);
},
removeLineItem(value){
//console.log(value);
this.sendAction('removeLineItem',value);
},
setQuanity(value){
console.log(value);
this.sendAction('setQuanity',value);
},
sendInvoice(value){
this.sendAction('sendInvoice',value);
}
}
});
7 changes: 7 additions & 0 deletions client/app/components/low-inventory-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Ember from 'ember';

export default Ember.Component.extend({
lowStockNum:Ember.computed('details',function(){
return this.get('details').toArray().filterBy('lowStock',true).length;
})
});
9 changes: 9 additions & 0 deletions client/app/components/low-inventory-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Ember from 'ember';

export default Ember.Component.extend({
actions:{
addToInvoice(value){
this.sendAction('findLowInvoice',value);
}
}
});
89 changes: 89 additions & 0 deletions client/app/controllers/adminpage/invoices.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import Ember from 'ember';

export default Ember.Controller.extend({
session: Ember.inject.service('session'),
vendorItems:[],
invoice:null,
vendor:null,
actions:{
findInvoice(value){
console.log(value);
var _this= this;
this.set('vendor',value);
console.log(this.get('vendor'));
this.store.queryRecord('order',{vendor_id:value,closedInvoice:false}).then(function(invoice){
_this.set('invoice',invoice);
});
this.send('getDetails',value);
},
getDetails(value){
var details = this.get('model').details;
details = details.filterBy('item_id.vendor_id.id',value);
this.set('vendorItems',details);
},
addLineItem(values){
var vendor = this.store.peekRecord('vendor',this.get('vendor'));
console.log(vendor);
var detail = this.store.peekRecord('detail',values);
console.log(detail);
var user = this.store.peekRecord('user',this.get('session.session.authenticated.user.id'));
console.log(this.get('session.currentUser'));
////var item = this.store.peekRecord('item',detail.item_id.id);
let lineItem = this.store.createRecord('line',{
order_id:this.get('invoice'),
user_id:user,
detail_id:detail
}).save();
console.log(lineItem);
},
removeLineItem(value){
this.store.findRecord('line', value).then(function(line) {
line.destroyRecord(); // => DELETE to /posts/2
});
},
setQuanity(value){
this.store.findRecord('line',value).then(function(line){
line.save();
});
},
sendInvoice(value){
var vendor = this.store.peekRecord('vendor',this.get('vendor'));
console.log(vendor);
var user = this.store.peekRecord('user',this.get('session.session.authenticated.user.id'));
console.log(user);
this.store.findRecord('order',value).then(function(order){
order.set('closedInvoice',true);
order.save();
});
this.store.createRecord('order',{
type:'reorder',
vendor:vendor,
user_id:user
}).save();
}
/*findLowInvoice(values){
this.set('invoice',null);
console.log(values);
var _this=this;
var item = this.store.peekRecord('item',values);
console.log(item);
this.store.queryRecord('order',{vendor_id:item.vendor_id.id,closedInvoice:false}).then(function(invoice){
_this.set('invoice',invoice);
_this.send('addLineItemLow',item);
_this.send('getDetails',_this.get('invoice.vendor_id.id'));
});
},
addLineItemLow(values){
console.log(values);
var user = this.store.peekRecord('user',this.get('session.session.authenticated.user.id'))
console.log(this.get('session.currentUser'));
////var item = this.store.peekRecord('item',detail.item_id.id);
let lineItem = this.store.createRecord('line',{
order_id:this.get('invoice'),
user_id:user,
item_id:values
}).save();
console.log(lineItem);
}*/
}
});
Loading