NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package bbsr.highradius.training.action;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.google.gson.Gson;
import com.highradius.common.util.HRCLog;
import com.highradius.common.util.HRCLogFactory;
import com.receivablesradius.deductions.action.BaseAction;
import com.receivablesradius.deductions.constants.JSONRowResult;

import antlr.collections.List;
import bbsr.highradius.training.manager.InvoiceDetailsManager;
import bbsr.highradius.training.model.employee.EmployeeDetails;
import bbsr.highradius.training.model.invoice.trn_customer;
import bbsr.highradius.training.model.invoice.trn_invoice;
import bbsr.highradius.training.model.invoice.trn_invoice_type;
import bbsr.highradius.training.model.invoice.trn_posting_key;

public class InvoiceDetailsAction extends BaseAction {
private static final HRCLog LOGGER = HRCLogFactory.getLog(InvoiceDetailsAction.class);
private InvoiceDetailsManager invoiceDetailsManager;

private String invoice_number;
private String company_code;
private String fiscal_year;
private double invoice_total_amount;
private double invoice_due_amount;
private Date invoice_created_date;
private Date due_date;
private int discount_1_percentage;
private int discount_2_percentage;
private int discount_3_percentage;
private String debit_credit_indicator;
//private Integer pk_invoice_id;
private String customer_name;
private String description;
private String invoice_type;





//public Integer getPk_invoice_id() {
//return pk_invoice_id;
// }

//public void setPk_invoice_id(Integer pk_invoice_id) {
// this.pk_invoice_id = pk_invoice_id;
// }

public InvoiceDetailsManager getInvoiceDetailsManager() {
return invoiceDetailsManager;
}

public void setInvoiceDetailsManager(InvoiceDetailsManager invoiceDetailsManager) {
this.invoiceDetailsManager = invoiceDetailsManager;
}

public String getInvoiceDetails() {
LOGGER.debug("Inside getInvoiceDetails() calls from InvoiceDetailsAction");

Map<String, Object> invoiceDetailsMap = new HashMap<>();
JSONRowResult result = new JSONRowResult();

try {
invoiceDetailsMap = invoiceDetailsManager.getInvoiceDetails(getStartIndex(), getRowsToFetch());
//null check to avoid null pointer exception
if(invoiceDetailsMap != null) {
result.results = invoiceDetailsMap.get("count");
result.rows = invoiceDetailsMap.get("rows");
}
}
catch (Exception e) {
LOGGER.error("Error inside getEmployeeDetails :",e);
return ERROR;
}
Gson gson = new Gson();
String jsonResult = gson.toJson(result);
setOutput(jsonResult);
return SUCCESS;

}
public String addNewInvoiceDetails() {
LOGGER.debug("Inside getIvoiceDetails() called from EmployeeDetailsManager");
JSONRowResult result = new JSONRowResult();
try {
trn_invoice invoiceObj = new trn_invoice();
trn_customer custObj=new trn_customer();
trn_invoice_type invObj=new trn_invoice_type();
trn_posting_key postObj=new trn_posting_key();
//invoiceObj.setPk_invoice_id(pk_invoice_id);
invoiceObj.setInvoice_number(invoice_number);
invoiceObj.setCompany_code(company_code);
invoiceObj.setFiscal_year(fiscal_year);
invoiceObj.setInvoice_total_amount(invoice_total_amount);
invoiceObj.setInvoice_due_amount(invoice_due_amount);
invoiceObj.setInvoice_created_date(invoice_created_date);
invoiceObj.setDue_date(due_date);
invoiceObj.setDiscount_1_percentage(discount_1_percentage);
invoiceObj.setDiscount_2_percentage(discount_2_percentage);
invoiceObj.setDiscount_3_percentage(discount_3_percentage);
invoiceObj.setDebit_credit_indicator(debit_credit_indicator);
custObj.setCustomer_name(customer_name);
invoiceObj.setFk_customer_id(custObj);
invObj.setInvoice_type(invoice_type);
invoiceObj.setFk_invoice_type(invObj);
postObj.setDescription(description);
invoiceObj.setFk_posting_key(postObj);

boolean status = invoiceDetailsManager.addNewInvoiceDetails(invoiceObj);
result.success= status;
} catch (Exception e) {
LOGGER.error("Exception inside addNewInvoiceDetails() : ",e);
return ERROR;
}
Gson gson = new Gson();
String jsonResult = gson.toJson(result);
setOutput(jsonResult);
return SUCCESS;
}

public String getInvoice_number() {
return invoice_number;
}

public void setInvoice_number(String invoice_number) {
this.invoice_number = invoice_number;
}

public String getCompany_code() {
return company_code;
}

public void setCompany_code(String company_code) {
this.company_code = company_code;
}

public String getFiscal_year() {
return fiscal_year;
}

public void setFiscal_year(String fiscal_year) {
this.fiscal_year = fiscal_year;
}

public double getInvoice_total_amount() {
return invoice_total_amount;
}

public void setInvoice_total_amount(double invoice_total_amount) {
this.invoice_total_amount = invoice_total_amount;
}

public double getInvoice_due_amount() {
return invoice_due_amount;
}

public void setInvoice_due_amount(double invoice_due_amount) {
this.invoice_due_amount = invoice_due_amount;
}

public Date getInvoice_created_date() {
return invoice_created_date;
}

public void setInvoice_created_date(Date invoice_created_date) {
this.invoice_created_date = invoice_created_date;
}

public Date getDue_date() {
return due_date;
}

public void setDue_date(Date due_date) {
this.due_date = due_date;
}

public int getDiscount_1_percentage() {
return discount_1_percentage;
}

public void setDiscount_1_percentage(int discount_1_percentage) {
this.discount_1_percentage = discount_1_percentage;
}

public int getDiscount_2_percentage() {
return discount_2_percentage;
}

public void setDiscount_2_percentage(int discount_2_percentage) {
this.discount_2_percentage = discount_2_percentage;
}

public int getDiscount_3_percentage() {
return discount_3_percentage;
}

public void setDiscount_3_percentage(int discount_3_percentage) {
this.discount_3_percentage = discount_3_percentage;
}

public String getDebit_credit_indicator() {
return debit_credit_indicator;
}

public void setDebit_credit_indicator(String debit_credit_indicator) {
this.debit_credit_indicator = debit_credit_indicator;
}

}

     
 
what is notes.io
 

Notes is a web-based application for online 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 14 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.