X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fbillco-upload;h=a5f67cda44182e581a3cab92aa28cd909033ec6d;hp=ce4a43d5f4ed54a4a87fef693d77af6767d66260;hb=793956b8a0c19d7d39103e94235b0ca13f0f3e84;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1 diff --git a/bin/billco-upload b/bin/billco-upload old mode 100644 new mode 100755 index ce4a43d5f..a5f67cda4 --- a/bin/billco-upload +++ b/bin/billco-upload @@ -1,20 +1,15 @@ -#!/bin/sh +#!/usr/bin/perl -AGENTNUMS="1 2 3" +use FS::UID qw(adminsuidsetup); +use FS::Cron::upload; -date=`date +"%Y%m%d"` -dir="/usr/local/etc/freeside/export.DBI:Pg:dbname=freeside/cust_bill" -cd "$dir" +adminsuidsetup shift or die "usage: billco-upload username agentnum\n"; +my $agentnum = shift or die "usage: billco-upload username agentnum\n"; -for AGENTNUM in $AGENTNUMS; do - - for a in header detail; do - mv agentnum$AGENTNUM-$a.csv agentnum$AGENTNUM-$date-$a.csv - done - - zip agentnum$AGENTNUM-$date.zip agentnum$AGENTNUM-$date-header.csv agentnum$AGENTNUM-$date-detail.csv - - echo $dir/agentnum$AGENTNUM-$date.zip - -done +FS::Cron::upload::billco_upload( 'agentnum' => $agentnum, + 'date' => time, + 'v' => 1, + 'l' => 2, + ); +1;