Article ID: 127811, created on Dec 21, 2015, last review on Dec 21, 2015

  • Applies to:
  • Business Automation


What happens if the resellers customer is to be billed at the same day as the reseller for his resellers subscription? Will the record for the resellers customer subscription be included into the resellers invoice?


Yes, it will be. At first the resellers customers are billed, only then the resellers themselves. bBillRecurring::getAccountListToBill method sorts accounts to bill by the "Depth", e.g.:

[15-12-18 09:00:00.648 BM          RQ186092 TH26223 TRC]     +++[4] Create bills, first pass {}
[15-12-18 09:00:00.648 TaskRunner_ RQ186092 TH26223 TRC]      +++[5] void bBillRecurring::getAccountListToBill(Int, std::vector<STLRT::Type::Numeric<int>, std::allocator<STLRT::Type::Numeric<int> > >&)()
[15-12-18 09:00:00.648 RDBMS       RQ186092 TH26223 INF] Prepare [0x7f3f5486c650]: SELECT "ABD"."AccountID" FROM "AccountBillingDate" "ABD" CROSS JOIN "Account" "A" CROSS JOIN "AccountInheritance" "AI" WHERE ((("AI"."CustomerAccountID" = "ABD"."AccountID") AND ("AI"."VendorAccountID" = $1)) AND (("ABD"."LastBillingDate" IS NULL) OR ("ABD"."LastBillingDate" < $2))) AND (("A"."AccountID" = "AI"."CustomerAccountID") AND ("A"."AStatus" <> $3)) ORDER BY "AI"."Depth" DESC, "A"."AccountID" DESC

and executes makeBillingForAccount for each records from the list. That means that at first the customers which are deeper in AccountInheritance (resellers and subresellers customers) are billed, only then their vendors. So the only chance of the customer's bill not getting included to the resellers invoice is failed first attempt of account billing.

198398b282069eaf2d94a6af87dcb3ff caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF