NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tr.com.java.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;

import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import tr.com.java.dao.SatisYonetimiImp;
import tr.com.java.entity.Kullanici;
import tr.com.java.entity.MusteriTedarikci;
import tr.com.java.entity.OlcuBirimi;
import tr.com.java.entity.Siparis;
import tr.com.java.entity.SiparisSatir;
import tr.com.java.entity.StokKalemleri;
import tr.com.java.entity.Tenant;

@ManagedBean(name = "siparisEkleBean")
@ViewScoped
public class SiparisEkleBean implements Serializable {

private static final Logger LOG = Logger.getLogger(SiparisEkleBean.class.getName());

private Siparis siparis;
private SiparisSatir siparisSatir;
private StokKalemleri stokkalemleri;
private MusteriTedarikci mt;
private Tenant tenant;
private Kullanici kullanici;

private double miktar;
private double birimfiyat;
private double iskontorani;
private double iskontotutar;
private double kdvorani;
private double kdvtutar;
private double tutar;


private double toplam_tutar;

@PostConstruct
public void init() {
LOG.info("init****");
siparis = new Siparis();
siparisSatir = new SiparisSatir();

}

public SiparisEkleBean() {
}

public SiparisEkleBean(Siparis siparis, SiparisSatir siparisSatir, StokKalemleri stokkalemleri, MusteriTedarikci mt, Tenant tenant, Kullanici kullanici, double miktar, double birimfiyat, double iskontorani, double iskontotutar, double kdvorani, double kdvtutar, double tutar, double toplam_tutar) {
this.siparis = siparis;
this.siparisSatir = siparisSatir;
this.stokkalemleri = stokkalemleri;
this.mt = mt;
this.tenant = tenant;
this.kullanici = kullanici;
this.miktar = miktar;
this.birimfiyat = birimfiyat;
this.iskontorani = iskontorani;
this.iskontotutar = iskontotutar;
this.kdvorani = kdvorani;
this.kdvtutar = kdvtutar;
this.tutar = tutar;
this.toplam_tutar = toplam_tutar;
}

public Tenant getTenant() {
return tenant;
}

public void setTenant(Tenant tenant) {
this.tenant = tenant;
}

public Kullanici getKullanici() {
return kullanici;
}

public void setKullanici(Kullanici kullanici) {
this.kullanici = kullanici;
}

public MusteriTedarikci getMt() {
return mt;
}

public void setMt(MusteriTedarikci mt) {
this.mt = mt;
}

public StokKalemleri getStokkalemleri() {
return stokkalemleri;
}

public void setStokkalemleri(StokKalemleri stokkalemleri) {
this.stokkalemleri = stokkalemleri;
}

public List<SiparisSatir> siparisSatirEkleListesi = new ArrayList<>();

public List<SiparisSatir> getSiparisSatirEkleListesi() {
return siparisSatirEkleListesi;
}

public void setSiparisSatirEkleListesi(List<SiparisSatir> siparisSatirEkleListesi) {
this.siparisSatirEkleListesi = siparisSatirEkleListesi;
}

public Siparis getSiparis() {
return siparis;
}

public void setSiparis(Siparis siparis) {
this.siparis = siparis;
}

public SiparisSatir getSiparisSatir() {
return siparisSatir;
}

public void setSiparisSatir(SiparisSatir siparisSatir) {
this.siparisSatir = siparisSatir;
}

public double getMiktar() {
return miktar;
}

public void setMiktar(double miktar) {
this.miktar = miktar;
}

public double getBirimfiyat() {
return birimfiyat;
}

public void setBirimfiyat(double birimfiyat) {
this.birimfiyat = birimfiyat;
}

public double getIskontorani() {
return iskontorani;
}

public void setIskontorani(double iskontorani) {
this.iskontorani = iskontorani;
}

public double getIskontotutar() {
return iskontotutar;
}

public void setIskontotutar(double iskontotutar) {
this.iskontotutar = iskontotutar;
}

public double getKdvorani() {
return kdvorani;
}

public void setKdvorani(double kdvorani) {
this.kdvorani = kdvorani;
}

public double getKdvtutar() {
return kdvtutar;
}

public void setKdvtutar(double kdvtutar) {
this.kdvtutar = kdvtutar;
}

public double getTutar() {
return tutar;
}

public void setTutar(double tutar) {
this.tutar = tutar;
}

public double getToplam_tutar() {
toplam_tutar = tumTutar();
return toplam_tutar;
}

public void setToplam_tutar(double toplam_tutar) {
this.toplam_tutar = toplam_tutar;
}

public void itemEkle() {
siparisSatirEkleListesi.add(new SiparisSatir());
}

public void itemKaldir(SiparisSatir siparisSatir) {
siparisSatirEkleListesi.remove(siparisSatir);
}

public List<StokKalemleri> getStokListesi() {
SatisYonetimiImp satisYonetimiImpl = new SatisYonetimiImp();
return satisYonetimiImpl.tumStoklar(1);
//sessiındaki organizasyon id gelecek
}

public double tumTutar()
{

double d_toplam_tutar=0;
if(siparisSatirEkleListesi != null)
for(int i=0;i<siparisSatirEkleListesi.size();i++)
{

d_toplam_tutar +=siparisSatirEkleListesi.get(i).getTutar();
}

return d_toplam_tutar;
}
public List<OlcuBirimi> getOlcuBirimiListesi() {
SatisYonetimiImp satisYonetimiImpl = new SatisYonetimiImp();
return satisYonetimiImpl.tumOlcuBirimi();
}

public List<MusteriTedarikci> getMusteriTedarikciListe() {
SatisYonetimiImp satisYonetimiImpl = new SatisYonetimiImp();
return satisYonetimiImpl.mtGetir(1);
}

public String siparisEkle() {
FacesContext contex = FacesContext.getCurrentInstance();
SatisYonetimiImp satisYonetimiImpl = new SatisYonetimiImp();
satisYonetimiImpl.siparisOlustur(tenant, kullanici, siparis, siparisSatirEkleListesi);
siparis = new Siparis();
siparisSatirEkleListesi = new ArrayList<>();
contex.addMessage(null, new FacesMessage("kayıt eklendi"));
return "/pages/satis/siparis/GonderilenSiparisIndex.xhtml?faces-redirect=true";
}

@PreDestroy
public void close() {
LOG.info("close******");
}

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.