use of ar.com.ergio.model.LAR_TaxPayerType in project lar_361 by comitsrl.
the class FiscalDocumentPrint method getCustomer.
/**
* Crea un <code>Customer</code> a partir de una entidad comercial.
* @param bPartnerID ID de la entidad comercial.
* @return el cliente correspondiente.
*/
public Customer getCustomer(int bPartnerID) {
// TODO - Review this implementation
MBPartner bPartner = new MBPartner(Env.getCtx(), bPartnerID, getTrxName());
Customer customer = new Customer();
if (bPartner != null) {
// Se asigna la categorÃa de iva del cliente.
LAR_TaxPayerType taxPayerType = LAR_TaxPayerType.getTaxPayerType(bPartner);
customer.setIvaResponsibility(traduceTaxPayerType(taxPayerType.getName()));
// TODO - Parametrize this method
MInvoice mInvoice = (MInvoice) getOxpDocument();
// Se asigna el nombre del cliente a partir del BPartner.
customer.setName(bPartner.getName());
// Se asigna el domicilio.
MLocation location = MLocation.getBPLocation(Env.getCtx(), mInvoice.getC_BPartner_Location_ID(), getTrxName());
customer.setLocation(location.toString());
// Bpartner.
if (bPartner.getTaxID() != null && !bPartner.getTaxID().trim().equals("")) {
customer.setIdentificationType(Customer.CUIT);
customer.setIdentificationNumber(bPartner.getTaxID());
}
}
return customer;
}
use of ar.com.ergio.model.LAR_TaxPayerType in project lar_361 by comitsrl.
the class FiscalDocumentPrint method createDNFH.
private DNFH createDNFH(final MInOut shipment) {
final DNFH dnfh = new DNFH();
// Se asigna el cliente.
Customer customer = null;
final MBPartner bPartner = new MBPartner(Env.getCtx(), shipment.getC_BPartner_ID(), null);
if (bPartner != null) {
customer = new Customer();
// Se asigna la categorÃa de iva del cliente.
LAR_TaxPayerType taxPayerType = LAR_TaxPayerType.getTaxPayerType(bPartner);
customer.setIvaResponsibility(traduceTaxPayerType(taxPayerType.getName()));
// Se asigna el nombre del cliente a partir del BPartner.
customer.setName(bPartner.getName());
// Se asigna el domicilio.
final MLocation location = MLocation.getBPLocation(Env.getCtx(), shipment.getC_BPartner_Location_ID(), getTrxName());
customer.setLocation(location.toString());
// Se identifica al cliente con el C.U.I.T. configurado en el Bpartner.
if (bPartner.getTaxID() != null && !bPartner.getTaxID().trim().equals("")) {
customer.setIdentificationType(Customer.CUIT);
customer.setIdentificationNumber(bPartner.getTaxID());
}
}
dnfh.setCustomer(customer);
// Recupera el numero de copias a imprimir
int numberOfCopies = MSysConfig.getIntValue("LAR_Remitos_NumeroDeCopias", 0, Env.getAD_Client_ID(shipment.getCtx()));
dnfh.setNumberOfCopies(numberOfCopies);
// Cargar las lineas del remito
loadDNFHLines(shipment, dnfh);
return dnfh;
}