extools.report.printers¶
-
class
extools.report.printers.
APChequePrinter
(batchno)[source]¶ Bases:
object
Print cheques for an AP Batch.
This class provides a one-call interface for all the operations required to correctly print cheques for an A/P Payment batch through the AP and BK processing views.
from accpac import * from extools.ui.bare import bareui from extools.report.printers import ( APChequePrinter, SetupError, ChequeCommitError, ReportGenerationError, ) batchno = 81 def main(*args, **kwargs): printer = APChequePrinter(batchno) try: check_report_path = printer.print() except SetupError as e: # handle a failure to setup the temp tables. # e contains details on the failing operation except ReportGenerationError as e: # handle a failure to generate the report. except ChequeCommitError as e: # handle a failure to write information back to AP/BK. # e contains details on the failing operation
Parameters: batchno (int) – A/P Payment batch number -
APBTA_PROCESSCMD_LOCK_EXCL
= 2¶
-
APBTA_PROCESSCMD_UNLOCK
= 0¶
-
APCHK_BATCH_PROCESS
= 2¶
-
APCHK_SET_BATCHNO
= 4¶
-
APCHK_STATUS_ABORT
= 1¶
-
APCHK_STATUS_SUCCESS
= 0¶
-
APCHK_UPDATE_STATUS
= 3¶
-
APTCR_PROCESSCMD_VOID_CHEQUE
= 4¶
-
BKPRFUN_FUNC_FIND_MATCHING
= 1¶
-
BKPRFUN_FUNC_MARK_ENTIRE_RANGE
= 4¶
-
BKPRFUN_FUNC_POST_ALL_IN_SUBRUN
= 5¶
-
BKPRFUN_FUNC_PREP_SUBRUN
= 2¶
-
BKPRFUN_LANG_SELECT_ANY
= 1¶
-
BKPROC_PRINT_CHEQUE
= 1¶
-
BKPROC_PROC_COMPLETE
= 1¶
-
BKREG_STATUS_ADVICE_NOT_PRINTED
= -1¶
-
BKREG_STATUS_NOT_PRINTED
= -2¶
-
BKREG_STATUS_POSTED
= 999¶
-
BKREG_STATUS_PRINTED
= 9¶
-
BTCHSTAT_CQ_PR_INPR
= 8¶
-
BTCHSTAT_READY_TO_POST
= 7¶
-
PAYMTYPE
= 'PY'¶
-
bkprfun_post_cheques
()[source]¶ Post all checks for run.
Creates bank transaction for each cheque issued.
-
end_cheque_printing
()[source]¶ Tell BKPROC that cheque printing is over.
Initial state dosen’t matter, reliably returns 0.
-
prepare_bkprfun
()[source]¶ Prepare the sub-run - sets cheque numbers.
After execution BKREG is full populated and ready for report generation.
-
print
(path=None)[source]¶ Print cheques for a batch and write back details to AP and BK.
Call me! This is the public interface into the class. When called, it will generate the cheques for an A/P batch to PDF through the proper Sage processing views.
Parameters: path (pathlib.Path) – cheque printing output path.
Returns: Path() to cheque report PDF
Return type: pathlib.Path or None on error.
Raises: - SetupError – failed to setup BKREG or APADV tables.
- ReportGenerationError – report generation returned None.
- ChequeCommitError – error writing cheque details to AP or BK.
-
setup_bkprfun
()[source]¶ Setup the Bank Printing Functions for the batch.
Mainly setting up the view with the correct values, as well as kicking the partially composed views that don’t share a first key.
-
-
exception
extools.report.printers.
ExReportPrinterError
(trigger_exc=None)[source]¶ Bases:
extools.errors.ExToolsError