Commit c3eb752f authored by mjadhav's avatar mjadhav

set Expendiente value to generate XML


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97242 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e1de26cf
......@@ -1134,10 +1134,10 @@ public class GenInvoiceSchedule implements Schedule {
String sql="",purchaseOrd="",saleOrder="",despId="",phyAttrib_10="";
String custCode="",currencyCode="",itemCode="",itemDescr="",quantity="",unit="";
String taxCode="",taxClass="",taxBase="",taxChap="",taxEnv="",exchRate="",discAmt="";
String taxCode="",taxClass="",taxBase="",taxChap="",taxEnv="",exchRate="",discAmt="",msg_specs="";
String currCodeHd="",invoiceISOCode="";
String itemCodeDet="",itemDescrDet="",quantityDet="",unitDet="",accDet="",instAmtDet="";
String rate="",unitRate="",discountInv="",taxEffects="",siteCode="",paymentMeans="",docStatus="";
String rate="",unitRate="",discountInv="",taxEffects="",siteCode="",paymentMeans="",docStatus="",custCodeBillHD="";
double taxBaseAmt=0.00,taxAmtHd=0.00 ,NetAmtHd=0.00,discAmtHd=0.00,invoiceAmtHd=0.00,rateDet=0.00;
double netAmtDet=0.00,discAmtDet=0.00,taxAmt=0.00,taxPersc=0.00,discountDet=0.00,totalCost=0.0,grossAmount=0.0,totalGrossAmount=0.0;
double totTaxBaseAmt=0.0,totTaxAmt=0.0;
......@@ -1165,7 +1165,7 @@ public class GenInvoiceSchedule implements Schedule {
sdf=new SimpleDateFormat("yyyy-MM-dd");
sql = " select INV_AMT,TAX_AMT,DISC_AMT,NET_AMT,CURR_CODE,TRAN_DATE ,SITE_CODE ,SALE_ORDER,DESP_ID,DUE_DATE from invoice " +
sql = " select INV_AMT,TAX_AMT,DISC_AMT,NET_AMT,CURR_CODE,TRAN_DATE ,SITE_CODE ,SALE_ORDER,DESP_ID,DUE_DATE,CUST_CODE__BIL from invoice " +
"where invoice_id=?" ;
pstmt = conn.prepareStatement(sql);
......@@ -1184,6 +1184,7 @@ public class GenInvoiceSchedule implements Schedule {
saleOrder= rs.getString("SALE_ORDER");
despId= rs.getString("DESP_ID");
dueDateHd = rs.getDate("DUE_DATE");
custCodeBillHD = rs.getString("CUST_CODE__BIL");
}
rs.close();
......@@ -1194,6 +1195,7 @@ public class GenInvoiceSchedule implements Schedule {
saleOrder = saleOrder == null ? " " : saleOrder.trim();
despId = despId == null ? " " : despId.trim();
custCodeBillHD = custCodeBillHD == null ? " " : custCodeBillHD.trim();
......@@ -1275,6 +1277,48 @@ public class GenInvoiceSchedule implements Schedule {
purchaseOrd = purchaseOrd == null ? " " : purchaseOrd.trim();
/*----------------------------------------------------------------------------*/
/*sql=" select MSG_SPECS from CUSTOMERITEM ci, invoice i, invdet idet" +
" where ci.cust_code=i.cust_code__bil " +
" and idet.item_code = ci.item_code and idet.item_code = ? and i.cust_code__bil= ? ";*/
sql = "select MSG_SPECS from CUSTOMERITEM ci,customer c , item i where " +
" c.cust_code = ci.cust_code and i.item_code = ci.item_code " +
" and ci.item_code=? and ci.cust_code=? " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCodeDet);
pstmt1.setString(2, custCodeBillHD);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
msg_specs = rs1.getString("MSG_SPECS");
msg_specs = msg_specs == null ? " " : msg_specs.trim();
tempMap.put("msg_specs" + cnt, msg_specs);
}
else
{
tempMap.put("msg_specs" + cnt, "");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
System.out.println("msg_specs :"+msg_specs);
/*------------------------------------------------------------------------------*/
sql = "select PHY_ATTRIB_10 from item where item_code= ? " ;
pstmt1 = conn.prepareStatement(sql);
......@@ -1442,7 +1486,7 @@ public class GenInvoiceSchedule implements Schedule {
System.out.println("***************InvoiceHeader***********************");
Element invoiceParent = doc.createElement("Invoices");
Element invoice = doc.createElement("Invocntice");
Element invoice = doc.createElement("Invoice");
Element invoiceHeader = doc.createElement("InvoiceHeader");
invoiceHeader.appendChild(getElementValue(doc, invoiceParent, "InvoiceNumber", invoiceId));
......@@ -1539,7 +1583,7 @@ public class GenInvoiceSchedule implements Schedule {
Element invoiceTotals = doc.createElement("InvoiceTotals");
invoiceTotals.appendChild(getElementValue(doc, invoiceParent, "TotalGrossAmount",utilMethods.getReqDecString(totalGrossAmount,2)));
Element generalDiscounts = doc.createElement("GeneralDiscounts");
Element discount = doc.createElement("DtotTaxBaseAmtDetiscount");
Element discount = doc.createElement("Discount");
//discount.appendChild(getElementValue(doc, invoiceParent, "DiscountReason", "Sales Promotions"));
discount.appendChild(getElementValue(doc, invoiceParent, "DiscountReason", "Descuentos Varios"));
discount.appendChild(getElementValue(doc, invoiceParent, "DiscountAmount", utilMethods.getReqDecString(discAmtHd,6)));
......@@ -1575,6 +1619,7 @@ public class GenInvoiceSchedule implements Schedule {
System.out.println("TaxableBase :"+i+": "+utilMethods.getReqDecString(taxBaseAmt,2));
System.out.println("TaxAmount :"+i+": "+(String) tempMap.get("tax_amt" + i));
System.out.println("total cost :"+i+": "+(String) tempMap.get("total_cost" + i));
System.out.println("msg_specs :"+i+": "+(String) tempMap.get("msg_specs" + i));
......@@ -1686,7 +1731,7 @@ public class GenInvoiceSchedule implements Schedule {
invoiceLine.appendChild(getElementValue(doc, invoiceParent, "AdditionalLineItemInformation", "Nº Pedido:"+purchaseOrd+"- Nº Albarán:"+despId+"- Nº Expediente:"));
invoiceLine.appendChild(getElementValue(doc, invoiceParent, "AdditionalLineItemInformation", "Nº Pedido:"+purchaseOrd+"- Nº Albarán:"+despId+"- Nº Expediente:"+(String) tempMap.get("msg_specs" + i)));
items.appendChild(invoiceLine);
......@@ -1719,7 +1764,8 @@ public class GenInvoiceSchedule implements Schedule {
/*-----------------added on dated 29-jan-2015--------------------------*/
Element additionalData = doc.createElement("AdditionalData");
additionalData.appendChild(getElementValue(doc, invoiceParent, "InvoiceAdditionalInformation", "Nº Pedido:"+purchaseOrd+"- Nº Albarán:"+despId+"- Nº Expediente:"));
additionalData.appendChild(getElementValue(doc, invoiceParent, "InvoiceAdditionalInformation", "Nº Pedido:"+purchaseOrd+"- Nº Albarán:"+despId+"- Nº Expediente:"+(String) tempMap.get("msg_specs1")));
invoice.appendChild(additionalData);
/*--------------------------------------------------------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment