Example #1
0
    def HuntBreshersPrint(self, config_data):
        if(config_data['site_number'] == ""):
            self.set_siteID(re.sub(r'[a-z_\s-]','', self.siteID, flags=re.IGNORECASE))
        else:
            self.set_siteID(config_data['site_number'])
        self.set_siteID(format.padAdd("left","0",8,self.siteID))
        match self.cardType:
            case ("VF"):
                self.set_cardType("VY")
            case ("CCID"):
                self.set_cardType("CC")
            case ("Credit"):
                self.set_cardType("CR")
        #self.set_cardType
        self.set_card(format.padAdd("left","X",20,self.card))
        self.set_tranDate(f"{self.tranDate[4:6]}-{self.tranDate[6:8]}-{self.tranDate[0:4]}")
        self.set_tranTime(f"{self.tranTime[0:2]}:{self.tranTime[2:4]}:00")
        self.set_tranNum(format.padAdd("left","0",4,format.cutLength("right",4,self.tranNum)))
        self.set_pDesc(format.cutLength("Right",30,self.pDesc))
        self.set_quantity(format.decimalPad(3,self.quantity))
        self.set_price(format.decimalPad(4,self.price))
        self.set_totalAmount(f"${format.decimalPad(2,self.totalAmount)}")

        return [self.siteID,self.cardType,self.card,self.tranDate,self.tranTime,
                self.pCode,self.pDesc,self.quantity,self.price,self.totalAmount]
Example #2
0
    def merchantAgPrint(self, config_data):
        if(config_data['site_number'] == ""):
            self.set_siteID(re.sub(r'[a-z_\s-]','', self.siteID, flags=re.IGNORECASE))
        else:
            self.set_siteID(config_data['site_number'])
        
        self.set_siteID(format.padAdd("left","0",8,self.siteID))
        self.set_totalAmount(format.padAdd("left","0",9,re.sub(r'[.]','', format.decimalPad(3,self.totalAmount), flags=re.IGNORECASE)))
        self.set_pCode(format.padAdd("right"," ",20,format.padAdd("left","0",3,self.pCode)))
        self.set_quantity(format.padAdd("left","0",9,re.sub(r'[.]','', format.decimalPad(3,self.quantity), flags=re.IGNORECASE)))
        self.set_price(format.padAdd("left","0",9,re.sub(r'[.]','', format.decimalPad(3,self.price), flags=re.IGNORECASE)))
        self.set_pump(format.padAdd("left","0",2,self.pump))
        self.set_tranNum(format.padAdd("left","0",9,self.tranNum))
        self.set_tranDate(f"{self.tranDate[6:8]}{self.tranDate[4:6]}{self.tranDate[0:4]}")
        self.set_vehicle(format.padAdd("left","0",9,self.vehicle))
        self.set_card(format.padAdd("left","0",9,self.card))
        self.set_account(format.padAdd("left"," ",20,self.account))
        self.set_vehicleID(format.padAdd("left","0",9,self.vehicleID))
        self.set_pName(format.padAdd("right"," ",26,self.pName))
        self.set_cardType(format.mAgCardName(self.cardType))

        driver = self.card
        if self.account == self.card:
                driver = "000000000"
        
        return(f"{self.tranNum}{self.tranDate}{self.tranTime}{self.account}{self.pCode}{' '*20}{self.pName}"
               f"{self.quantity}{self.odometer}{self.vehicle}{self.price}{self.totalAmount}{self.totalAmount}{' '*20}"
               f"{self.siteID}{self.pump}{driver}{' '*53}{self.cardType}{self.account}{self.totalAmount}{' '*52}\n")
Example #3
0
    def JCDoylePrint(self, config_data):
        self.set_pump(format.padAdd("left", "0", 2, self.pump))
        
        self.set_tranNum(str(format.padAdd("left", "0", 6, self.tranNum)))
        self.set_tranDate(f" {str(self.rawTranTime[4:6])}/{str(self.rawTranTime[6:8])}/{str(self.rawTranTime[0:4])}")
        self.set_tranTime(f" {str(self.rawTranTime[8:10])}:{str(self.rawTranTime[10:12])}")
        self.set_account(" " + str(format.padAdd("right", " ", 8, re.sub(r'^0*X+','',format.cutLength("right", 7, self.account)))))
        self.set_totalAmount(" " + str(format.padAdd("left"," ",7,format.decimalPad(2,self.totalAmount))))
        self.set_card(" " + str(format.padAdd("left", " ", 8, self.card)))
        self.set_pCode(" " + str(format.padAdd("left", " ", 2, re.sub(r'product\.id = ','',str(self.pCode)))))
        self.set_quantity(" " + str(format.padAdd("left", " ", 7, str(format.decimalPad(3,self.quantity)))))
        self.set_price(" " + str(format.padAdd("left", " ", 6, str(format.decimalPad(3,self.price)))))
        tranCode = ""

        return(f"{self.tranNum}0{self.account}{self.card}{self.tranDate}{self.tranTime}{self.pCode}{self.quantity}{self.price}{self.totalAmount}\n")
