public void setLocale(Locale locale) { }
public static TaxPayer create(AtrilSession oSes, CustomerAccount oAcc, String sBusinessName, String sTaxId, String sContactPerson, String sEmail, boolean bRequiresActivation, String sVolumesMountBase)
throws NullPointerException, IllegalArgumentException, ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalStateException, IllegalAccessException,
FileNotFoundException, IOException, Exception {
Dms oDms = oSes.getDms();
DocumentIndexer oIdx = oSes.getDocumentIndexer();
Log.out.debug("Begin TaxPayer.create("+sBusinessName+","+sTaxId+","+sEmail+String.valueOf(bRequiresActivation)+","+sVolumesMountBase+")");
long lEnd, lStart = new Date().getTime();
TaxPayer oPayer = new TaxPayer();
oPayer.setDocument(oDms.newDocument(oDms.getDocumentType("TaxPayer"), oAcc.taxpayers(oSes).getDocument()));
oPayer.put("customer_acount", oAcc.getString("account_id"));
oPayer.put("creation_date", new Date());
oPayer.put("active", bRequiresActivation ? "-1" : "1");
oPayer.put("business_name", sBusinessName);
oPayer.put("tax_id", sTaxId);
oPayer.put("contact_person", sContactPerson);
oPayer.put("email", sEmail);
oPayer.save(oSes);
oSes.commit();
Log.out.debug("PROFILING: Save TaxPayer "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
lStart = lEnd;
Document oInvoices = oDms.newDocument(oDms.getDocumentType("Invoices"), oPayer.getDocument());
oInvoices.save("");
oIdx.indexDocument(oInvoices);
Document oBillNotes = oDms.newDocument(oDms.getDocumentType("BillNotes"), oPayer.getDocument());
oBillNotes.save("");
oIdx.indexDocument(oBillNotes);
Document oEmployees = oDms.newDocument(oDms.getDocumentType("Employees"), oPayer.getDocument());
oEmployees.save("");
oIdx.indexDocument(oEmployees);
Log.out.debug("PROFILING: Create TaxPayer child documents "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
lStart = lEnd;