Example #4
0
    def FuelMasterPrint(self, config_data):
        if(config_data['site_number'] == ""):
            self.set_siteID(re.sub(r'[a-z_\s-]','', self.siteID, flags=re.IGNORECASE))
        else:
            self.set_siteID(config_data['site_number'])
        self.set_siteID(format.padAdd("left","0",4,format.cutLength("right",4,self.siteID)))
        self.set_tranDate(f"{self.tranDate[4:6]}{self.tranDate[6:8]}{self.tranDate[2:4]}")
        self.set_account(format.padAdd("left","0",5,format.cutLength("right",5,self.account)))
        self.set_card(format.padAdd("left","0",4,format.cutLength("right",4,self.card)))
        self.set_odometer(format.padAdd("left"," ",6,format.cutLength("right",6,self.odometer)))
        if len(self.pCode) == 2:
            self.set_pCode(re.sub(r'0','',self.pCode[0]) + self.pCode[1])
        self.set_pCode(format.padAdd("left"," ",2,self.pCode))
        if len(self.pump) == 2:
            self.set_pump(re.sub(r'0',' ',self.pump[0]) + self.pump[1])
        self.set_pump(format.padAdd("left"," ",2,self.pump))
        self.set_quantity(format.padAdd("left","0",9,format.decimalPad(2, self.quantity)))
        self.set_price(format.padAdd("left","0",7,format.decimalPad(4,self.price)))
        self.set_totalAmount(format.padAdd("left","0",11,format.decimalPad(2,self.totalAmount)))

        return(f"00{self.siteID}{self.tranDate}{self.tranTime}0000{self.account}0000"
               f"{self.card}{self.odometer}    {self.pCode}{self.pump}{self.quantity}{self.price}"
               f"{self.totalAmount}\n")
Example #5
0
    def gasboyPrint(self, config_data):
        self.set_tranNum(format.padAdd("left", " ", 4, format.cutLength("right", 4, self.tranNum)))
        if(config_data['site_number'] == ""):
            self.set_siteID(re.sub(r'[a-z_\s-]','', self.siteID, flags=re.IGNORECASE))
            if(len(self.siteID) > 2):
                self.set_siteID(self.siteID[len(self.siteID)-2: len(self.siteID)])
            self.set_siteID(self.siteID + " ")
        else:
            self.set_siteID(format.padAdd("left", " ", 2, format.cutLength("right",2,str(config_data['site_number']))) + " ")
        self.set_tranNum(format.padAdd("left"," ",4,format.cutLength("right",4,self.tranNum)) + " ")
        self.set_card(format.padAdd("left"," ",6,format.cutLength("right",6,self.card)) + " ")
        self.set_account(format.padAdd("left"," ",6,format.cutLength("right",6,self.account)) + " ")
        self.set_vehicle(format.padAdd("left"," ",9,format.cutLength("right",9,self.vehicle)) + " ")
        self.set_tranDate(format.padAdd("left"," ",8,f"{self.tranDate[4:6][0].replace('0',' ')}{self.tranDate[4:6][1]}/{self.tranDate[6:8]}/{self.tranDate[2:4]} "))
        self.set_tranTime(format.padAdd("left"," ",5,f"{self.tranTime[0:2][0].strip('0')}{self.tranTime[0:2][1]}:{self.tranTime[2:4]} "))
        self.set_pump(format.padAdd("left","0",2,self.pump) + " ")
        self.set_pCode(format.padAdd("left","0",2,self.pCode) + " ")
        self.set_quantity(format.padAdd("left"," ",9,format.decimalPad(3,self.quantity)) + " ")
        self.set_price(format.padAdd("left"," ",5,format.decimalPad(3,self.price)) + " ")
        self.set_totalAmount(format.padAdd("left"," ",9,format.decimalPad(2,self.totalAmount)) + " ")
        self.set_odometer(format.padAdd("left"," ",6,format.cutLength("right",6,self.odometer)) + " ")

        if(config_data['Dawson'] == True):
            carwash =""
            if self.card[len(self.card)-4:len(self.card)] == self.account[len(self.card)-4:len(self.card)]:
                driver = "000000 "
            else:
                driver = self.card
            for x in ("07 ","08 ","09 "):
                if self.pCode == x:
                    carwash = "CARWASH "
            return(f"{self.siteID}{self.tranNum}{driver}{self.account}000 {self.vehicle}{self.tranDate}{self.pump}{self.pCode}"
                   f"{self.quantity}{self.price}{self.totalAmount}{self.odometer}{carwash}\n")
        else:
            return(f"{self.siteID}{self.tranNum}{self.card}{self.account}000 {self.vehicle}{self.tranDate}{self.pump}{self.pCode}"
                   f"{self.quantity}{self.price}{self.totalAmount}{self.odometer}\n")